ok i know the basic examble about autoincrement label value with an ajax Link
but,
what i don't know is how simply reload the content of a component:
i give you an example on what i want to do (i write it very very
quickly...)!
a page with 2 panels, one of these read data from his model, the other use a
link to launch an event
where get the page and first modifies the shared model, then reload only the
second panel.
now... i know that don't work... but... anyone can teach me where i fail and
how is the correct implementation? thanks a lot.
public class MyPage extends WebPage {
public Model model = new Model("initial value");
public Panel panel2 = new PanelTwo("two",model);
public MyPage() {
add(new PanelOne("one"));
panel2.setOutputMarkupId(true); //needed to call renderComponent
method ?
add(panel2);
}
}
public class PanelOne extends Panel {
public PanelOne(String id) {
super(id);
add(new AjaxFallbackLink("elementLink") {
public void onClick(AjaxRequestTarget target) {
((MyPage)getPage()).model.setObject("new value");
((MyPage)getPage()).panel2.renderComponent();
}
});
}
}
public class PanelTwo extends Panel {
public PanelTwo(String id,IModel model) {
super(id,model);
add(new Label("message", model.getObject().toString()));
}
}
--
View this message in context:
http://www.nabble.com/Basic-Knowledge-on-Wicket---reload-content-of-a-panel-tp15711163p15711862.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]