1 Reply Latest reply: Dec 31, 2013 11:27 AM by Jeremy Fourman RSS

    Get Selected - Timing Issue?

    Jeremy Fourman

      Hi All -

       

      Thanks for any help offered, hoping you extension experts can lend me a hand.

       

      I am trying to develop an extension for the following use case:

      - A user selects from a listbox (ootb control) a comment category

      - A users enters a comment into a textbox (extension object)

      - The extension object gets the Selected values from the comment category

      - The extension object gets the Enabled values from another listbox (ootb control)

       

      During development though I keep bumping up against the following error 'Object does not support this method or property'. Strange thing is this only happens every_so_often, usually between two or three clicks within a listbox, or by changing state of the document. I am assuming this is a timing issue, an object not being complete. It always complains of GetSelected or GetEnabled when I uncomment the associated code for reading the other listbox.

       

      Capture.PNG.png

       

      I also would like to be able to get to the enabled values of another listbox, not selected, a user will not be interacting with it, I just need to get the single value that will be enabled. However I cannot seem to get access to GetEnabled on this other object after the first reference is created using GetSelected. That code is currently commented out in the attached Script.js

       

      So basically, when using the extension, I select a comment category, key or not key in a comment and hit submit. Sometimes the proper alert window pops up, either showing me the comment or not which is great but every couple try's I get the above error message. And then of course I would like to be able to get to the enabled values of other listboxes as well for some business rules I need to apply.

       

      The attached example does illustrate the problem I have at least on_my_machine. Windows 7 32b, IE 10, 11.2 SR2

       

      I imagine it is a development/code issue at this point, just having a real hard time trying finding where I am going wrong. I will gladly provide more details if needed.

       

       

      Thanks

      -Jeremy

       

       


        • Re: Get Selected - Timing Issue?
          Jeremy Fourman

          Ok, so I have made some headway through some massive google searches, code spelunking of open source extensions, api documentation and the like. Attached is my latest Script.js, it is a mess right now but the modifications are

           

          - Made use of qva.GetQVObject within a callback function inside of setup().

          - Made use of this within callback function instead of object name

          - Removed _this = this*  (may not have been necessary?)

           

           

           

          I have not had any of the above error windows pop up yet, granted been testing for 5 minutes. I also can now see the text of both listboxes inside of alerts. I am however seeing them too may times, 3 in total, so I am assuming I am not 'stacking' callbacks on top of each other but something else?

           

          So I guess my question now becomes, can someone make sure I have my callbacks setup correctly?

           

          Many thanks to all who post code, share code, open source code, reply to comments, etc , it has been extremely helpful.