Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    valuesManager not in sync with forms

    ValuesManager is awesome. It has saved me from writing code to go foraging for form item values. I think I had a configuration working a while ago. And, then had no reason to check if for some time. Now, I find that form item values changed on member forms are not picked up.

    The situation is that the user is allowed to change 'print options' on member forms under a window before hitting a button to print. The button click event calls a macro that generates a PDF file just fine. The window has a valuesManager. If I don't make any changes, then I get the valuesManager values I get out are just fine. Any changes made to the underlying forms, however, are ignored. In my test I change a 'MeetingDetails' checkbox.

    I know the change is registered because I have an itemChange event fire that shows it goes from 'true' to 'false'.

    In all the diagnostics and results, it is clear the value being used for MeetingDetails is still 'true'.

    I tried ValuesManager.synchronizeMembers() even though I understood that it only update the member form values. Not the other way around, like I need.

    I note that the datapath on the member form is 'Agenda/Options'. This works for pulling the values out in the structure needed. But, it may mess up the synchronization

    Here is the window.
    Code:
    isc.Window.create({
        ID:"MeetingWindow",
        autoDraw:false,
        overflow:"hidden",
        isModal:true,
        visibility:"hidden",
        title:"Meeting Window",
        showMinimizeButton:false,
        showMaximizeButton:true,
        showStatusBar:false,
        showResizer:false,
        items:[
            MeetingForm,
            MeetingBottomHalf
        ],
        showModalMask:true,
        modalMaskOpacity:10,
        width:"100%",
        height:665,
        top:84,
        canDragReposition:false,
        canDragResize:false,
        valuesManager:isc.ValuesManager.create({
            ID:"meetingTypeVM"
        }),
        showShadow:false
    })
    And, the form in question.
    Code:
    isc.DynamicForm.create({
        ID:"AgendaOptionsForm",
        autoDraw:false,
        numCols:5,
        overflow:"visible",
        fields:[
            {
                dataPath:"MeetingDetails",
                name:"MeetingDetails",
                title:"Meeting Details",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"IncludeParticipants",
                name:"IncludeParticipants",
                title:"Include Participants",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"TopicDetails",
                name:"TopicDetails",
                title:"Topic Details",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"TopicIssues",
                name:"TopicIssues",
                title:"Topic Issues",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"IssueDetails",
                name:"IssueDetails",
                title:"Issue Details",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"IssueTasks",
                name:"IssueTasks",
                title:"Issue Tasks",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"TaskDetails",
                name:"TaskDetails",
                title:"Task Details",
                disabled:false,
                _constructor:"CheckboxItem"
            },
            {
                dataPath:"CompletedTasks",
                name:"CompletedTasks",
                title:"Completed Tasks",
                disabled:false,
                _constructor:"CheckboxItem"
            }
        ],
        width:"100%",
        height:100,
        extraSpace:10,
        dataPath:"Agenda/Options",
        itemChange:"AgendaOptionsForm_itemChange(item, newValue, oldValue, MeetingForm)"
    })
    So, I am trying to understand this morning why the two structures depicted below do not behave the same (i.e. Agenda vs. Minutes). It may have to do with the meaning of dataPath:"/". I can load and retrieve data into Minutes. setValues cannot find the fields under Agenda.
    Code:
    Window:MeetingWindow
    +---DynamicForm: MeetingForm
    +---DynamicForm: MeetingBottomHalf
        +---HLayout: MeetingContentOptions
            +---TabSet: MeetingContentTabs
                +---VLayout: AgendaOptionsLayout          (dataPath:"Agenda")
                |   +---DynamicForm: AgendaOptionsForm        (dataPath:"Options")
                |   +---TabSet: AgendaOptionsTabs
                |       +---DynamicForm: AgendaOptionsTopicForm   (dataPath:"Topic")
                |       +---DynamicForm: AgendaOptionsIssueForm   (dataPath:"Issue")
                |       +---DynamicForm: AgendaOptionsTaskForm    (dataPath:"Task")
                |       +---DynamicForm: AgendaOptionsSpecialForm (dataPath:"Special")
                |
                +---VLayout: MinutesOptionsLayout
                    +---DynamicForm: MinutesOptionsForm        (dataPath:"Minutes/Options")
                    +---TabSet: MinutesOptionsTabs
                        +---DynamicForm: MinutesOptionsTopicForm   (dataPath:"Minutes/Topic")
                        +---DynamicForm: MinutesOptionsIssueForm   (dataPath:"Minutes/Issue")
                        +---DynamicForm: MinutesOptionsTaskForm    (dataPath:"Minutes/Task")
                        +---DynamicForm: MinutesOptionsSpecialForm (dataPath:"Minutes/Special")
    The data being loaded into the VM:
    AgendaPrintOptions:
    '{"Options": { "MeetingDetails": true, "TopicDetails": true, "IncludeParticipants": true, "TopicIssues": true, "IssueTasks": true, "CompletedTasks": false, "IssueDetails": true, "TaskDetails": true }, "Topic": { "Leader": true, "TopicTime": true, "SessionType": true, "ExpectedResults": true, "SearchEnabled": false, "ImpactFilter": false, "CategoryFilter": false, "IssueTypeFilter": false, }, "Issue": { "DueDate": true, "IssueType": true, "IssueStatus": true, "Category": true, "IssueDesc": true, "Impact": true, "Owner": true, "Originator": false, "Private": true, "Resolution": false, "ClosedDate": true, "OrigDueDate": false, "ModifiedDate": false, "CreatedDate": true, "IssueLog": true, "IssueLogCount": 3, "IssueLogUnit": "Entries", "IssueLogOrder": "Reverse" }, "Task": { "DueDate": true, "StartDate": true, "TaskStatus": true, "TaskDesc": false, "Owner": true, "CompletedDate": true, "OrigDueDate": false, "ModifiedDate": false, "CreatedDate": false, "TaskLog": false, "TaskLogCount": 3, "TaskLogUnit": "Entries", "TaskLogOrder": "Reverse" }, "Special": { "IssueLikelihood": false, "IssueImpactDesc": false, "SpecificDetails": false } }',
    MinutesPrintOptions
    '{"Options": { "MeetingDetails": true, "TopicDetails": true, "IncludeParticipants": true, "TopicIssues": true, "IssueTasks": true, "CompletedTasks": false, "IssueDetails": true, "TaskDetails": true }, "Topic": { "Leader": true, "TopicTime": true, "SessionType": true, "ExpectedResults": true, "SearchEnabled": false, "ImpactFilter": false, "CategoryFilter": false, "IssueTypeFilter": false, }, "Issue": { "DueDate": true, "IssueType": true, "IssueStatus": true, "Category": true, "IssueDesc": true, "Impact": true, "Owner": true, "Originator": false, "Private": true, "Resolution": false, "ClosedDate": true, "OrigDueDate": false, "ModifiedDate": false, "CreatedDate": true, "IssueLog": true, "IssueLogCount": 3, "IssueLogUnit": "Entries", "IssueLogOrder": "Reverse" }, "Task": { "DueDate": true, "StartDate": true, "TaskStatus": true, "TaskDesc": false, "Owner": true, "CompletedDate": true, "OrigDueDate": false, "ModifiedDate": false, "CreatedDate": false, "TaskLog": false, "TaskLogCount": 3, "TaskLogUnit": "Entries", "TaskLogOrder": "Reverse" }, "Special": { "IssueLikelihood": false, "IssueImpactDesc": false, "SpecificDetails": false } }');
    I wonder if it related to another problem for which I have a workaround. The values I get out for each VM member form have an 'Agenda' object tacked onto the end. The workaround is a test for it and then a simple deletion.

    I am not sure how I broke it, if it ever worked. Any help would be appreciated.

    I may be overthinking this. The 'Agena' dataPath scheme was intended to get around my real problem which was to get the DynamicForm field changes to propogate to the valuseManager for access using getValues. My theory was that the nested 'a/b' datapaths were the source. And, that removing them with an equivalent scheme would be the fix.

    Thanks. And, I hope you are having a Happy New Year.

    Rick

    P.S. I am running SmartClient_v8.2p_2013-11-07/EVAL Development Only on Mozilla Firefox 20.0 with Firebug
    using Windows 7 Premium 64 bit.
    Last edited by RickBollinger; 6 Jan 2014, 07:55. Reason: adding material

    #2
    To diagnosing the problem I added code in itemChange event.
    Code:
    function AgendaOptionsForm_itemChange(item, newV, oldV, form, VM){
    	Log.setPriority("Log", 5);
    	Log.logDebug("*********** AgendaOptionsForm.itemChange");
    
    	Log.logDebug("*** " + item.name + " changed from " + oldV + " to " + newV);
    
    	Log.logDebug("*** meetingTypeVM Agenda.Options.MeetingDetails: " + VM.getValue("Agenda/Options/MeetingDetails"));
    
    	if (form.isNewRecord()) { form.changesPending = false; }
    	else { form.changesPending = true; }
    
    	form.getItem("SaveButton").setDisabled(false);
    	//form.getItem("UndoButton").setDisabled(false); /* RESTORE WHEN valuesManager component form resetValues works w/o datasource */
    
    	Log.logDebug("****END***END***END*** AgendaOptionsForm.itemChange");
    	return true;
    }
    The function is called on the event for the component form.
    itemChange:"AgendaOptionsForm_itemChange(item, newValue, oldValue, MeetingForm, meetingTypeVM)"
    This produces the following log entries.
    12:01:30.354:IFCS6:DEBUG:Log:*********** AgendaOptionsForm.itemChange
    12:01:30.354:IFCS6:DEBUG:Log:*** MeetingDetails changed from true to false
    12:01:30.354:IFCS6:DEBUG:Log:*** meetingTypeVM Agenda.Options.MeetingDetails: true
    12:01:30.357:IFCS6:DEBUG:Log:****END***END***END*** AgendaOptionsForm.itemChange
    The change is accepted because I can see the checkbox clear on the form. I undid all my theory changes and installed a recent version: v8.2p_2013-12-27/EVAL. So, the VM and forms values should be in sync. I can tell because the checkboxes are populated when I first view the form. Also, I can make and SAVE changes using the dataSource.

    I must be doing something wrong to hose the form field sync to the VM.

    Rick

    Comment


      #3
      Just to make sure that using the itemChange event messes up valuesManager synchronization, I reran the test using the itemChanged event.

      The docs say about this event:
      Handler fired when there is a changed() event fired on a FormItem within this form.

      Fires after the change() handler on the FormItem itself, and only if the item did not cancel the change event and chooses to allow it to propagate to the form as a whole.
      So, I assume that the changes to an associated valuesManager would be a part of the propagation.
      ValuesManager can be used to make the forms act as one logical form, supporting all value-related APIs otherwise called on DynamicForm directly.
      The associated VM is defined on the top level canvas, which is a Window.
      Code:
      isc.Window.create({
          ID:"MeetingWindow",
          autoDraw:false,
          overflow:"hidden",
          isModal:true,
          visibility:"hidden",
          title:"Meeting Window",
          showMinimizeButton:false,
          showMaximizeButton:true,
          showStatusBar:false,
          showResizer:false,
          items:[
              MeetingForm,
              MeetingBottomHalf
          ],
          showModalMask:true,
          modalMaskOpacity:10,
          width:"100%",
          height:665,
          top:84,
          canDragReposition:false,
          canDragResize:false,
          valuesManager:isc.ValuesManager.create({
              ID:"meetingTypeVM"
          })
      ,
          showShadow:false,
          onCloseClick:"Log.setPriority(\"Log\", 5);\nLog.logDebug(\"************************** MeetingWindow.closeClick\");\n\n	Application.currentMeetingName = null;\n	Application.currentMeetingTypeID = null;\n	Application.currentTeleconferenceInfo = null;\n	Application.issueNearlyDueDate = Application.projectIssueNearlyDueDate;\n	Application.taskNearlyDueDate = Application.projectTaskNearlyDueDate;\n\n	Log.logDebug(\"**************** Application.issueNearlyDueDate: \" + Application.issueNearlyDueDate);\n	Log.logDebug(\"**************** Application.taskNearlyDueDate: \" + Application.taskNearlyDueDate);\n\nLog.logDebug(\"***END***END***END*** MeetingWindow.closeClick\");"
      })
      In my macro for one of the buttons I want to pull together all the current form and subform values and use them, even if they have not been saved into a database.

      Code:
      function MeetingForm_CreateAgendaButton_Click(form, VM, EE, EF, EW, App){
      	m4_ifelse(m4_eval(debugPriority>=5),1,Log.logDebug("****JavaScript function version*** MeetingForm\CreateAgendaButton\Click");)m4_dnl
      
          //Log.logDebug("*** meetingTypeVM members: " + Log.echoAll(VM.getMembers()));
          Log.logDebug("*** meetingTypeVM Agenda.Options.MeetingDetails: " + VM.getValue("Agenda/Options/MeetingDetails"));
      
      	var vmAgenda = VM.getValues().Agenda; Log.logDebug("*** vmAgenda: " + Log.echoAll(vmAgenda));
      
          var oldPrintOptions = form.getValue("AgendaPrintOptions");  Log.logDebug("*** old[Agenda]PrintOptions: " + oldPrintOptions);
          Log.logDebug("*** changed[VM]PrintOptions: " + Log.echoAll(VM.getChangedValues()));
      
          var vmOptions = vmAgenda["Options"]; Log.logDebug("*** vmOptions: " + Log.echoAll(vmOptions));
      
          if (vmOptions.Agenda == "undefined") {Log.logError("*** vmOptions.Agenda undefined 1: " + Log.echo(vmOptions));}
          if (vmOptions.Agenda === "undefined") {Log.logError("*** vmOptions.Agenda undefined 2: " + Log.echo(vmOptions));}
      
          if (delete vmOptions["Agenda"]) {Log.logDebug("vmOptions[Agenda] deleted."); }
      
          var vmNewOptions = vmOptions; Log.logDebug("*** vmNewOptions: " + Log.echoAll(vmNewOptions));
      
          var vmTopic = vmAgenda.Topic; if (delete vmTopic["Agenda"]) {Log.logDebug("vmTopic[Agenda] deleted."); }
      
          var vmNewTopic = vmTopic; Log.logDebug("*** vmNewTopic: " + Log.echoAll(vmNewTopic));
      
          var vmIssue = vmAgenda.Issue; if (delete vmIssue["Agenda"]) {Log.logDebug("vmIssue[Agenda] deleted."); }
      
          var vmNewIssue = vmIssue; Log.logDebug("*** vmNewIssue: " + Log.echoAll(vmNewIssue));
      
          var vmTask = vmAgenda.Task; if (delete vmTask["Agenda"]) {Log.logDebug("vmTask[Agenda] deleted."); }
      
          var vmNewTask = vmTask; Log.logDebug("*** vmNewTask: " + Log.echoAll(vmNewTask));
      
          var vmSpecial = vmAgenda.Special; if (delete vmSpecial["Agenda"]) {Log.logDebug("vmSpecial[Agenda] deleted."); }
      
          var vmNewSpecial = vmSpecial; Log.logDebug("*** vmNewSpecial: " + Log.echoAll(vmNewSpecial));
      
          var vmNewPrintOptions = { Options: vmNewOptions, Topic: vmNewTopic, Issue: vmNewIssue, Task: vmNewTask, Special: vmNewSpecial  };
      
          var newPrintOptions = isc.JSON.encode(vmNewPrintOptions);
          Log.logDebug("*** new[Agenda]PrintOptions: " + newPrintOptions);
          if (oldPrintOptions != newPrintOptions) { Log.logDebug("*** updated[Agenda]PrintOptions string: " + newPrintOptions);
              form.changesPending = true;
              form.setValue("AgendaPrintOptions", newPrintOptions);
          }
          var meetingDate;
          meetingDate = String(form.getValue("MeetingDate"));
          if (meetingDate == "undefined") { meetingDate = ""; }
          var meetingTime;
          meetingTime = String(form.getValue("MeetingTime"));
          if (meetingTime === "undefined") { meetingTime = ""; }
      
          var d = new Date();
          var minOffset = d.getTimezoneOffset();
          var s;
          if (minOffset < 0) {
              s = "+"; minOffset = -1 * minOffset;
          } else {
              s = "-";
          }
          var hrs = 100 + (minOffset / 60);
          var mins = 100 + minOffset - ( (hrs - 100) * 60);
          var timeZoneOffset = s + hrs.toString().substring(1) + ":" + mins.toString().substring(1);
      
          var emailsKey = Math.floor((Math.random()*1000000000)+1);
      
          form.setValue("emailsKey", emailsKey);
      
          isc.RPCManager.sendRequest({
              httpMethod: "POST",
              actionURL: 	String("/servlet/" + form.getValue("AgendaServletName")),
              params: {   meetingDate:        meetingDate,
                          meetingTime:        meetingTime,
                          timeZoneOffset:     timeZoneOffset,
                          emailsKey:          String(emailsKey),
                          meetingTypeID:      String(App.currentMeetingTypeID),
                          agendaPrintOptions: String(form.getValue("AgendaPrintOptions"))
                  },
              downloadResult: true,
              downloadToNewWindow:false,
              useSimpleHttp: true
          });
      
      //  form.getItem("GetEmailsButton").setDisabled(false);
      
          var attempts = 0;
          var timeout = 250; //milliseconds
      
          Log.logDebug("***EmailsExchange record fetch attempt " + attempts);
      
          function tryAgain() {
              attempts = attempts + 1;
              Log.logDebug("***EmailsExchange record fetch attempt " + attempts);
              EE.fetchRecord( emailsKey,
                  function (dsResponse, data, dsRequest) {
                      Log.logDebug("***EmailsExchange attempt " + attempts + " record fetched: " + Log.echo(dsResponse));
                      if (dsResponse.status >= 0) {
                          if (dsResponse.totalRows == 1) {
                              var rec = {};
                              rec = data[0]; // first and only record
                              EF.editRecord(rec);
                              EW.show();
                              form.getItem("GetEmailsButton").setDisabled(false);
                          } else {
                              if (attempts < 10) {
                                  timeout = timeout * 2;
                                  Log.logDebug("***calling setTimeout 1 to wait " + timeout + " milliseconds");
                                  setTimeout(tryAgain, timeout);
                              } else {
                                  form.getItem("GetEmailsButton").setDisabled(false);
                                  isc.say("Maximum attempts reached for fetching emails.");
                              }
                          }
                      } else {
                          if (attempts < 10) {
                              timeout = timeout * 2;
                              Log.logDebug("***calling setTimeout 2 to wait " + timeout + " milliseconds");
                              setTimeout(tryAgain, timeout);
                          } else {
                              form.getItem("GetEmailsButton").setDisabled(false);
                              isc.say("Maximum attempts reached for fetching emails.");
                          }
                      }
                  }   // end of fetchRecord function
              );  // end of fetchRecord call
          } // end of tryAgain
      
          if (form.getValue("AgendaServletName").substring(0,9) !== "SendAlert") {
          	tryAgain();
      	}
      
      	m4_ifelse(m4_eval(debugPriority>=5),1,Log.logDebug("***END***END***END*** MeetingForm.CreateAgendaButton.Click");)
      }
      You can see I am using getValues to get them all. My expectation is from the docs that this will work.

      Object getValues ()

      Returns the current set of values for the values manager instance. This includes the values from any form managed by this manager, as well as any values explicitly applied via ValuesManager.setValues().
      Yet the diagnostic I get out at button event time does not indicate the changed values. And, there should have been plenty of time for it to happen. The earlier diagnostic from the itemChanged event for the formitem shows the change is not getting to the valuesManager.

      17:03:35.957:IFCS4:DEBUG:Log:*********** AgendaOptionsForm.itemChanged
      17:03:35.958:IFCS4:DEBUG:Log:*** MeetingDetails changed to false
      17:03:35.958:IFCS4:DEBUG:Log:*** meetingTypeVM Agenda.Options.MeetingDetails: true
      17:03:35.960:IFCS4:DEBUG:Log:****END***END***END*** AgendaOptionsForm.itemChanged
      Here is that function, and the code creating the specific form definition.
      Code:
      function AgendaOptionsForm_itemChanged(item, newV, form, VM){
      	Log.setPriority("Log", 5);
      	Log.logDebug("*********** AgendaOptionsForm.itemChanged");
      
      	Log.logDebug("*** " + item.name + " changed to " + newV);
      
      	Log.logDebug("*** meetingTypeVM Agenda.Options.MeetingDetails: " + VM.getValue("Agenda/Options/MeetingDetails"));
      
      	if (form.isNewRecord()) { form.changesPending = false; }
      	else { form.changesPending = true; }
      
      	form.getItem("SaveButton").setDisabled(false);
      	//form.getItem("UndoButton").setDisabled(false); /* RESTORE WHEN valuesManager component form resetValues works w/o datasource */
      
      	Log.logDebug("****END***END***END*** AgendaOptionsForm.itemChanged");
      }
      
      isc.DynamicForm.create({
          ID:"AgendaOptionsForm",
          autoDraw:false,
          numCols:5,
          overflow:"visible",
          dataPath:"Agenda/Options",
          fields:[
              {
                  dataPath:"MeetingDetails",
                  name:"MeetingDetails",
                  title:"Meeting Details",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"IncludeParticipants",
                  name:"IncludeParticipants",
                  title:"Include Participants",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"TopicDetails",
                  name:"TopicDetails",
                  title:"Topic Details",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"TopicIssues",
                  name:"TopicIssues",
                  title:"Topic Issues",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"IssueDetails",
                  name:"IssueDetails",
                  title:"Issue Details",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"IssueTasks",
                  name:"IssueTasks",
                  title:"Issue Tasks",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"TaskDetails",
                  name:"TaskDetails",
                  title:"Task Details",
                  disabled:false,
                  _constructor:"CheckboxItem"
              },
              {
                  dataPath:"CompletedTasks",
                  name:"CompletedTasks",
                  title:"Completed Tasks",
                  disabled:false,
                  _constructor:"CheckboxItem"
              }
          ],
          width:"100%",
          height:100,
          extraSpace:10,
          itemChanged:"AgendaOptionsForm_itemChanged(item, newValue, MeetingForm, meetingTypeVM)"
      })
      But, somehow the change on the form does not get to the associated valuesManager.

      Putting this together, I noticed that all the formitem have dataPath specifications. I did all this some time ago. I will check the dataPath docs again to see if this is appropriate or needed.

      Rick

      Comment


        #4
        In my research this morning I reviewed the reference for dataPath specifications. It left me with some questions.

        In the following example, is the structure element name 'street' derived from the field name 'street' or the downlevel '/street' specification? Or, is it both in the sense that they must agree?
        Examples:
        If a dynamicForm is defined with the following fields:

        [
        { name:"name" },
        { name:"street", dataPath:"address/street" }
        ]

        If the "name" field is set to "Joe Smith" and the "street" field is set to "1221 High Street", when the values for this form are retrieved via a getValues() call they will return an object in the following format:

        {name:"Joe Smith", address:{street:"1221 High Street"}}
        I use this 'id1/id2' type structuring in my code. Do you have an explanation or example of using it on a form component and not just a field?

        I assumed from the following statement that intermediate components (i.e. from the top component that defines the VM and the form components that hold the fields) contribute NULL to the path string. Is that true?
        Code:
        dataPaths are also cumulative. In other words if a component has a specified dataPath, the dataPath of any fields it contains will be appended to that component level path when accessing data. For example the following form:
        
              isc.DynamicForm.create({
                  dataPath:"contact",
                  fields:[
                      {dataPath:"address/email"}
                  ]
         
        
        Might be used to edit a data structure similar to this:
        
        {contact:{name:'Ed Jones', address:{state:"CA", email:"ed@ed.jones.com"}}}
        I tried to make sense of this example. But, it seems to be incomplete. Where is {dataPath:"address/email"} supposed to be applied? Can it really just be inserted in the 'fields' array? Or, was this example meant to show it should be applied to each of the fields in the array?

        How are these two path expressions not equivalent?
        Code:
        Window with VM
            .
            . intervening canvases with no dataPaths
            .
            Layout dataPath:"Agenda"
                Form dataPath:"Options"
                    Fields with dataPaths = fieldnames
        ==============================
        Window with VM
            .
            . intervening canvases with no dataPaths
            .
            Layout dataPath:"Agenda/Options"
                Form with no dataPath
                    Fields with dataPaths = fieldnames
        I thought so. But, my testing showed otherwise.

        This is the code. I put the "Agenda/Options" on the form dataPath.
        Code:
        isc.DynamicForm.create({
            ID:"AgendaOptionsForm",
            autoDraw:false,
            numCols:5,
            overflow:"visible",
            dataPath:"Agenda/Options",
            fields:[
                {
                    dataPath:"MeetingDetails",
                    name:"MeetingDetails",
                    title:"Meeting Details",
                    disabled:false,
                    _constructor:"CheckboxItem"
                },
        I can get and set values using paths like this: getValue("Agenda/Options/MeetingDetails")
        Code:
        Log.logDebug("*** meetingTypeVM Agenda.Options.MeetingDetails: " + VM.getValue("Agenda/Options/MeetingDetails"));
        I am having difficulty getting form item changes to propagate into the valuesManager.

        Anyway, I am going back to the drawing board and checking all my assumptions.

        Thanks,

        Rick

        Comment


          #5
          Well, I eliminated all the 'cannot find the formitem' errors and quirky results loading a valuesManager. And, I can load a valuesManager with setValues and a structure, and match the input and output when I do a check. However, the new values do not show up on their forms. Things are complicated because the data values to load come from one form associated with a dataSource (MeetingForm with a hidden text field). But, the formitem checkboxes and text fields and their forms are a few canvases down under a HLayout that is part of the same window.

          I am doing all this in the visibilityChanged event for 'MeetingForm', the form with the dataSource.

          Here is the new dataPath scheme and the structure of canvases I am using.
          Code:
          Window:MeetingWindow with valuesManager:"meetingTypeVM"
          +---DynamicForm: MeetingForm
          +---HLayout: MeetingBottomHalf
              +---HLayout: MeetingContentOptions
                  +---TabSet: MeetingContentTabs
                      +---VLayout: AgendaOptionsLayout          (dataPath:"Agenda")
                      |   +---DynamicForm: AgendaOptionsForm     (dataPath:"/Options")
                      |   +---TabSet: AgendaOptionsTabs             (dataPath:"/")
                      |       +---DynamicForm: AgendaOptionsTopicForm   (dataPath:"Topic")
                      |       +---DynamicForm: AgendaOptionsIssueForm   (dataPath:"Issue")
                      |       +---DynamicForm: AgendaOptionsTaskForm    (dataPath:"Task")
                      |       +---DynamicForm: AgendaOptionsSpecialForm (dataPath:"Special")
                      |
                      +---VLayout: MinutesOptionsLayout         (dataPath:"Minutes")		
                          +---DynamicForm: MinutesOptionsForm       (dataPath:"/Options")
                          +---TabSet: MinutesOptionsTabs	           (dataPath:"/")
                              +---DynamicForm: MinutesOptionsTopicForm   (dataPath:"Topic")
                              +---DynamicForm: MinutesOptionsIssueForm   (dataPath:"Issue")
                              +---DynamicForm: MinutesOptionsTaskForm    (dataPath:"Task")
                              +---DynamicForm: MinutesOptionsSpecialForm (dataPath:"Special")
          Here is the object used with setValues.
          Code:
          14:46:58.839:MUP1:DEBUG:Log:*************** MeetingForm.visibilityChanged
          14:46:58.840:MUP1:DEBUG:Log:*** starting meetingTypeVM: {}
          14:46:58.867:MUP1:DEBUG:Log:*** assembled allOptions used to setValues: {
              "Agenda": {
                  "Options": {
                      "MeetingDetails": true,
                      "IncludeParticipants": true,
                      "TopicDetails": true,
                      "TopicIssues": true,
                      "IssueDetails": true,
                      "IssueTasks": true,
                      "TaskDetails": true,
                      "CompletedTasks": false
                  },
                  "Topic": {
                      "Leader": true,
                      "TopicTime": true,
                      "SearchEnabled": false,
                      "SessionType": true,
                      "ImpactFilter": false,
                      "ExpectedResults": true,
                      "CategoryFilter": false,
                      "IssueTypeFilter": false
                  },
                  "Issue": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "ClosedDate": true,
                      "IssueStatus": true,
                      "Owner": true,
                      "Private": true,
                      "IssueType": true,
                      "Originator": false,
                      "ModifiedDate": false,
                      "Category": true,
                      "IssueDesc": true,
                      "CreatedDate": true,
                      "Impact": true,
                      "Resolution": false,
                      "IssueLog": true,
                      "IssueLogCount": 3,
                      "IssueLogUnit": "Entries",
                      "IssueLogOrder": "Reverse"
                  },
                  "Task": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "StartDate": true,
                      "TaskStatus": true,
                      "Owner": true,
                      "CompletedDate": true,
                      "TaskDesc": false,
                      "TaskLog": false,
                      "ModifiedDate": false,
                      "CreatedDate": false,
                      "TaskLogCount": 3,
                      "TaskLogUnit": "Entries",
                      "TaskLogOrder": "Reverse"
                  },
                  "Special": {
                      "IssueLikelihood": false,
                      "IssueImpactDesc": false,
                      "SpecificDetails": false
                  }
              },
              "Minutes": {
                  "Options": {
                      "MeetingDetails": true,
                      "IncludeParticipants": true,
                      "TopicDetails": true,
                      "TopicIssues": true,
                      "IssueDetails": true,
                      "IssueTasks": true,
                      "TaskDetails": true,
                      "CompletedTasks": false
                  },
                  "Topic": {
                      "Leader": true,
                      "TopicTime": true,
                      "SearchEnabled": false,
                      "SessionType": true,
                      "ImpactFilter": false,
                      "ExpectedResults": true,
                      "CategoryFilter": false,
                      "IssueTypeFilter": false
                  },
                  "Issue": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "ClosedDate": true,
                      "IssueStatus": true,
                      "Owner": true,
                      "Private": true,
                      "IssueType": true,
                      "Originator": false,
                      "ModifiedDate": false,
                      "Category": true,
                      "IssueDesc": true,
                      "CreatedDate": true,
                      "Impact": true,
                      "Resolution": false,
                      "IssueLog": true,
                      "IssueLogCount": 3,
                      "IssueLogUnit": "Entries",
                      "IssueLogOrder": "Reverse"
                  },
                  "Task": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "StartDate": true,
                      "TaskStatus": true,
                      "Owner": true,
                      "CompletedDate": true,
                      "TaskDesc": false,
                      "TaskLog": false,
                      "ModifiedDate": false,
                      "CreatedDate": false,
                      "TaskLogCount": 3,
                      "TaskLogUnit": "Entries",
                      "TaskLogOrder": "Reverse"
                  },
                  "Special": {
                      "IssueLikelihood": false,
                      "IssueImpactDesc": false,
                      "SpecificDetails": false
                  }
              }
          }
          Here is the result pulled after the call.
          Code:
          14:46:58.867:MUP1:DEBUG:Log:*** resulting meetingTypeVM: {
              "Agenda": {
                  "Options": {
                      "MeetingDetails": true,
                      "IncludeParticipants": true,
                      "TopicDetails": true,
                      "TopicIssues": true,
                      "IssueDetails": true,
                      "IssueTasks": true,
                      "TaskDetails": true,
                      "CompletedTasks": false
                  },
                  "Topic": {
                      "Leader": true,
                      "TopicTime": true,
                      "SearchEnabled": false,
                      "SessionType": true,
                      "ImpactFilter": false,
                      "ExpectedResults": true,
                      "CategoryFilter": false,
                      "IssueTypeFilter": false
                  },
                  "Issue": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "ClosedDate": true,
                      "IssueStatus": true,
                      "Owner": true,
                      "Private": true,
                      "IssueType": true,
                      "Originator": false,
                      "ModifiedDate": false,
                      "Category": true,
                      "IssueDesc": true,
                      "CreatedDate": true,
                      "Impact": true,
                      "Resolution": false,
                      "IssueLog": true,
                      "IssueLogCount": 3,
                      "IssueLogUnit": "Entries",
                      "IssueLogOrder": "Reverse"
                  },
                  "Task": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "StartDate": true,
                      "TaskStatus": true,
                      "Owner": true,
                      "CompletedDate": true,
                      "TaskDesc": false,
                      "TaskLog": false,
                      "ModifiedDate": false,
                      "CreatedDate": false,
                      "TaskLogCount": 3,
                      "TaskLogUnit": "Entries",
                      "TaskLogOrder": "Reverse"
                  },
                  "Special": {
                      "IssueLikelihood": false,
                      "IssueImpactDesc": false,
                      "SpecificDetails": false
                  }
              },
              "Minutes": {
                  "Options": {
                      "MeetingDetails": true,
                      "IncludeParticipants": true,
                      "TopicDetails": true,
                      "TopicIssues": true,
                      "IssueDetails": true,
                      "IssueTasks": true,
                      "TaskDetails": true,
                      "CompletedTasks": false
                  },
                  "Topic": {
                      "Leader": true,
                      "TopicTime": true,
                      "SearchEnabled": false,
                      "SessionType": true,
                      "ImpactFilter": false,
                      "ExpectedResults": true,
                      "CategoryFilter": false,
                      "IssueTypeFilter": false
                  },
                  "Issue": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "ClosedDate": true,
                      "IssueStatus": true,
                      "Owner": true,
                      "Private": true,
                      "IssueType": true,
                      "Originator": false,
                      "ModifiedDate": false,
                      "Category": true,
                      "IssueDesc": true,
                      "CreatedDate": true,
                      "Impact": true,
                      "Resolution": false,
                      "IssueLog": true,
                      "IssueLogCount": 3,
                      "IssueLogUnit": "Entries",
                      "IssueLogOrder": "Reverse"
                  },
                  "Task": {
                      "DueDate": true,
                      "OrigDueDate": false,
                      "StartDate": true,
                      "TaskStatus": true,
                      "Owner": true,
                      "CompletedDate": true,
                      "TaskDesc": false,
                      "TaskLog": false,
                      "ModifiedDate": false,
                      "CreatedDate": false,
                      "TaskLogCount": 3,
                      "TaskLogUnit": "Entries",
                      "TaskLogOrder": "Reverse"
                  },
                  "Special": {
                      "IssueLikelihood": false,
                      "IssueImpactDesc": false,
                      "SpecificDetails": false
                  }
              }
          }
          14:46:58.868:MUP1:DEBUG:Log:***END***END***END*** MeetingForm.visibilityChanged
          Earlier, I even tried to markForRedraw the MeetingWindow from MeetingForm.visibilityChanged. This is the result.
          Code:
          15:54:54.886:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_34:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.887:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_35:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.887:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_36:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.888:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_37:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.888:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_38:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.888:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_39:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.888:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_40:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.889:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_41:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.889:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_42:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.889:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_43:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.889:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_44:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.889:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_45:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.890:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_46:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.890:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_47:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.890:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_48:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.890:RDQ1:WARN:TextItem:isc_TextItem_109:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.891:RDQ1:WARN:SelectItem:isc_SelectItem_40:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.891:RDQ1:WARN:RadioItem:isc_RadioItem_0:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.891:RDQ1:WARN:RadioItem:isc_RadioItem_1:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.897:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_49:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.897:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_50:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.897:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_51:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.898:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_52:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.898:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_53:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.898:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_54:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.898:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_55:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.898:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_56:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.900:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_57:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.903:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_58:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.903:RDQ1:WARN:TextItem:isc_TextItem_110:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.903:RDQ1:WARN:SelectItem:isc_SelectItem_41:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.904:RDQ1:WARN:RadioItem:isc_RadioItem_2:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.904:RDQ1:WARN:RadioItem:isc_RadioItem_3:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.909:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_59:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.909:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_60:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          15:54:54.909:RDQ1:WARN:CheckboxItem:isc_CheckboxItem_61:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          I even tried to markForRedraw the HLayout using the visibilityChanged event for the HLayout (MeetingBottomHalf). But all the formitems similarly complain that they cannot find the 'focus element' for their event handlers. This is unexpected because the formitems are on the canvas chain below the HLayout.

          Darned if I do and darned if I don't. For some reason I feel I am close to a solution. I just don't know which direction to go in. Any clues?

          I would post all the code but it is way too big.

          Rick

          Comment

          Working...
          X