1 Reply Latest reply on Apr 24, 2011 1:00 PM by George_Johnson

    Change Field Values with Adobe Dialog Manager?

    Matt_Stantec

      Hello.

       

      I currently have my dialog setup.

      dialog_box_3.JPG

      I have a text field on my page that is named: text_name

       

      When I enter in the dialog box, how do I set the text_name field to this value after OK button is pressed?

       

      Current Dialog Code:

       

      var myDialog =
      {
           // Event handler to initialize the list_box
           initialize: function(dialog)
           {
                dialog.load({
                "sub1":
                     {          
                     // Create a radio Check named sub1 and set up 4 choices:
                     "Reviewed": 0,
                     "Reviewed and Resubmit": 0,
                     "Not Reviewed": 1,  // currently selected item
                     "Not Accepted": 0
                     }     
                });
           },
           commit: function(dialog)
           {
                // Retrieve the values stored in list_box sub1:
                var elements = dialog.store();
                
                // Iterate through items and take actions as needed
                for (var e in elements["sub1"])
                     // If the value is positive, it was selected:
                     if (elements["sub1"][e] > 0 )
                     {
                          // display the list value selected:
                          app.alert("You chose:\n" + e);
                          
                          // call a related function for the selection
                          rc = elements["sub1"][e];
                          ListHandler(rc);
                     }          
           },     
           // Dialog object descriptor (root node)
           description:
           {
                name: "Custom Dialog",
                elements:
                [
                {
                     type: "view",
                     align_children: "align_left",
                     elements:
                     [
                          {
                               type: "cluster",
                               name: "Cluster",
                               elements:
                               [
                                    {
                                         type: "static_text",
                                         name: "Enter Your Full Name",
                                         font: "default"
                                    },
                                    {
                                         type: "edit_text",
                                         name: "name",
                                         char_width: 21,
                                         item_id: "sub1",
                                         font: "default"
                                    },
                                    {
                                         type: "radio",
                                         item_id: "sub1",
                                         group_id: "gp1",
                                         name: "Reviewed",
                                         width: 200,
                                         height: 25     
                                    },
                                    {
                                         type: "radio",
                                         item_id: "sub1",
                                         group_id: "gp1",
                                         name: "Reviewed As Modified",
                                         width: 200,
                                         height: 25
                                    },
                                    {
                                         type: "radio",
                                         item_id: "sub1",
                                         group_id: "gp1",
                                         name: "Revise and Resubmit",
                                         width: 200,
                                         height: 25
                                    },
                                    {
                                         type: "radio",
                                         item_id: "sub1",
                                         group_id: "gp1",
                                         name: "Not Reviewed",
                                         width: 200,
                                         height: 25
                                    },
                                    {
                                         type: "button",
                                         item_id: "butnn",
                                         name: "OK"
                                    }
                               ]
                          },
                     {
                          type: "ok_cancel"
                     }
                     ]
                }
                ]
           }
      };
      
      // Function to handle the user's list selection:
      function ListHandler(rc)
      {
           switch (rc) {
                case 1:
                     app.alert("Reviewed");
                     break;
                case 2:
                     app.alert("Reviewed As Modified");
                     break;
                case 3:
                     app.alert("Revise and Resubmit");
                     break;
                case 4:
                     app.alert("Not Reviewed");
                     break;
                default:
                     app.alert("Invalid Selection");
                     break;
           }
      }
      
      rc = app.execDialog(myDialog);