You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Larva <pa...@yahoo.com.ar> on 2007/10/05 14:41:21 UTC

Ajax dropdownchoice doesn't work after submit

Hi !! I have this hierarchy:
Panel
   Form
     DropDownChoice (A and B)

I have these two DropDownChoices (A and B) and I am
refreshing the choices in B through Ajax when the
selection in A changes. I use this dorpdownchoices to
define a filter for my dataview. 
That works fine, when I submit the form the selected
properties in each dropdown are used to filter the
rows of the dataview. I refresh the page with the
method page.render()
The problem is that after sumbit and render the page
the dropdownchoices doesn't work anymore. In fact, the
link to the Ajax debug console disappeared and if I
view the source of the html, there is no reference to
the wicket-event.js and wicket-ajax.js
Any help?
Thanks in advance
Pablo.

-- 
View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
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: Ajax dropdownchoice doesn't work after submit

Posted by Larva <pa...@yahoo.com.ar>.
Thanks Igor and Kent !!
I removed the page.render() invocation like Igor said and works perfect!!
It's not neccessary to set the response page. The submit refresh the page.
Thanks a lot for your quick answers.

Pablo. 




igor.vaynberg wrote:
> 
> provide a working quickstart and i will take a look
> 
> -igor
> 
> On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>>
>> The first time the page is render the dropdownchoices works fine. I took
>> the
>> example from the wicket examples.
>> The problem is after the submit. When I submit the form and the page is
>> render again the data of the dataview is filtered ok but the
>> dropdownchoices
>> aren't working and there is no ajax scripts in the html.
>>
>> Thanks !!
>> Pablo.
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > instead of pushing the right values when things change you should make
>> > everything pull, that way updates happen on the fly... see the ajax
>> > dropdown example in wicket examples.
>> >
>> > -igor
>> >
>> >
>> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>> >>
>> >> Thanks Igor for your quick answer.
>> >> I call the page.render() method because in the submit I set properties
>> in
>> >> the page that use to filter my custom dataview.
>> >> Then, if a don't invoke the page render the dataview isn't update.
>> >> I tried invoking only the render method of my dataview but I got the
>> same
>> >> issue.
>> >>
>> >> This is my code:
>> >>
>> >> DropDownChoice A
>> >>
>> >>         private DropDownChoice getTipoDelegacionDDC(final
>> >> FiltroEmbarqueForm form)
>> >> {
>> >>         DropDownChoice ddcTipoDel = new
>> DropDownChoice("tipoDelegacion",
>> >> new
>> >> PropertyModel(this, "tipoDelegacion"),
>> >> Arrays.asList(TipoDelegacion.values()));
>> >>         ddcTipoDel.add(new
>> AjaxFormComponentUpdatingBehavior("onchange")
>> >> {
>> >>             protected void onUpdate(AjaxRequestTarget target) {
>> >>                 getDelegaciones().clear();
>> >>                 DropDownChoice delegDDC = form.delegacionDDC;
>> >>
>> >> delegDDC.setChoices(getDelegacionesPorTipo(getTipoDelegacion()));
>> >>                 target.addComponent(delegDDC);
>> >>             }
>> >>         });
>> >>         return ddcTipoDel;
>> >>     }
>> >>
>> >> DropDownChoice B
>> >>
>> >>         private DropDownChoice getDelegacionDDC(FiltroEmbarqueForm
>> form)
>> >> {
>> >>
>> >>                 List list = Collections.EMPTY_LIST;
>> >>         String tipoDelagacion = form.tipoDelegacion;
>> >>         if (tipoDelagacion != null) {
>> >>             list = getDelegacionesPorTipo(getTipoDelegacion());
>> >>         }
>> >>         DropDownChoice delegacionDDC = new
>> DropDownChoice("delegacion",
>> >> new
>> >> PropertyModel(this, "delegacion"), list);
>> >>         delegacionDDC.setOutputMarkupId(true);  // Needed for Ajax to
>> >> update
>> >> it
>> >>         delegacionDDC.setNullValid(true);
>> >>         return delegacionDDC;
>> >>         }
>> >>
>> >> Redefined onSubmit method
>> >>         public final void onSubmit()
>> >>         {
>> >>                 SiconaraBasePage page = (SiconaraBasePage)getPage();
>> >>                 List pageFilters = page.getFilterProperties();
>> >>
>> >>                 if (pageFilters != null)
>> >>                         pageFilters.clear();
>> >>
>> >>                 ParFiltro f1 = new
>> ParFiltro("afiliado.delegacion.tipo",
>> >> getTipoDelegacion());
>> >>                 ParFiltro f2 = new
>> ParFiltro("afiliado.delegacion.alias",
>> >> getDelegacion());
>> >>                 if (f1.getValue() != null &&
>> !f1.getValue().equals(""))
>> >>                         pageFilters.add(f1);
>> >>                 if (f2.getValue() != null &&
>> !f2.getValue().equals(""))
>> >>                         pageFilters.add(f2);
>> >>                 page.render();
>> >>         }
>> >>
>> >> The ParFiltro class is a utility class wich contains a pair
>> >> property-value
>> >> used in the page to filter data.
>> >> That's because I need to invoke the page.render() method.
>> >> I'm doing something wrong? There is another way to do it?
>> >>
>> >> Thanks in advance.
>> >> Pablo.
>> >>
>> >>
>> >>
>> >>
>> >> igor.vaynberg wrote:
>> >> >
>> >> > you shouldnt call page.render()
>> >> >
>> >> >
>> >> > -igor
>> >> >
>> >> >
>> >> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>> >> >>
>> >> >> Hi !! I have this hierarchy:
>> >> >> Panel
>> >> >>    Form
>> >> >>      DropDownChoice (A and B)
>> >> >>
>> >> >> I have these two DropDownChoices (A and B) and I am
>> >> >> refreshing the choices in B through Ajax when the
>> >> >> selection in A changes. I use this dorpdownchoices to
>> >> >> define a filter for my dataview.
>> >> >> That works fine, when I submit the form the selected
>> >> >> properties in each dropdown are used to filter the
>> >> >> rows of the dataview. I refresh the page with the
>> >> >> method page.render()
>> >> >> The problem is that after sumbit and render the page
>> >> >> the dropdownchoices doesn't work anymore. In fact, the
>> >> >> link to the Ajax debug console disappeared and if I
>> >> >> view the source of the html, there is no reference to
>> >> >> the wicket-event.js and wicket-ajax.js
>> >> >> Any help?
>> >> >> Thanks in advance
>> >> >> Pablo.
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
>> >> >> 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
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064454
>> >> 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
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064914
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13096900
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: Ajax dropdownchoice doesn't work after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
provide a working quickstart and i will take a look

