Re: Reloading HeadersToolbar
Thanks for the response, Jeremy. CnvDataTable.onSortChanged() now subclasses CnvOrderByLink.onSortChanged(). I've tried adding the cnvDataTable and a WebMarkupContainer wrapper to the target, but I wasn't successful with either. Any other ideas? Thanks for the help. Unrelated question: If reloading a parent object, is it necessary for its children objects to call setOutputMarkupId(true) in order for the them to reload? Thanks, Ryan On Jan 20, 2009, at 7:01 PM, Jeremy Thomerson wrote: This is your problem (I think): In DataTable, when a toolbar is added, it is calling: toolbar.setRenderBodyOnly(true); Hence, the error message. Try seeing if you can add the entire table to the AJAX target (or any outer container of it) so that the entire thing is repainted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 20, 2009 at 4:27 PM, Ryan O'Hara wrote: I've created a customized CnvHeaderToolbar which like HeadersToolbar extends AbstractToolbar. In addition to the header title, I also have inserted a triangle image that helps to display sort order and sort order direction. The problem I am having is that I have been unable to figure out how to reload CnvHeaderToolbar when an OrderByLink is clicked, so that the new sort order triangle image can be displayed. I've have also created custom CnvOrderByBorder and CnvOrderByLink objects. I have hooked into these two classes onClick/onSortChanges, so that I have access to the AjaxRequestTarget from CnvOrderByLink in CnvHeaderToolbar. Below is some code: CnvHeaderToolbar: protected WebMarkupContainer newSortableHeader(String headerId, String property, ISortStateLocator locator, PageParameters params, Class page) { return new CnvOrderByBorder(headerId, property, locator) { private static final long serialVersionUID = 1L; public void onClick() { System.out.println("In newSortableHeader: OnClick()"); ((CnvDataTable) getTable()).setHeaderClicked(true); } protected void onSortChanged(AjaxRequestTarget target) { System.out.println("In newSortableHeader: OnSortChanged()"); ((CnvDataTable) getTable()).setHeaderClicked(true); //target.addComponent(); } }; } The latest I error I got when trying to reload CnvHeaderToolbar in the onSortChanged() method above is: "Ajax render cannot be called on component that has setRenderBodyOnly enabled." Any advice on how to reload the HeadersToolbar? The actual sorting is working, it's just that the triangle images are not being reloaded. Any help would be greatly appreciated. Thanks, Ryan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reloading HeadersToolbar
This is your problem (I think): In DataTable, when a toolbar is added, it is calling: toolbar.setRenderBodyOnly(true); Hence, the error message. Try seeing if you can add the entire table to the AJAX target (or any outer container of it) so that the entire thing is repainted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 20, 2009 at 4:27 PM, Ryan O'Hara wrote: > I've created a customized CnvHeaderToolbar which like HeadersToolbar > extends AbstractToolbar. In addition to the header title, I also have > inserted a triangle image that helps to display sort order and sort order > direction. The problem I am having is that I have been unable to figure out > how to reload CnvHeaderToolbar when an OrderByLink is clicked, so that the > new sort order triangle image can be displayed. I've have also created > custom CnvOrderByBorder and CnvOrderByLink objects. I have hooked into > these two classes onClick/onSortChanges, so that I have access to the > AjaxRequestTarget from CnvOrderByLink in CnvHeaderToolbar. Below is some > code: > > CnvHeaderToolbar: > > protected WebMarkupContainer newSortableHeader(String headerId, String > property, > ISortStateLocator > locator, PageParameters params, Class page) { >return new CnvOrderByBorder(headerId, property, locator) { > >private static final long serialVersionUID = 1L; > >public void onClick() { >System.out.println("In newSortableHeader: OnClick()"); >((CnvDataTable) getTable()).setHeaderClicked(true); >} > >protected void onSortChanged(AjaxRequestTarget target) { >System.out.println("In newSortableHeader: OnSortChanged()"); >((CnvDataTable) getTable()).setHeaderClicked(true); >//target.addComponent(); >} >}; > >} > > The latest I error I got when trying to reload CnvHeaderToolbar in the > onSortChanged() method above is: > > "Ajax render cannot be called on component that has setRenderBodyOnly > enabled." > > Any advice on how to reload the HeadersToolbar? The actual sorting is > working, it's just that the triangle images are not being reloaded. Any > help would be greatly appreciated. > > Thanks, > Ryan > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Reloading HeadersToolbar
I've created a customized CnvHeaderToolbar which like HeadersToolbar extends AbstractToolbar. In addition to the header title, I also have inserted a triangle image that helps to display sort order and sort order direction. The problem I am having is that I have been unable to figure out how to reload CnvHeaderToolbar when an OrderByLink is clicked, so that the new sort order triangle image can be displayed. I've have also created custom CnvOrderByBorder and CnvOrderByLink objects. I have hooked into these two classes onClick/ onSortChanges, so that I have access to the AjaxRequestTarget from CnvOrderByLink in CnvHeaderToolbar. Below is some code: CnvHeaderToolbar: protected WebMarkupContainer newSortableHeader(String headerId, String property, ISortStateLocator locator, PageParameters params, Class page) { return new CnvOrderByBorder(headerId, property, locator) { private static final long serialVersionUID = 1L; public void onClick() { System.out.println("In newSortableHeader: OnClick()"); ((CnvDataTable) getTable()).setHeaderClicked(true); } protected void onSortChanged(AjaxRequestTarget target) { System.out.println("In newSortableHeader: OnSortChanged()"); ((CnvDataTable) getTable()).setHeaderClicked(true); //target.addComponent(); } }; } The latest I error I got when trying to reload CnvHeaderToolbar in the onSortChanged() method above is: "Ajax render cannot be called on component that has setRenderBodyOnly enabled." Any advice on how to reload the HeadersToolbar? The actual sorting is working, it's just that the triangle images are not being reloaded. Any help would be greatly appreciated. Thanks, Ryan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org