This:

Component first = null;
Component last = null;
for(Foo foo : foos) {
    last = new Component(view.newChildId());
    if(first == null) first = last;
    view.add(last);
}

first.add(new SimpleAttributeModifier("class", "first"));
last.add(new SimpleAttributeModifier("class", "last"));

doesn't work?

Martijn

On 9/27/07, Sam Hough <[EMAIL PROTECTED]> wrote:
>
> I've got my own wiz bang extension of RepeatingView and I want to add class
> attributes "last", "first" to the children for the HTML monkey.
>
> Is the best way to add an AttributeAppender to each child Component that
> uses an IModel to get the class? Maybe in beforeOnRender I can't see an
> onChildAttach or onChildRemove method or anything like that. All my ideas
> seem a bit heavy and clumsy.
>
> This must be somewhere in existing code or Nabble but I'm afraid I couldn't
> see it. Sorry.
> --
> View this message in context: 
> http://www.nabble.com/Reach-into-a-component-to-change-XML-attribute-tf4527906.html#a12919632
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to