-igor

On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>
> The first time the page is render the dropdownchoices works fine. I took the
> example from the wicket examples.
> The problem is after the submit. When I submit the form and the page is
> render again the data of the dataview is filtered ok but the dropdownchoices
> aren't working and there is no ajax scripts in the html.
>
> Thanks !!
> Pablo.
>
>
>
> igor.vaynberg wrote:
> >
> > instead of pushing the right values when things change you should make
> > everything pull, that way updates happen on the fly... see the ajax
> > dropdown example in wicket examples.
> >
> > -igor
> >
> >
> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
> >>
> >> Thanks Igor for your quick answer.
> >> I call the page.render() method because in the submit I set properties in
> >> the page that use to filter my custom dataview.
> >> Then, if a don't invoke the page render the dataview isn't update.
> >> I tried invoking only the render method of my dataview but I got the same
> >> issue.
> >>
> >> This is my code:
> >>
> >> DropDownChoice A
> >>
> >>         private DropDownChoice getTipoDelegacionDDC(final
> >> FiltroEmbarqueForm form)
> >> {
> >>         DropDownChoice ddcTipoDel = new DropDownChoice("tipoDelegacion",
> >> new
> >> PropertyModel(this, "tipoDelegacion"),
> >> Arrays.asList(TipoDelegacion.values()));
> >>         ddcTipoDel.add(new AjaxFormComponentUpdatingBehavior("onchange")
> >> {
> >>             protected void onUpdate(AjaxRequestTarget target) {
> >>                 getDelegaciones().clear();
> >>                 DropDownChoice delegDDC = form.delegacionDDC;
> >>
> >> delegDDC.setChoices(getDelegacionesPorTipo(getTipoDelegacion()));
> >>                 target.addComponent(delegDDC);
> >>             }
> >>         });
> >>         return ddcTipoDel;
> >>     }
> >>
> >> DropDownChoice B
> >>
> >>         private DropDownChoice getDelegacionDDC(FiltroEmbarqueForm form)
> >> {
> >>
> >>                 List list = Collections.EMPTY_LIST;
> >>         String tipoDelagacion = form.tipoDelegacion;
> >>         if (tipoDelagacion != null) {
> >>             list = getDelegacionesPorTipo(getTipoDelegacion());
> >>         }
> >>         DropDownChoice delegacionDDC = new DropDownChoice("delegacion",
> >> new
> >> PropertyModel(this, "delegacion"), list);
> >>         delegacionDDC.setOutputMarkupId(true);  // Needed for Ajax to
> >> update
> >> it
> >>         delegacionDDC.setNullValid(true);
> >>         return delegacionDDC;
> >>         }
> >>
> >> Redefined onSubmit method
> >>         public final void onSubmit()
> >>         {
> >>                 SiconaraBasePage page = (SiconaraBasePage)getPage();
> >>                 List pageFilters = page.getFilterProperties();
> >>
> >>                 if (pageFilters != null)
> >>                         pageFilters.clear();
> >>
> >>                 ParFiltro f1 = new ParFiltro("afiliado.delegacion.tipo",
> >> getTipoDelegacion());
> >>                 ParFiltro f2 = new ParFiltro("afiliado.delegacion.alias",
> >> getDelegacion());
> >>                 if (f1.getValue() != null && !f1.getValue().equals(""))
> >>                         pageFilters.add(f1);
> >>                 if (f2.getValue() != null && !f2.getValue().equals(""))
> >>                         pageFilters.add(f2);
> >>                 page.render();
> >>         }
> >>
> >> The ParFiltro class is a utility class wich contains a pair
> >> property-value
> >> used in the page to filter data.
> >> That's because I need to invoke the page.render() method.
> >> I'm doing something wrong? There is another way to do it?
> >>
> >> Thanks in advance.
> >> Pablo.
> >>
> >>
> >>
> >>
> >> igor.vaynberg wrote:
> >> >
> >> > you shouldnt call page.render()
> >> >
> >> >
> >> > -igor
> >> >
> >> >
> >> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
> >> >>
> >> >> Hi !! I have this hierarchy:
> >> >> Panel
> >> >>    Form
> >> >>      DropDownChoice (A and B)
> >> >>
> >> >> I have these two DropDownChoices (A and B) and I am
> >> >> refreshing the choices in B through Ajax when the
> >> >> selection in A changes. I use this dorpdownchoices to
> >> >> define a filter for my dataview.
> >> >> That works fine, when I submit the form the selected
> >> >> properties in each dropdown are used to filter the
> >> >> rows of the dataview. I refresh the page with the
> >> >> method page.render()
> >> >> The problem is that after sumbit and render the page
> >> >> the dropdownchoices doesn't work anymore. In fact, the
> >> >> link to the Ajax debug console disappeared and if I
> >> >> view the source of the html, there is no reference to
> >> >> the wicket-event.js and wicket-ajax.js
> >> >> Any help?
> >> >> Thanks in advance
> >> >> Pablo.
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
> >> >> 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
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064454
> >> 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064914
> 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: Ajax dropdownchoice doesn't work after submit

