I looked at the ajax debug output and noticed there was no reference to one of 
the fragments.

With only one div for the fragment, what I needed to do was conditionally add 
and remove the fragment components depending upon the selection of the 
RadioChoice and re-add the form via target.addComponent(...)

Another option I considered and went with was just to add another div for the 
second fragment adding both to the container form and conditionally rendering 
them by setting their visibility appropriately.

J.D.

-----Original Message-----
From: Riyad Kalla [mailto:rka...@gmail.com] 
Sent: Friday, February 26, 2010 12:16 PM
To: users@wicket.apache.org
Subject: Re: Conditionally Render Different Fragments (via Radio Choice 
Selection)?

JD,

If you flip the initial visible fragment to the 2nd one, does the inverse
condition apply? (frag2 is visible and frag1 isn't visible?)

If you check the source of the generated HTML, you are seeing the generated
placeholder tag for the 2nd fragment so it can be made visible right?

-R

On Fri, Feb 26, 2010 at 12:04 PM, Corbin, James <jcor...@iqnavigator.com>wrote:

> I have radio group (RadioChoice) with two options that conditionally
> renders one of two fragments.
>
> The two fragments are pre-created and then attach onchange ajax behavior to
> the RadioChoice component that toggles the visibility of the fragments
> depending upon the selection made for the RadioChoice component.
>
> When I toggle the radio choice to the second option, my fragment isn't
> being rendered when I setVisible(true).
>
> In my ajax update method, I toggle the visibility for the fragments and
> then
> target.addComponent(fragment1);
> target.addComponent(fragment2);
>
> I tried target.addComponent(form), where form is the container for the
> RadioChoice and Fragments.
>
> I made sure that I specify setOutputMarkupPlaceholderTag(true) on both
> fragments at creation time.
>
> I'm not sure what is going on here?
>
> J.D.
>


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

Reply via email to