3 Replies Latest reply: Apr 18, 2014 12:38 PM by TucsonSam RSS

    Cannot set Skillbuilder SuperLOV value

    temm

      Hello,

       

      i have a superlov item, P1_CODE which i am trying to set it's value from javascript.

       

      $s('P1_CODE', 'AA.001');

       

      The Enterable field is set to Enterable - Not restricted to LOV but i cannot set the field as it remains null. I can select from the popup list or enter directly a value.

       

      If i use the same code on a e.g. TextBox it works fine.

       

      I'm using Apex 4.2.3 and SuperLOV 2.0.2

       

      Teo

      Thank you.

        • 1. Re: Cannot set Skillbuilder SuperLOV value
          TucsonSam


          Hi, I am having a similar issue: I'm just trying to set the value of the Skillbuilder Super LOV using a Dynamic Action.  There is documentation that says the LOV version 2.0.1 supports this, but I am unable to get it to work: http://www.danielmcghan.us/2012/03/super-lov-release-201.html

          I have tried every combination of "Enterable/Not Eneterable", "Restricted/Not Restrictted", etc., but it doesn't work.  Any help would be appreciated.

          I'm using Apex 4.2 and SuperLOV 2.0.2

          Thanks

          • 2. Re: Cannot set Skillbuilder SuperLOV value
            Tom Petrus

            It does work. Don't forget that the superlov is built as a fieldset which contains a hidden item ( = return value) and the text item ( = display value). Calling either $s or apex.item.setValue with one value will set the return value of the item.

            JavaScript APIs: apex.item.setValue

            JavaScript APIs: $s

            $s(pNd, pValue, pDisplayValue, pSuppressChangeEvent)
            

            You can see it working as expected by inspecting the html. When you want to set the display value as well as the return value, then simply provide a third parameter.

            eg

            $s("P18_SLOV", "JAMES", "7900")
            

            Now, also be aware that the superlov has some interesting methods available, as seen in the documentation:

             

            The getValuesByReturn and setValuesByReturn methods can be used to programmatically fetch return values and set the item using the return values. getValuesByReturn will return a JSON object with the results from the fetch. setValuesByReturn goes a step further using the return values to set the display and return values for the item. Example(s):

            $('#P1_ITEM_NAME').apex_super_lov('getValuesByReturn', '101');
            $('#P1_ITEM_NAME').apex_super_lov('setValuesByReturn', '999');
            
            • 3. Re: Cannot set Skillbuilder SuperLOV value
              TucsonSam

              This worked, Thank you!  I couldn't get it to work at first as described above, but I made the mistake of using a Dynamic Action with an Action Type of "Set Value" (which has a JavaScript Option).  I switched it to Action Type of "Execute JavaScript Code" and then it worked using the following:

              apex.item( "P70_X" ).setValue( "1", "Hello", true );

               

              Thank you so much!

              Jim