Posted by Larva <pa...@yahoo.com.ar>.
The first time the page is render the dropdownchoices works fine. I took the
example from the wicket examples.
The problem is after the submit. When I submit the form and the page is
render again the data of the dataview is filtered ok but the dropdownchoices
aren't working and there is no ajax scripts in the html.

Thanks !!
Pablo.



igor.vaynberg wrote:
> 
> instead of pushing the right values when things change you should make
> everything pull, that way updates happen on the fly... see the ajax
> dropdown example in wicket examples.
> 
> -igor
> 
> 
> On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>>
>> Thanks Igor for your quick answer.
>> I call the page.render() method because in the submit I set properties in
>> the page that use to filter my custom dataview.
>> Then, if a don't invoke the page render the dataview isn't update.
>> I tried invoking only the render method of my dataview but I got the same
>> issue.
>>
>> This is my code:
>>
>> DropDownChoice A
>>
>>         private DropDownChoice getTipoDelegacionDDC(final
>> FiltroEmbarqueForm form)
>> {
>>         DropDownChoice ddcTipoDel = new DropDownChoice("tipoDelegacion",
>> new
>> PropertyModel(this, "tipoDelegacion"),
>> Arrays.asList(TipoDelegacion.values()));
>>         ddcTipoDel.add(new AjaxFormComponentUpdatingBehavior("onchange")
>> {
>>             protected void onUpdate(AjaxRequestTarget target) {
>>                 getDelegaciones().clear();
>>                 DropDownChoice delegDDC = form.delegacionDDC;
>>
>> delegDDC.setChoices(getDelegacionesPorTipo(getTipoDelegacion()));
>>                 target.addComponent(delegDDC);
>>             }
>>         });
>>         return ddcTipoDel;
>>     }
>>
>> DropDownChoice B
>>
>>         private DropDownChoice getDelegacionDDC(FiltroEmbarqueForm form)
>> {
>>
>>                 List list = Collections.EMPTY_LIST;
>>         String tipoDelagacion = form.tipoDelegacion;
>>         if (tipoDelagacion != null) {
>>             list = getDelegacionesPorTipo(getTipoDelegacion());
>>         }
>>         DropDownChoice delegacionDDC = new DropDownChoice("delegacion",
>> new
>> PropertyModel(this, "delegacion"), list);
>>         delegacionDDC.setOutputMarkupId(true);  // Needed for Ajax to
>> update
>> it
>>         delegacionDDC.setNullValid(true);
>>         return delegacionDDC;
>>         }
>>
>> Redefined onSubmit method
>>         public final void onSubmit()
>>         {
>>                 SiconaraBasePage page = (SiconaraBasePage)getPage();
>>                 List pageFilters = page.getFilterProperties();
>>
>>                 if (pageFilters != null)
>>                         pageFilters.clear();
>>
>>                 ParFiltro f1 = new ParFiltro("afiliado.delegacion.tipo",
>> getTipoDelegacion());
>>                 ParFiltro f2 = new ParFiltro("afiliado.delegacion.alias",
>> getDelegacion());
>>                 if (f1.getValue() != null && !f1.getValue().equals(""))
>>                         pageFilters.add(f1);
>>                 if (f2.getValue() != null && !f2.getValue().equals(""))
>>                         pageFilters.add(f2);
>>                 page.render();
>>         }
>>
>> The ParFiltro class is a utility class wich contains a pair
>> property-value
>> used in the page to filter data.
>> That's because I need to invoke the page.render() method.
>> I'm doing something wrong? There is another way to do it?
>>
>> Thanks in advance.
>> Pablo.
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > you shouldnt call page.render()
>> >
>> >
>> > -igor
>> >
>> >
>> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>> >>
>> >> Hi !! I have this hierarchy:
>> >> Panel
>> >>    Form
>> >>      DropDownChoice (A and B)
>> >>
>> >> I have these two DropDownChoices (A and B) and I am
>> >> refreshing the choices in B through Ajax when the
>> >> selection in A changes. I use this dorpdownchoices to
>> >> define a filter for my dataview.
>> >> That works fine, when I submit the form the selected
>> >> properties in each dropdown are used to filter the
>> >> rows of the dataview. I refresh the page with the
>> >> method page.render()
>> >> The problem is that after sumbit and render the page
>> >> the dropdownchoices doesn't work anymore. In fact, the
>> >> link to the Ajax debug console disappeared and if I
>> >> view the source of the html, there is no reference to
>> >> the wicket-event.js and wicket-ajax.js
>> >> Any help?
>> >> Thanks in advance
>> >> Pablo.
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
>> >> 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
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064454
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064914
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: Ajax dropdownchoice doesn't work after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
instead of pushing the right values when things change you should make
everything pull, that way updates happen on the fly... see the ajax
dropdown example in wicket examples.

