0

load-after in java

asked 2012-01-10 16:18:20 +0800

dagarwal82 gravatar image dagarwal82
246 4

I am attaching model and renderer in controller, is there anyway to set load-after in java with model ?

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-01-12 02:05:23 +0800

iantsai gravatar image iantsai
2755 1

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());
      }
});

}

link publish delete flag offensive edit

answered 2012-01-11 14:50:56 +0800

dagarwal82 gravatar image dagarwal82
246 4

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' ">

What is the counter part in java for this.

link publish delete flag offensive edit

answered 2012-01-11 11:34:08 +0800

iantsai gravatar image iantsai
2755 1

updated 2012-01-11 11:37:04 +0800

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.

link publish delete flag offensive edit

answered 2012-01-11 11:02:34 +0800

dagarwal82 gravatar image dagarwal82
246 4

Like, I have 2 buttons with id 'ok' and 'cancel'

After clicking on these buttons i should be able to reload model in java.

link publish delete flag offensive edit

answered 2012-01-11 07:25:46 +0800

iantsai gravatar image iantsai
2755 1

what kind of load-after that you want to have? or maybe I should ask what you want to do in your scenario?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-01-10 16:18:20 +0800

Seen: 148 times

Last updated: Jan 12 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More