This discussion is archived
1 Reply Latest reply: Sep 5, 2012 3:53 AM by mms_ RSS

cascading lists using ajax

mms_ Newbie
Currently Being Moderated
Hi,

I have question on cascading lists (select menu). I have three lists:
category
from units
to units

When I make selection in category as I render from unit lists it works fine. I have setup from units list to similarly render to unit list which is not getting automatically triggered if I made category selection. I have tried to set render as from and to list both for category selection but then what happens is it posts category, old from unit, old to unit and what we get method calls as getFromList(new category), getToList(new category, old from unit).

See that new category is used fine but old from unit is used incorrectly.

The details are available as stackoverflow message I posted.

Regards,

Miten.
  • 1. Re: cascading lists using ajax
    mms_ Newbie
    Currently Being Moderated
    I added ajax listener as below so indicate that category change is being invoked so that getFromList will set selectedFrom to new item from its list instead of one being posted. Then getToList will find correct category and from unit to query its to list.

    <f:ajax execute="selectedCategory" render="selectedFrom"></f:ajax>
    to

    <f:ajax listener="#{converterBean.categoryChanged}" execute="selectedCategory" render="selectedFrom selectedTo"></f:ajax>

    Edited by: mms_ on Sep 5, 2012 3:53 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points