-igor


On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>
> Thanks Igor for your quick answer.
> I call the page.render() method because in the submit I set properties in
> the page that use to filter my custom dataview.
> Then, if a don't invoke the page render the dataview isn't update.
> I tried invoking only the render method of my dataview but I got the same
> issue.
>
> This is my code:
>
> DropDownChoice A
>
>         private DropDownChoice getTipoDelegacionDDC(final FiltroEmbarqueForm form)
> {
>         DropDownChoice ddcTipoDel = new DropDownChoice("tipoDelegacion", new
> PropertyModel(this, "tipoDelegacion"),
> Arrays.asList(TipoDelegacion.values()));
>         ddcTipoDel.add(new AjaxFormComponentUpdatingBehavior("onchange") {
>             protected void onUpdate(AjaxRequestTarget target) {
>                 getDelegaciones().clear();
>                 DropDownChoice delegDDC = form.delegacionDDC;
>
> delegDDC.setChoices(getDelegacionesPorTipo(getTipoDelegacion()));
>                 target.addComponent(delegDDC);
>             }
>         });
>         return ddcTipoDel;
>     }
>
> DropDownChoice B
>
>         private DropDownChoice getDelegacionDDC(FiltroEmbarqueForm form) {
>
>                 List list = Collections.EMPTY_LIST;
>         String tipoDelagacion = form.tipoDelegacion;
>         if (tipoDelagacion != null) {
>             list = getDelegacionesPorTipo(getTipoDelegacion());
>         }
>         DropDownChoice delegacionDDC = new DropDownChoice("delegacion", new
> PropertyModel(this, "delegacion"), list);
>         delegacionDDC.setOutputMarkupId(true);  // Needed for Ajax to update
> it
>         delegacionDDC.setNullValid(true);
>         return delegacionDDC;
>         }
>
> Redefined onSubmit method
>         public final void onSubmit()
>         {
>                 SiconaraBasePage page = (SiconaraBasePage)getPage();
>                 List pageFilters = page.getFilterProperties();
>
>                 if (pageFilters != null)
>                         pageFilters.clear();
>
>                 ParFiltro f1 = new ParFiltro("afiliado.delegacion.tipo",
> getTipoDelegacion());
>                 ParFiltro f2 = new ParFiltro("afiliado.delegacion.alias",
> getDelegacion());
>                 if (f1.getValue() != null && !f1.getValue().equals(""))
>                         pageFilters.add(f1);
>                 if (f2.getValue() != null && !f2.getValue().equals(""))
>                         pageFilters.add(f2);
>                 page.render();
>         }
>
> The ParFiltro class is a utility class wich contains a pair property-value
> used in the page to filter data.
> That's because I need to invoke the page.render() method.
> I'm doing something wrong? There is another way to do it?
>
> Thanks in advance.
> Pablo.
>
>
>
>
> igor.vaynberg wrote:
> >
> > you shouldnt call page.render()
> >
> >
> > -igor
> >
> >
> > On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
> >>
> >> Hi !! I have this hierarchy:
> >> Panel
> >>    Form
> >>      DropDownChoice (A and B)
> >>
> >> I have these two DropDownChoices (A and B) and I am
> >> refreshing the choices in B through Ajax when the
> >> selection in A changes. I use this dorpdownchoices to
> >> define a filter for my dataview.
> >> That works fine, when I submit the form the selected
> >> properties in each dropdown are used to filter the
> >> rows of the dataview. I refresh the page with the
> >> method page.render()
> >> The problem is that after sumbit and render the page
> >> the dropdownchoices doesn't work anymore. In fact, the
> >> link to the Ajax debug console disappeared and if I
> >> view the source of the html, there is no reference to
> >> the wicket-event.js and wicket-ajax.js
> >> Any help?
> >> Thanks in advance
> >> Pablo.
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
> >> 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064454
> 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: Ajax dropdownchoice doesn't work after submit

