not sure what activate does, I would hope though that it would add the object
to a panel on the page, and then you call "target.addComponent(<panel>);" As
this target (the AjaxRequestTarget) deals with actually updating the front
end of the page.

Also Data Repeaters are somewhat dubious in that they refresh their content
on each reload, so don't try to add the content to the DataView itself
(which I assume you are not). Similarly using the model and not the value of
the model might cause some issues, I am not sure. The stack error trace
after this first visual issue is fixed would be useful.

I do presume they are somewhat separate (ie: fixing one won't solve the
other).

Matthew


shetc wrote:
> 
> Hi All,
> 
> I am trying to add an onclick event to a table row -- each row is created
> using a DataView.
> To make an entire row clickable, I add an AjaxEventBehavior via the
> DataView's Item newItem method.
> This seems to work as far as an onEvent event being raised when I click on
> a table row.
> However, I am trying to activate a BreadCrumbPanel from within the onEvent
> event. Nothing seems
> to happen as far as showing the next panel (called JobDescPanel). If I
> click on the row again
> then a component not found on page exception is thrown. I have supplied a
> snippet of code below.
> Is it wrong to try and activate a breadcrumb from this Ajax event?
> 
> Thanks,
> Steve
> 
> P.S. Using Wicket 1.4.10
> 
> 
>       private void buildDataView() 
>       {
>               final DataView<JobSearchResult> dv = new
> DataView<JobSearchResult>("dataView", jsdp) {
>                       private static final long serialVersionUID = 1L;
> 
>                       @Override
>                       protected Item<JobSearchResult> newItem(String id, int 
> index, final
> IModel<JobSearchResult> model) {
>                               Item<JobSearchResult> item = super.newItem(id, 
> index, model);
>                               item.add(new AjaxEventBehavior("onclick") {
>                                       private static final long 
> serialVersionUID = 1L;
>                                       @Override
>                                       protected void 
> onEvent(AjaxRequestTarget target) {
>                                               activate(new 
> IBreadCrumbPanelFactory() {
>                                                       private static final 
> long serialVersionUID = 1L;
>                                                       public BreadCrumbPanel 
> create(String componentId, IBreadCrumbModel
> bcm) {
>                                                               JobSearchResult 
> jsr = model.getObject();
>                                                               return new 
> JobDescPanel(componentId, bcm, homePage,
> jsr.getOrderId());
>                                                       }
>                                               });
>                                       }
>                               });
>                               return item;
>                       }
> 
>                       ...
>       }
> 
> 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-DataView-newItem-method-to-display-a-BreadCrumbPanel-tp3252215p3252973.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to