3
2
1

I have two dropdown list. Let say State dropdown list and City dropdown list. How can I call a groovy service on change of a State value from dropdown list ? and that will return the list of Cities belongs to that state?

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      I think the better answer for that particular scenario would be to prefill cascading dropdown lists. Because Cities per State is probably a fairly static list. This tutorial could get you started, you can use a groovy prefill script to fill in the xml:

      How to prefill Cascading Dropdowns from Transact Manager

      Otherwise it would be a dynamic data call:

      Dynamic Data

      1. Umakanta Dalai

        Thanks Marie

        Make sense to me your suggestion , but though both USA state and cities per state  are big lists. Its not appealing me to create that many no. of xmls

      CommentAdd your comment...
    2.  
      1
      0
      -1

      This can be done using a 'Business Rule - General Purpose' widget.

      Add a script to the business that makes the DDS call using sfc.getDynamicData() or sfc.getDynamicDataFromJson() and add the dropdown list as a dependency (double click, then delete the reference from the script). This will trigger the script on change of the selected list option.

      You may also want modify the script so it doesn't run on initialize.

      1. Umakanta Dalai

        Thanks lot Jye,

        This is exactly what i was looking for, can you give me a sample code please ?

      CommentAdd your comment...