Posted by Kent Tong <ke...@cpttm.org.mo>.

Larva wrote:
> 
> 	public final void onSubmit()
> 	{
> 		SiconaraBasePage page = (SiconaraBasePage)getPage();
> 		List pageFilters = page.getFilterProperties();
> 		
> 		if (pageFilters != null)
> 			pageFilters.clear();
> 
> 		ParFiltro f1 = new ParFiltro("afiliado.delegacion.tipo",
> getTipoDelegacion());
> 		ParFiltro f2 = new ParFiltro("afiliado.delegacion.alias",
> getDelegacion());
> 		if (f1.getValue() != null && !f1.getValue().equals(""))
> 			pageFilters.add(f1);
> 		if (f2.getValue() != null && !f2.getValue().equals(""))
> 			pageFilters.add(f2);
> 		page.render();
> 	}
> 
> The ParFiltro class is a utility class wich contains a pair property-value
> used in the page to filter data.
> That's because I need to invoke the page.render() method.
> I'm doing something wrong? There is another way to do it?
> 

Am I missing something here? You should call:

		setResponsePage(page);
		//page.render();

--
Kent Tong
Free tutorials on Wicket at http://www.agileskills2.org/EWDW

-- 
View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13070084
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: Ajax dropdownchoice doesn't work after submit

