the trick would be to factor out the id into a parameter of the function. i assume the _javascript_ function is the same for all rows?

so you can add an css id attr to each listitem using an attribute modifier. a good id to use is the getPageRelativePath() of if you are using HEAD try getMarkupId(). notice you cannot call these from the constructor because that information is not yet available to the component, so you have to defer retrieving it using an IModel and an attribute modifier. this shortcomming will be fixed after the constructor refactor.

hope this gets you started, let us know if you have more detailed questions.

-Igor


On 2/4/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
In listviews you have the iteration number too: ListItem.getIndex. And
as attribute modifiers work with IModel instances too - which are in
fact model locators - you can implement all the dynamic behavior you
need. But if you come from working with JSP's a lot, you definitively
have to get used to some aspects of working with Wicket.

Eelco


On 2/4/06, Mark Derricutt <[EMAIL PROTECTED]> wrote:
> On 2/5/06, Martijn Dashorst < [EMAIL PROTECTED]> wrote:
> > AttributeModifiers allow you to generate ID's yourself. These could
> > then be used in the _javascript_.
> >
>
> This still has the problem that the _javascript_ needs to be
> generated/dynamically modified somehow.  Under JSP style hackery you might
> have a local variable/object that points to the iteration in the loop, and
> you could do something nasty like:
>
>   <tr>
>     <td>
>       <script>  callSomethingWith("aKnownPrefix<c:out
> value='${iteration}'/>"); </script>
>
> Which is quite nasty looking.  I guess I'm trying to cling to the "old" way
> too much thou.
>
> --
>
> i like my video games - mamma said they are gonna melt my brains
> i like my video games - i don't care what daddy said; they're my reality
>   - henning pauly


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to