-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am attaching model and renderer in controller, is there anyway to set load-after in java with model ?
Like, I have 2 buttons with id 'ok' and 'cancel'
After clicking on these buttons i should be able to reload model in java.
If the data of the model that your Grid is using hasn't been changed, then there's no need to reload the model.
If you are using ZK's standard impl of ListModel(ex: ListModelList), you should operate that ListModelList instead of operate the original collections.
If you have to implement your own ListModel by extending AbstractListModel, then inside the implementation of every record operation methods in this model need to have fireEvent(int type, int index0, int index1) been called correctly.
finally, if you are too lazy and don't care the performance(be cause the cost is affordable in your case), you can always call setModel() of that Component with newly constructed model instance.
What I want to know is that is there anyway to use 'load-after' in java ?
<listbox model="${win$composer.mymodel, load-after='ok.onClick' ">
Then, I think this is what you want, just do it straightforward.
//in your composer... public void doAfterCompose(Component comp){ okBtn.addEventListener("onClick", new EventListener(){ public void onEvent(Event event){ listbox.setModel(getMyModel()); } }); }
Asked: 2012-01-10 16:18:20 +0800
Seen: 148 times
Last updated: Jan 12 '12