Posted by Larva <pa...@yahoo.com.ar>.
Thanks Igor for your quick answer.
I call the page.render() method because in the submit I set properties in
the page that use to filter my custom dataview.
Then, if a don't invoke the page render the dataview isn't update.
I tried invoking only the render method of my dataview but I got the same
issue.

This is my code:

DropDownChoice A

	private DropDownChoice getTipoDelegacionDDC(final FiltroEmbarqueForm form)
{
        DropDownChoice ddcTipoDel = new DropDownChoice("tipoDelegacion", new
PropertyModel(this, "tipoDelegacion"),
Arrays.asList(TipoDelegacion.values()));
        ddcTipoDel.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            protected void onUpdate(AjaxRequestTarget target) {
                getDelegaciones().clear();
                DropDownChoice delegDDC = form.delegacionDDC; 
               
delegDDC.setChoices(getDelegacionesPorTipo(getTipoDelegacion()));
                target.addComponent(delegDDC);
            }
        });
        return ddcTipoDel;
    }

DropDownChoice B

	private DropDownChoice getDelegacionDDC(FiltroEmbarqueForm form) {

		List list = Collections.EMPTY_LIST;
        String tipoDelagacion = form.tipoDelegacion;
        if (tipoDelagacion != null) {
            list = getDelegacionesPorTipo(getTipoDelegacion());
        }
        DropDownChoice delegacionDDC = new DropDownChoice("delegacion", new
PropertyModel(this, "delegacion"), list);
        delegacionDDC.setOutputMarkupId(true);  // Needed for Ajax to update
it
        delegacionDDC.setNullValid(true);
        return delegacionDDC;
	}

Redefined onSubmit method
	public final void onSubmit()
	{
		SiconaraBasePage page = (SiconaraBasePage)getPage();
		List pageFilters = page.getFilterProperties();
		
		if (pageFilters != null)
			pageFilters.clear();

		ParFiltro f1 = new ParFiltro("afiliado.delegacion.tipo",
getTipoDelegacion());
		ParFiltro f2 = new ParFiltro("afiliado.delegacion.alias",
getDelegacion());
		if (f1.getValue() != null && !f1.getValue().equals(""))
			pageFilters.add(f1);
		if (f2.getValue() != null && !f2.getValue().equals(""))
			pageFilters.add(f2);
		page.render();
	}

The ParFiltro class is a utility class wich contains a pair property-value
used in the page to filter data.
That's because I need to invoke the page.render() method.
I'm doing something wrong? There is another way to do it?

Thanks in advance.
Pablo.




igor.vaynberg wrote:
> 
> you shouldnt call page.render()
> 
> 
> -igor
> 
> 
> On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>>
>> Hi !! I have this hierarchy:
>> Panel
>>    Form
>>      DropDownChoice (A and B)
>>
>> I have these two DropDownChoices (A and B) and I am
>> refreshing the choices in B through Ajax when the
>> selection in A changes. I use this dorpdownchoices to
>> define a filter for my dataview.
>> That works fine, when I submit the form the selected
>> properties in each dropdown are used to filter the
>> rows of the dataview. I refresh the page with the
>> method page.render()
>> The problem is that after sumbit and render the page
>> the dropdownchoices doesn't work anymore. In fact, the
>> link to the Ajax debug console disappeared and if I
>> view the source of the html, there is no reference to
>> the wicket-event.js and wicket-ajax.js
>> Any help?
>> Thanks in advance
>> Pablo.
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13064454
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: Ajax dropdownchoice doesn't work after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
you shouldnt call page.render()


-igor


On 10/5/07, Larva <pa...@yahoo.com.ar> wrote:
>
> Hi !! I have this hierarchy:
> Panel
>    Form
>      DropDownChoice (A and B)
>
> I have these two DropDownChoices (A and B) and I am
> refreshing the choices in B through Ajax when the
> selection in A changes. I use this dorpdownchoices to
> define a filter for my dataview.
> That works fine, when I submit the form the selected
> properties in each dropdown are used to filter the
> rows of the dataview. I refresh the page with the
> method page.render()
> The problem is that after sumbit and render the page
> the dropdownchoices doesn't work anymore. In fact, the
> link to the Ajax debug console disappeared and if I
> view the source of the html, there is no reference to
> the wicket-event.js and wicket-ajax.js
> Any help?
> Thanks in advance
> Pablo.
>
> --
> View this message in context: http://www.nabble.com/Ajax-dropdownchoice-doesn%27t-work-after-submit-tf4574920.html#a13058549
> 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