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-tp3252215p3252215.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