To get wicket to output a dom id you must call
mycomponent.setOutputMarkupId(true).  This will output a generated dom
id, which you can access in your java code by calling
Wicket will overrwrite any dom id in your code, if that element is
used for a wicket component (ie has wicket:id="myid")

Wicket tags like <wicket:panel> are removed if the application is
running in deployment mode, but are rendered if the application is
running in development.  You can control this explicitly by calling
getMarkupSettings().setStripWicketTags(true); in your application init
code, or by using
Application.get().getMarkupSettings().setStripWicketTags(true); in any
wicket code.

Regards - Richard Wilkinson
jWeekend: OO & Java Technologies - Development and Training

On 21 May 2010 17:51, Brian Mulholland <blmulholl...@gmail.com> wrote:
> Our app will be using ExtJS tab controls.  So to make that easier I
> wrapped the ExtJS code up into a Wicket Panel to hide the complexity
> of working with ExtJS.  The idea is that I would tell my class what
> the wicket:id of the span/div was to draw the thing to, as well as
> naming the N subtab id's (these are the HTML ids) so that the class
> could write out the javascript code to render the tabs from the markup
> already in the page.  So the HTML would look like:
> <div wicket:id='drawTabsHere'>
>  <div id="tab1">Tab One!</div>
>  <div id="tab2">Tab Two!</div>
> </div>
> And the java code would look like:
> add(new MyTabPanel("drawTabsHere", "tab1", "tab2"));
> The premise is REALLY close to working.  Here's my problems:
> 1) The wicket:id="" attribute on the div won't copy the id into the
> markup.  I must repeat it in the template <div
> wicket:id='drawTabsHere' id='drawTabsHere'>.  I tried adding the id
> via an Attribute Modifier like so:
> add(new AttributeModifier("id", new Model(renderToID)));
> But it ignores me.  I'd rather not force my developers to repeat the
> id.  How can I accomplish that?
> 2) More importantly, the rendering of the tabs is malfunctioning.  I
> believe that it is because the panel actually DRAWS the <wicket:panel>
> tag around the subtab div's and thus screws up ExtJS.  I didn't
> realize that panels wrote the wicket tags out to the browser until i
> hit this.  I'd always assumed that "wicket:" tags were for the
> server's use, and were not rendered.  How can I suppress this so that
> the DOM hierarchy is right for my use?
> I do have a hidden input tag in the wicket:panel in order to preserve
> the selected tab so that we preserve it between submits.  I tried
> removing it and it did not help, but cannot remove the wicket:panel
> without Wicket throwing an exception.
> --
> Brian Mulholland
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org

To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to