You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by arunarapole <ar...@gmail.com> on 2010/08/23 22:07:45 UTC

Up on selection of one DropDownChoice value one more DropDownChoice box should display

Hi

I have a requirement that i need to display one Dropdownchoice  on to the
form upon selection of one more dropdownchoice value 

Say example under manager dropdownchoice if i select IT manager  it has to
display one more dropdownchoice on form, and if i select Account Manager it
should not display any component on form

If any one has idea please share with me 
below is sample code 

please please share some idea 

Form form=new Form()
DropDwonchoice a=new DropDownChoice("",value,new IChoiceRender<>)
{
}
DropDwonchoice b=new DropDownChoice("",value,new IChoiceRender<>)
{
}


a.add(new AjaxFormComponentUpdatingBehavior("onchange")
{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void onUpdate(AjaxRequestTarget target) {
		// TODO Auto-generated method stub
		
	if(a.getModelObject().equals("Manager"))
	{
	
		
		here i have to display the b dropdownchoice componet  on form
	}
	
	else
	{
             nothing shoundn't be displayed 

		
	}

Thanks
Aruna


-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Up-on-selection-of-one-DropDownChoice-value-one-more-DropDownChoice-box-should-display-tp2335747p2335747.html
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: Up on selection of one DropDownChoice value one more DropDownChoice box should display

Posted by James Carman <ja...@carmanconsulting.com>.
Try fragments.  Or use a different panel for the different selections.

On Mon, Aug 23, 2010 at 4:07 PM, arunarapole <ar...@gmail.com> wrote:
>
> Hi
>
> I have a requirement that i need to display one Dropdownchoice  on to the
> form upon selection of one more dropdownchoice value
>
> Say example under manager dropdownchoice if i select IT manager  it has to
> display one more dropdownchoice on form, and if i select Account Manager it
> should not display any component on form
>
> If any one has idea please share with me
> below is sample code
>
> please please share some idea
>
> Form form=new Form()
> DropDwonchoice a=new DropDownChoice("",value,new IChoiceRender<>)
> {
> }
> DropDwonchoice b=new DropDownChoice("",value,new IChoiceRender<>)
> {
> }
>
>
> a.add(new AjaxFormComponentUpdatingBehavior("onchange")
> {
>
>        /**
>         *
>         */
>        private static final long serialVersionUID = 1L;
>
>        @Override
>        protected void onUpdate(AjaxRequestTarget target) {
>                // TODO Auto-generated method stub
>
>        if(a.getModelObject().equals("Manager"))
>        {
>
>
>                here i have to display the b dropdownchoice componet  on form
>        }
>
>        else
>        {
>             nothing shoundn't be displayed
>
>
>        }
>
> Thanks
> Aruna
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Up-on-selection-of-one-DropDownChoice-value-one-more-DropDownChoice-box-should-display-tp2335747p2335747.html
> 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