you can give dataview IItemReuseStrategy so new row items are not generated
every request.

so something like: dataview.setItemReuseStrategy(
ReuseIfModelsEqualStrategy.getInstance());

then override hashcode/equals on the model class that is passed to
dataview.populateitem and if the same row remains onscreen between request
new item will not be generated for it.

-igor


On 2/7/07, Alexis <[EMAIL PROTECTED]> wrote:


Let me explain a little problem i came across lately.
I have a DataView containing rows, each row contains an AjaxCheckbox.
I have also AjaxLinks that perform actions on selected rows.

Everything works fine, to spice it up I want to  add some js effects on
checked rows when an AjaxLink is clicked. Here's my first naive attempt :

// When a checkbox is clicked : put the corresponding id in some List,
refresh the dataview (=container)
// ligneContainer is a DataView Item (=row component)
protected void onUpdate(AjaxRequestTarget target) {
      selectedRowsId.add(ligneContainer.getMarkupId());
      target.addComponent(container);
}

// When the AjaxLink is clicked : for all the id's generate a js Effect
public void onClick(AjaxRequestTarget target) {
       for (String id : selectedRowsId) {
            target.appendJavascript("new Effect.Highlight($('" + id +
"'));");
        }
        target.addComponent(container);
}

Of course that doesn't : new id's are generated with the ajax response
therefore id's that i refer to in JS are already stale.
How could i solve this ?

Thanks for your answers !

--
View this message in context:
http://www.nabble.com/JS-effects-on-DataView-rows-tf3185970.html#a8842710
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to