You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Edi <ed...@yahoo.com> on 2007/08/16 12:25:12 UTC

How to Hide/View Fields at run time combo selection

Hi,

I have combo box with 3 items, String, Number, Date

If I select String, Maximum character label with one textbox should display.

some code :

Initially I have hide Maximum character label and textbox using 
setVisible(false);

In AjaxFormComponentUpdatingBehavior("onchange"), protected void
onUpdate(AjaxRequestTarget target)

inside this method, 
I wrote:

maxLength.setVisible(true);
target.addComponent(maxLength);
setOutputMarkupId(true);

But in onchange combo, that text box not displaying.... When I click the
same page tabs, that textbox is displaying. 

Please send your suggestions.

Thanking You,
Regards
Edi
-- 
View this message in context: http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12178803
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to Hide/View Fields at run time combo selection

Posted by "damiar@gmail.com" <da...@gmail.com>.
The label must be inside of a WebMarkupContainer (which will always be
visible), because if the label is not rendered at the first render
then wicket will not find the markup when you try to change the
visibility to true.
And of course your target.addComponent must add the container, not the label.

2007/8/16, Edi <ed...@yahoo.com>:
>
> I am using wicket1.2.3. I think this method is not available in that API
>
>
> Gerolf Seitz wrote:
> >
> > if you want to initially hide components and show them later via ajax,
> > you have to call .setOutputMarkupPlaceHolderTrag(true) for the component.
> >
> > gerolf
> >
> > On 8/16/07, Edi <ed...@yahoo.com> wrote:
> >>
> >>
> >> Hi,
> >>
> >> I have combo box with 3 items, String, Number, Date
> >>
> >> If I select String, Maximum character label with one textbox should
> >> display.
> >>
> >> some code :
> >>
> >> Initially I have hide Maximum character label and textbox using
> >> setVisible(false);
> >>
> >> In AjaxFormComponentUpdatingBehavior("onchange"), protected void
> >> onUpdate(AjaxRequestTarget target)
> >>
> >> inside this method,
> >> I wrote:
> >>
> >> maxLength.setVisible(true);
> >> target.addComponent(maxLength);
> >> setOutputMarkupId(true);
> >>
> >> But in onchange combo, that text box not displaying.... When I click the
> >> same page tabs, that textbox is displaying.
> >>
> >> Please send your suggestions.
> >>
> >> Thanking You,
> >> Regards
> >> Edi
> >> --
> >> View this message in context:
> >> http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12178803
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12179458
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to Hide/View Fields at run time combo selection

Posted by Edi <ed...@yahoo.com>.
I am using wicket1.2.3. I think this method is not available in that API


Gerolf Seitz wrote:
> 
> if you want to initially hide components and show them later via ajax,
> you have to call .setOutputMarkupPlaceHolderTrag(true) for the component.
> 
> gerolf
> 
> On 8/16/07, Edi <ed...@yahoo.com> wrote:
>>
>>
>> Hi,
>>
>> I have combo box with 3 items, String, Number, Date
>>
>> If I select String, Maximum character label with one textbox should
>> display.
>>
>> some code :
>>
>> Initially I have hide Maximum character label and textbox using
>> setVisible(false);
>>
>> In AjaxFormComponentUpdatingBehavior("onchange"), protected void
>> onUpdate(AjaxRequestTarget target)
>>
>> inside this method,
>> I wrote:
>>
>> maxLength.setVisible(true);
>> target.addComponent(maxLength);
>> setOutputMarkupId(true);
>>
>> But in onchange combo, that text box not displaying.... When I click the
>> same page tabs, that textbox is displaying.
>>
>> Please send your suggestions.
>>
>> Thanking You,
>> Regards
>> Edi
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12178803
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12179458
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to Hide/View Fields at run time combo selection

Posted by Gerolf Seitz <ge...@gmail.com>.
if you want to initially hide components and show them later via ajax,
you have to call .setOutputMarkupPlaceHolderTrag(true) for the component.

gerolf

On 8/16/07, Edi <ed...@yahoo.com> wrote:
>
>
> Hi,
>
> I have combo box with 3 items, String, Number, Date
>
> If I select String, Maximum character label with one textbox should
> display.
>
> some code :
>
> Initially I have hide Maximum character label and textbox using
> setVisible(false);
>
> In AjaxFormComponentUpdatingBehavior("onchange"), protected void
> onUpdate(AjaxRequestTarget target)
>
> inside this method,
> I wrote:
>
> maxLength.setVisible(true);
> target.addComponent(maxLength);
> setOutputMarkupId(true);
>
> But in onchange combo, that text box not displaying.... When I click the
> same page tabs, that textbox is displaying.
>
> Please send your suggestions.
>
> Thanking You,
> Regards
> Edi
> --
> View this message in context:
> http://www.nabble.com/How-to-Hide-View-Fields-at-run-time-combo-selection-tf4278782.html#a12178803
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>