Bind multiple dropdowns from API list and on change bind next dropdown

0
  => Its list of “user_type, product_type, case_type, review_type” getting from API. => Every login user will get different list of values so you don’t have to commit in entity or you have to use non persistant entity. => These 4 columns should bind to dropdown “User Type Dropdown, program_type dropdown, case_type dropdown, review_type dropdown”     => On change of User Type Dropdown, based on selected value program_type dropdown should bind data.  => On change of program Type Dropdown, based on selected value case_type dropdown should bind data.  => On change of Caser Type Dropdown, based on selected value review_type dropdown should bind data.   Giving you sample JSON structure I am getting from API: {     "responseStatus": "SUCCESS",     "body": [         {             "user_type": "operations",             "product_type": "testPartner01",             "case_type": "the_agent_v1_b2b",             "review_type": "reviewer"         },         {             "user_type": "operations",             "product_type": "testPartner02",             "case_type": "the_agent_v2_b2b",             "review_type": "reviewer"         },         {             "user_type": "credit",             "product_type": "testPartner03",             "case_type": "the_agent_v3_b2b",             "review_type": "reviewer"         }     ] }   Please tell me what approach I need to take. I want to avoid multiple time API call when data is in one list.
asked
1 answers
0

Hi Roshan,

 

I suggest to the followings:

  1. Create a MF to maintain querying API results into a PE objects (e.g. ApiResultEntity) associated to the user session. I saw your comments, but I cannot see other solution to have such data. This can be integrated into your page via a dataview sourced from MF (e.g. DS_ApiResultEntity). The association to the session helps you with querying only once during a login. (However you can also add an explicit refresh mechanism which can be triggered by user action.)
  2. Use the widget Searchable Selector  for dropdown elements. This allows to refer:
    • a MF for the set of selectable objects so you can implement a logic which retrieves the relevant set of objects depending on the already selected other values;
    • the representation attribute (e.g. user type, product type) which user see in dropdown.

Hope this helps.

 

Best,

Istvan  

answered