-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4284612
By: alexdusty
Hello,
I would like to use create a grid to navigate through a (very) big data set, and that's no problem implementing a custom data model and using pagination.
But this way I have to render the rows "by hand" coding a custom RowRenderer.
I would like to reach a similar result but by using Annotations for data binding so that I do not need to create the Row with code.
With the AnnotateDataBinder I can't provide any more a DataModel because it wants a List, Set or Map as a base object, so what can I do?
Maybe I could subclass (for example) a List? But this is much more demandind that simply implement the ListModel interface.
Someone has suggestions?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4284613
By: alexdusty
Hello,
I would like to use create a grid to navigate through a (very) big data set, and that's no problem implementing a custom data model and using pagination.
But this way I have to render the rows "by hand" coding a custom RowRenderer.
I would like to reach a similar result but by using Annotations for data binding so that I do not need to create the Row with code.
With the AnnotateDataBinder I can't provide any more a DataModel because it wants a List, Set or Map as a base object, so what can I do?
Maybe I could subclass (for example) a List? But this is much more demandind that simply implement the ListModel interface.
Someone has suggestions?
P.S.: I'm sorry, I posted the message in the "install" forum, I reposted it here where it's more appropriate
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4287395
By: robbiecheng
Would you please tell me about the data-type of your case?
/Robbie
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4288644
By: henrichen
1. Implement a BindingListModel as you might have done.
2. "disable" the default ListModelConverter by specify a none there.
<a:bind model="your-model-class;converter:none"/>
/henri
P.S. I will allow ListModelConverter to accept BindingListModel as an input.
See this feature-request.
https://sourceforge.net/tracker/index.php?func=detail&aid=1710373&group_id=15276
2&atid=785194
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4289131
By: alexdusty
Hello Henri and thanks for the reply.
I'll try your suggestions.
Another question: how may I trigger a refresh of the rows if the model changes?
In particular my windows does a search on a (big) table, and if the user changes the search criteria the grid (and/or a listbox) must reflect changes.
In traditional way I can issue a "setModel" to update the content, but with annotations is this possible?
Thanks,
Alex
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4311386
By: simon_massey
Alex,
That is a good question. If you look at the foodToGo sample app here:
http://zkforge.svn.sourceforge.net/viewvc/zkforge/trunk/foodToGo/src/main/webapp
/zul/index.zul?revision=285&view=markup
then at line 34,35 you can see that we use binding annotations. Then at lines 57-60 post we refresh the list of POJOs from the database if the users hits the refresh button. Then we get the data bound model and do a removeAll followed by an addAll to put the new data into the list. In the cold light of day it should have been a clear then an addAll ;)
I am thinking that menu-items.zul should be refactored to use either bind annotations or a RowRenderer. Currently the app is going a crude <include> refresh...
Simon
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4328068
By: devilgary
Another way I found which is working. In this example I use ListModelList but in the practice can be different depends of Collection data type you use. For example ListModelMap for Map type of object.
List dataList = .. //retrieve the data from somewhere
ListModelList modelList = (ListModelList) myListBox.getModel(); modelList.clear(); //clear all the contents of myListbox 1st modelList.addAll(dataList); //repopulating all data and myListbox should be refreshed with new data =)
I hope it helps.
Regards,
Gary Purnomosidi
Hello, I'm sorry to reopen an old thread.
I'm new to ZK and I have a question about live data. I read through the documentation and as far as I understand, if I need more than one column, I must implement a rowrenderer or listitem renderer, but if I use the databinding annotations, I can use the properties of a bean to display my information. But I don't really need to data bind my model, I just use this listbox to display some results. Is there a problem if I use the databinding annotations instead of implementing a renderer and use live data?
Hi arscek,
If you dont want to bind live data , please try using EL( ${} ) instead.
Asked: 2007-04-27 18:44:59 +0800
Seen: 1,676 times
Last updated: Feb 04 '12