Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:20:38+00:00 2026-06-11T03:20:38+00:00

How do I cascade the lists so if user changes selection in selectedCategory list

  • 0

How do I cascade the lists so if user changes selection in selectedCategory list it should update the selectedTo list.

Here is my snippet:

<h:selectOneMenu id="selectedCategory" value="#{converterBean.selectedCategory}">
  <f:ajax execute="selectedCategory" render="selectedFrom"/>
  <f:selectItems value="#{converterBean.categories}"/>
</h:selectOneMenu>
<h:selectOneListbox id="selectedFrom" value="#{converterBean.selectedFrom}" size="5">
  <f:selectItems value="#{converterBean.fromList}"/>
  <f:ajax execute="selectedCategory selectedFrom" render="selectedTo"/>
</h:selectOneListbox>
<h:selectOneListbox id="selectedTo" value="#{converterBean.selectedTo}" size="5">
  <f:selectItems value="#{converterBean.toList}"/>
</h:selectOneListbox>

I notice that it updates the selectedFrom list but does not cascade further to selectTo list.

As per suggestion to try render both selectedFrom and selectedTo for category selection the request posted from the page is:

POST http://localhost:8081/converter_web/faces/converter.xhtml HTTP/1.1
Accept: */*
Faces-Request: partial/ajax
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Referer: http://localhost:8081/converter_web/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Host: localhost:8081
Content-Length: 1253
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=DDDEA598A60CC468763C36B536513B41

converter_form=converter_form&converter_form%3AselectedCategory=temperature&converter_form%3AselectedFrom=mm&converter_form%3AselectedTo=cm&converter_form%3Avalue=0.0&javax.faces.ViewState=b%2BArKl5NJujWibUQzHf3dUG2JlT%2Bnq7KygA2%2FXpXXscCouBr5xT9Br%2BmoP78%2FvuPAYG%2Bi7Q0jFEKGqJpFgRo%2BDU4ZV251yac84pu3bZ71V9j%2BHvRPMkWw82S8q0v2p1jmn3msPXxvKrQQ1oVpr7pGBPXc2faQGXHW55Md%2BKSkspIgCxXx3x3T6NDaJ1%2BGTEFkyb1DE%2BdoQHQ4EjqV3jEC5mq56OlsHgEmkQ8TVCQM%2FPmAfUBWiQEHqBYzohXNfFpO3kfdrKjeTrq648UtGPYU88VJ9mtIOptYEfwFKN9y%2FG9MOBKEfRZ9XlJz2bPt1zmATIg3iRT1W7YVtmHq7e9g%2FUxsM82duMxFUWhoFPHfrFk4tt48LFH29Hk60y3eeFxqtg7g1JxPD1aQrLN9sxBduS53nFWObCms1YU40uvMT2yjX0kp4wM8YwqT2jTFDtLHcVBide1RGTnzFGzjOrbCJ8rIEmWfPa1yUMkXRBBsgpKWFIl0ueBQiCT%2BDoD9UXlNOQGS%2F5tIdP%2BVTO%2FkWiBo5X99SpKwKY8%2B2pqzJKDrPRXIwci52Wi%2Fo%2Fw%2B0TkpnVrtDaDl7w2eYjmq7bYZFRDjWy3Jtgc5V1DUF%2BhX3Bfiq7l%2Fq5YL4DYx0NBI2esfJ0LTFCqXu8aCk%2BWOPOWnOCSGA5Y9EGUXgzV6q%2Fp%2FFWa8Kj8E%2FeoB380eFwXAEiyyRGv&javax.faces.source=converter_form%3AselectedCategory&javax.faces.partial.event=change&javax.faces.partial.execute=converter_form%3AselectedCategory&javax.faces.partial.render=converter_form%3AselectedFrom%20converter_form%3AselectedTo&javax.faces.behavior.event=valueChange&javax.faces.partial.ajax=true

We would expect only selectedCategory be send but its sending all form fields in ajax call. It though calls getCategories(), getFromList(), getToList() but when it calls getToList it uses category=temperature and from=mm. from=mm is what is passed in POST request as selectedFrom=mm.

Regards,

Miten.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:20:39+00:00Added an answer on June 11, 2026 at 3:20 am

    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>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I have a cascade dropdownlist when the first change value the second change using
Here is my code @Entity class Parent extends Person { @OneToMany(cascade = CascadeType.ALL, fetch
I have an entity called User which can have a list of other Users
I have a User object/mapping in my application. Each user has a list of
I have User object with a list of groups that it belongs to: public
I have two entities User and Event. Each user has a list of events
@org.jboss.seam.annotations.security.management.UserRoles exposed in the User interface returns a simple List method. seam-gen doesn't generate
Here is the deal I have a one to many relationship between User and
I have the two entity classes, User and MyCharacter. User has a list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.