Martijn,
Thanks for the info. Is tempting but I'm really after making the component
behaviour more consistent and the monkey will complain about losing control
over yet another id (first example I had tried he was setting an explicit id
on the first element in a Panel).
I might try fiddling with MarkupStream so I can grab the first element to
override the element defined in the parent Panel, keep its id for Ajax
updates...! Not pretty but it should stop the monkey complaining and I can
just return components that get plonked into the HTML in consistent way if
checkbox, Panel etc...
I think one of my favourite things about Wicket is just "dropping" a
checkbox etc onto an element that the monkey defined (we have overrided
onComponentTag to ensure the correct element name etc - think other parts of
core Wicket do that). The Wicket merging of style names and attributes is
really nice. Think that is what I'm after for the behaviour of Panel.
Cheers
Sam
Martijn Dashorst wrote:
>
> yes it is called setRenderBodyOnly(true).
>
> you could also tell your monkey (sic) to use wicket:container for
> those panel elements and you then have to add a WebMarkupContainer to
> your <ul> element and setOutputMarkupId(true) on it.
>
> Martijn
>
> On 4/25/08, Sam Hough <[EMAIL PROTECTED]> wrote:
>>
>> Thanks Martijn,
>>
>> Is there a way to "eat" the first element in the Panel so I don't have
>> to
>> hardcode the element name?
>>
>>
>>
>> Martijn Dashorst wrote:
>> >
>> > override onComponentTag and set tagname to ul in your panel.
>> > <ul>
>> > <wicket:panel>
>> > <li wicket:id="items">.....</li>
>> > </wicket:panel>
>> > </ul>
>> >
>> > MyPanel extends Panel {
>> > ....
>> >
>> > @Override void onComponentTag(Tag tag) {
>> > super.onComponentTag(tag);
>> > tag.setName("ul");
>> > }
>> > }
>> >
>> > On 4/25/08, Sam Hough <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Is there a nice way to make a component that behaves like Panel but
>> >> replaces
>> >> the surrogate element AND supports Ajax partial updates?
>> >>
>> >> So if my parent HTML is:
>> >>
>> >> <span wicket:id="here" >to be replaced</span>
>> >>
>> >>
>> >> and my child panel is:
>> >>
>> >> <wicket:panel><ul><li>Must only have a single root
>> >> element</li</ul></wicket:panel>
>> >>
>> >> my output would be:
>> >>
>> >> <ul><li>Must only have a single root element</li></ul>
>> >>
>> >> I've almost got this behaviour by using setRenderBodyOnly(true); but
>> >> then I
>> >> loose the id I need for Ajax partial updates.
>> >>
>> >> Any thoughts?
>> >>
>> >> Thanks
>> >>
>> >> Sam
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Panel-that-replaces-surrogate-element-rather-than-contained-within-it-tp16894472p16894472.html
>> >> 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.2 is released
>> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>>
>> View this message in context:
>> http://www.nabble.com/Panel-that-replaces-surrogate-element-rather-than-contained-within-it-tp16894472p16895688.html
>>
>> 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.2 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Panel-that-replaces-surrogate-element-rather-than-contained-within-it-tp16894472p16936674.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]