CA Service Management

Expand all | Collapse all

Do not Use User Input to Pre-Populate a Select Box

  • 1.  Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 14, 2018 01:37 AM

    Dear All 

    I want to send value from first select box to input second select box but It is not work and not show value for select.

    1. I create 2 report builder.

    •    first report builder

                          

    • second report builder

                      

    2. I create 2 select box on form.

                   

    3. I configuration in Category Level 1.

                    

    4. I configuration in Category Level 2 

                   

    5.  I selected Category Level 1 but Category Level 2 do not show values for selected.

                

     

    Please help me What should I do ?



  • 2.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 01:35 PM

    Did you created your variables in the report object with the button "create variable" ?



  • 3.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 01:40 PM

    I guess yes since you got it to work in the designer lol. Answered before reading your post completely.

     

    I would suggest that you open the debugger in chrome and in the console, run : ca_fdGetSelectedOptionValues('inciDetailsForm','Category_1')[0] and see what it returns.

     

    If you have v17 or v17.1 there is a couple of bug with those JS functions.



  • 4.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 03:39 PM

    Also make sure the Eager attribute for Category_2 is set to True. Without this you'll get a javascript error when trying to set the field.



  • 5.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 04:05 PM

    Not true gbruneau

     

    Eager need to be used only when you select a value programmatically.

     

    Since he calls fetchSelectData after a selection on the first select it will refresh the data from the second select anyway. This way you save "some processing time" by not using "eager".

     

     



  • 6.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 04:13 PM

    You are right, for some reason I thought he was trying to set the second value programmatically.



  • 7.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 16, 2018 11:18 PM

    Hi pier-olivier.tremblay,

    I used V17. If it is bug with those JS functions that Do you have suggestion for problem ? and What should I do?



  • 8.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 17, 2018 09:08 AM

    First things first,

     

    Do you have a bug?

     

    Did you tried what i proposed in my comment ? :

     

    I would suggest that you open the debugger in chrome and in the console, run : ca_fdGetSelectedOptionValues('inciDetailsForm','Category_1')[0] and see what it returns.



  • 9.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 17, 2018 09:13 AM

    You can also hard-code a value in the parameters of your Category_2 select box to see if the report object works as intended.



  • 10.  Re: Do not Use User Input to Pre-Populate a Select Box
    Best Answer

    Posted Jul 18, 2018 02:02 AM

    After I create on form and preview that It is not working. I create Offering and add form to Catalog that It is work. I thing, It had problem with preview of form.

     

    Thank you that Working



  • 11.  Re: Do not Use User Input to Pre-Populate a Select Box

    Broadcom Employee
    Posted Jul 18, 2018 05:35 AM

    Thanks for confirming that's working for you now - there are indeed a few differences in terms of what javascript processing is applied in the Form Designer version of a form; I've raised an enhancement Idea about it here:

     

    Service Catalog Form Designer - "live" javascript parameters 

     

    Some of these differences are deliberate, so your scripting doesn't interfere with your ability to define the form in the first place, but there's certainly scope to move closer to a "real" representation.



  • 12.  Re: Do not Use User Input to Pre-Populate a Select Box

    Posted Jul 18, 2018 08:47 AM

    Yes, in fact it should be a button like : Activate full Javascript experience