3 Replies Latest reply: Aug 8, 2013 10:28 AM by Magus069 RSS

    How to change the script event?!?

    Magus069 Community Member

      Here I have a small form with two different parts...

       

      The first part is a table containing many checkboxes to be able to show whatever form you want to fill up..

      All of the checkboxes create a form into a table which each row represents the form to fill-up.

       

      When you click 1 checkbox, it adds a row to the table with some values needed for the form..

      In that form there is a chance to have 2 or 3 radiobuttons, depending on the checkedbox which each do something different..

       

      the 1st one hides a new table to fill up information (under the radiobuttons),

      the 2nd one shows up the new table with some values to show instructions into labels...

      the 3rd one shows up the new table with some other values to show different instructions into labels.. (This radiobutton is only in half of the forms, so it is hidden)

      those labels must be different for each checkbox chosen

       

      instead of making a huge script in my radiobutton change event, and writing all the different possibilites

      i'd rather create the script depending on the checkedbox the user have chosen...

       

      Right now I'm using something like : this.resolveNode("...radiobuttonList").event__change.script.value = "--_ Write all the new code here_--";

       

      After this line is written and everything is working... I show up a messageBox to see the result which is all correct..

      But when I'm clicking on the radiobuttons nothing is working at all...

      the only code working is the initial code written in the event

       

      Anyone have an idea if I'm missing something?!?

      Thanks!

        • 1. Re: How to change the script event?!?
          Magus069 Community Member

          Sorry for the trouble... Let's simplify my question....

           

          I have 2 buttons

           

          Button 1 : xfa.host.messageBox("Hello World!");

          Button 2 :  Button1.event__click.script.value = "xfa.host.messageBox(\"World answers Hellow!\")";

           

          When i click back on button1 i want the messagebox to show "World answers Hellow!"

           

          Anyone can help?

          • 2. Re: How to change the script event?!?
            Bibhu Bikash Nayak Community Member

            How about calling the click event of Button2 inside the click event of the Button1. Inside the click event of the Button2, you can put the folloing script. Prior to that in the click event of the Button 2 you can put "xfa.host.messageBox(\"World answers Hellow!\")";

             

            Then in Button1's click event put Button2.execEvent("click");

             

            Thanks,

            Bibhu.

            • 3. Re: How to change the script event?!?
              Magus069 Community Member

              Actually this is not what i was looking for, I really need to change the script...

               

              e.g. I have a button in a expandable table and i want each buttons to have a different messagebox....

              when the button is created a new script is assigned to the event_click...

              This is what im looking for...

               

              Looks like LiveCycle Designer is not able to change the scripts events even though the property is there and is a "get" & "set"

              so I should be able to change script event.... but I think i need to reload/recreate the form by using the modified code...