Hi,

 I have one link within the DataView and one directly attached to the
Panel. The link within the DataView is added to the item within the
populateItem() method.  This links gives me error when called *when*
the page is created:

WicketMessage: org.apache.wicket.WicketRuntimeException: component
events:dc:events:1:f:show_lk not found on page <mypage>[id = 2],
listener interface = [RequestListenerInterface name=IBehaviorListener,
method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]

But, when I click another AjaxFallbackLink which is outside the
DataView then the link within the DataView starts working. I should be
calling something good in the link which is directly on the Panel.
Code of the AjaxFallbackLink#onClick outside the DataView is:
AjaxFallbackLink sort2_lk = new AjaxFallbackLink("sort2_lk") {
public void onClick(AjaxRequestTarget target) { 
                               dataContainer.remove("events");
                                DataView dataView = createEventsDataView(list);
                                dataContainer.add(dataView);
                                target.addComponent(dataContainer);
}
};
dataContainer.add(sort2_lk);

Dataview is added to the panel using:
                 final WebMarkupContainer dataContainer = new
WebMarkupContainer("dc");
                dataContainer.setOutputMarkupId(true);
                dataContainer.setOutputMarkupPlaceholderTag(true);
                 ....

                DataView dataView = createEventsDataView(basicCommentWebs);
                dataContainer.add(dataView);
                dataContainer.add(setNavigator(dataContainer, dataView));
                add(dataContainer);


private DataView createEventsDataView(List<BasicCommentWeb> list) {
                final DataView dv = new DataView("events", new ListDataProvider(
                                list)) {
                        @Override
                        protected void populateItem(final Item item) {
                         ...
                               Form f = new Form("f");
                                AjaxFallbackLink hide_lk = new
AjaxFallbackLink("show_lk") {
                                        @Override
                                        public void onClick(AjaxRequestTarget 
target) {
                                                System.out.println("\n Hide on 
onClick");
                                                //mcp.setVisible(false);
                                                //target.addComponent(mcp);
                                        }
                                };
                                f.add(show_lk);
                       }

I have added setOutputMarkupId(true) and
setOutputMarkupPlaceholderTag(true) on the Form and links also, but
results are still the same.

What i am doing special in the case of AjaxFallBackLink which is
attached directly to the Panel?
thanks
devush

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to