title: XPages - dependant combobox goes empty when submitting
body: <p>I have a Custom Control that opens a popup to fill some workitem.</p>
  
  <p>The project is a combobox that gives the values of 3 others fields ( origin, inquirer and reason )</p>
  
  <p>The combobox intervention is based on the reason combobox.</p>
  
  <p>All the values are populated properly but there's also some validation because all fields are required.</p>
  
  <p>When hitting the button Submit, the validation is done but it's emptying the field Intervention.</p>
  
  <p>I can't find why.  Any help please</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"
  xmlns:xe="http://www.ibm.com/xsp/coreex"&gt;
  
  &lt;xe:dialog id="dlgNote"&gt;        
      &lt;xe:this.title&gt;&lt;![CDATA[#{javascript:
          if (sessionScope.lang == "fr") {
              "Note";
          } else {
              "Work Item";
          }
      }]]&gt;&lt;/xe:this.title&gt;
  
      &lt;xp:panel&gt;
          &lt;xp:this.data&gt;
              &lt;xp:dominoDocument var="WorkItem" formName="WorkItem"
                  action="editDocument" documentId="#{javascript:viewScope.UNID}"
                  ignoreRequestParams="true" /&gt;
          &lt;/xp:this.data&gt;
  
          &lt;xp:inputText id="wi_ParentUNID1" value="#{WorkItem.wi_ParentUNID}"
              defaultValue="#{javascript:client.getDocument().getUniversalID();}"
              disabled="true" style="display:none" rendered="#{javascript:currentDocument.isEditable()}"&gt;
          &lt;/xp:inputText&gt;
  
          &lt;xp:inputText id="inputText2" value="#{WorkItem.wi_WeekNo}" disabled="true" style="display:none"&gt;
              &lt;xp:this.defaultValue&gt;&lt;![CDATA[#{javascript:
                  now = new Date();
                  onejan = new Date(now.getFullYear(), 0, 1);
                  week = Math.ceil( (((now - onejan) / 86400000) + onejan.getDay() + 1) / 7 );
                  @Text(@Year(now)) + "-" + @Text(week);
              }]]&gt;&lt;/xp:this.defaultValue&gt;
          &lt;/xp:inputText&gt;
  
          &lt;xp:inputText id="inputText1"
              value="#{WorkItem.wi_Province}" disabled="true" style="display:none"
              rendered="#{javascript:currentDocument.isEditable()}"&gt;
          &lt;xp:this.defaultValue&gt;&lt;![CDATA[#{javascript:getComponent("cli_Province").getValue()}]]&gt;&lt;/xp:this.defaultValue&gt;&lt;/xp:inputText&gt;
          &lt;xp:inputText id="inputText3"
              value="#{WorkItem.brokercode}" disabled="true" style="display:none"
              rendered="#{javascript:currentDocument.isEditable()}"&gt;
          &lt;xp:this.defaultValue&gt;&lt;![CDATA[#{javascript:getComponent("cli_BrokerID").getValue()}]]&gt;&lt;/xp:this.defaultValue&gt;&lt;/xp:inputText&gt;
          &lt;xe:formTable id="formTable2" labelWidth="200px" labelPosition="above" disableErrorSummary="true" disableRowError="true"&gt;
              &lt;xp:this.facets&gt;
                  &lt;xe:formRow id="formRow15" xp:key="footer"&gt;
                      &lt;xp:panel style="padding-top:8px;"&gt;
                          &lt;xp:button value="Submit" id="button1"&gt;
                              &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:
                                  var dtcrt:java.util.Date = @Created();
                                  var dtnow:java.util.Date = new Date();
                                  var isSameDay:boolean = (dtnow.getFullYear()==dtcrt.getFullYear() &amp;&amp; dtnow.getMonth()==dtcrt.getMonth() &amp;&amp;
                                                           dtnow.getDate()==dtcrt.getDate());
  
                                  // Show button with new document
                                  if (viewScope.UNID == "") {
                                      return true;
                                  // Show button for Administrator
                                  } else if (database.queryAccessRoles(session.getEffectiveUserName()).contains('[Administration]')) {
                                      return true;
                                  // Show button to allows edition the same day until midnight.
                                  } else if (isSameDay) {
                                      return true;
                                  // Otherwise hide button
                                  } else {
                                      return false;
                                  }
                              }]]&gt;&lt;/xp:this.rendered&gt;
                              &lt;xp:eventHandler event="onclick"
                                  submit="true" refreshMode="complete" save="true"
                                  id="eventHandler3"&gt;
                                  &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:
                                      WorkItem.save();
                                      getComponent("dlgNote").hide();
                                  }]]&gt;&lt;/xp:this.action&gt;
                              &lt;/xp:eventHandler&gt;
                          &lt;/xp:button&gt;
  
                          &lt;xp:button value="Cancel" id="button2"&gt;
                              &lt;xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="true" save="false" id="eventHandler4"&gt;
                                  &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:
                                      requestScope.ButtonAction="";
                                      getComponent("dlgNote").hide();
                                  }]]&gt;&lt;/xp:this.action&gt;
                              &lt;/xp:eventHandler&gt;
                          &lt;/xp:button&gt;
                      &lt;/xp:panel&gt;
                  &lt;/xe:formRow&gt;
              &lt;/xp:this.facets&gt;
  
              &lt;xe:formColumn id="formColumn6"&gt;
                  &lt;xe:formRow id="formRow1"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg01" for="wi_Date"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                      &lt;xp:inputText id="wi_Date" value="#{WorkItem.wi_Date}" style="height:19px; width:194px;"
                          required="true" disableClientSideValidation="true"&gt;
                          &lt;xp:this.converter&gt;
                              &lt;xp:convertDateTime
                                  pattern="yyyy-MM-dd hh:mm:ss"&gt;
                              &lt;/xp:convertDateTime&gt;
                          &lt;/xp:this.converter&gt;
                          &lt;xp:this.defaultValue&gt;&lt;![CDATA[#{javascript:
                              @If(@IsNewDoc(), @Now(), getComponent("wi_Date").getValue());
                          }]]&gt;&lt;/xp:this.defaultValue&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must enter a value."&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                      &lt;/xp:inputText&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label3" value="Date:" style="font-weight:bold; font-size:9pt;" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow16"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg02" for="wi_Project"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                      &lt;xp:comboBox id="wi_Project" style="font-size:9pt; height:19px; width:200px;"
                          value="#{WorkItem.wi_Project}" required="true" disableClientSideValidation="true"&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must select a value."&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:@Text("")}]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:
                                  //var col = (sessionScope.lang == "fr" ? 3 : 4);
                                  //@DbLookup(@DbName(),"VWL010","Project",col,"[FAILSILENT]");
  
                                  /////////
                                      var col = (sessionScope.lang == "fr" ? 3 : 4);
  
                                  ///////////////////////////////////////////
  
                                  var doc:NotesDocument = currentDocument.getDocument();
                                  if (doc.hasItem("wi_Date")) 
                                  {
  
                                      var dt:NotesDateTime = doc.getItemValueDateTimeArray("wi_Date").elementAt(0);
                                  //  return @Day(dt.getDateOnly());
  
  
                                       var y = @Text(@Year(dt.getDateOnly()));
                                       var m = @Text(@Month(dt.getDateOnly()));
                                       var d = @Text(@Day(dt.getDateOnly()));
                                       var WorkItemdt = y + @Left(00+m,2) + @Left(00+d,2);
  
                                      //return WorkItemdt;
                                      //cutoff date pour voir les nouvelles listes déroulantes
  
                                      if ((WorkItemdt) &lt; "20190201")
                                      {
                                      //vieille
                                          return @DbLookup(@DbName(),"VWL010A","Project",col,"[FAILSILENT]");
                                      }
                                      else{
                                      //nouveau
                                          return @DbLookup(@DbName(),"VWL010","Project",col,"[FAILSILENT]");
                                      }   
                                  }
                                  else{
                                      //nouveau
                                      return @DbLookup(@DbName(),"VWL010","Project",col,"[FAILSILENT]");
                                  }
  
  
  
                              }]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                          &lt;xp:eventHandler event="onchange" submit="true" disableValidators="true"&gt;&lt;/xp:eventHandler&gt;
                      &lt;/xp:comboBox&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label2" value="Project:" style="font-weight:bold; font-size:9pt;" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow12"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg03" for="wi_Inquirer"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                      &lt;xp:comboBox id="wi_Inquirer" style="font-size:9pt; height:19px; width:200px;"
                          value="#{WorkItem.wi_Inquirer}" required="true" disableClientSideValidation="true"&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must select a value."&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:@Text("")}]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:
  
                              var col = (sessionScope.lang == "fr" ? 10 : 9);
                                  //var strKey = getComponent("wi_Project").getSubmittedValue();
                                  var strKey = getComponent("wi_Project").getValue();
                                  if (strKey != null) {
                                      strKey.trim();                                      
                                  }                               
                                  var items = @DbLookup(@DbName(),"VWL010",strKey,col,"[FAILSILENT]");
                                  if (items != null) {
                                      return items;
                                  }
                              }]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                      &lt;/xp:comboBox&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label7" value="Inquirer:" style="font-weight:bold; font-size:9pt;" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow2"&gt;
                      &lt;xp:checkBox text="Linked broker"
                          id="chkLinkedBroker" value="#{WorkItem.linkedbroker}" checkedValue="yes" uncheckedValue="no"&gt;
                          &lt;xp:eventHandler event="onchange" submit="true" disableValidators="true"&gt;&lt;/xp:eventHandler&gt;
                      &lt;/xp:checkBox&gt;
                  &lt;/xe:formRow&gt;
              &lt;/xe:formColumn&gt;
  
              &lt;xe:formColumn id="formColumn5"&gt;
                  &lt;xe:formRow id="formRow13"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg04" for="wi_AgentName"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                      &lt;xp:inputText id="wi_AgentName" value="#{WorkItem.wi_AgentName}"
                          style="font-size:9pt; height:19px; width:194px;" required="true" disableClientSideValidation="true"&gt;
                          &lt;xp:this.defaultValue&gt;&lt;![CDATA[#{javascript:
                              @If(@IsNewDoc(), @Name("[CN]", @UserName()), getComponent("wi_AgentName").getValue());
                          }]]&gt;&lt;/xp:this.defaultValue&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must enter a value."&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                      &lt;/xp:inputText&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label4" style="font-weight:bold; font-size:9pt;" value="Agent Name:" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow21"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg05" for="wi_Origin"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                      &lt;xp:comboBox id="wi_Origin" style="font-size:9pt; height:19px; width:200px;"
                          value="#{WorkItem.wi_Origin}" required="true" disableClientSideValidation="true"&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must select a value."&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:@Text("") }]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:
                              var col = (sessionScope.lang == "fr" ? 8 : 7);
                                  //var strKey = getComponent("wi_Project").getSubmittedValue();
                                  var strKey = getComponent("wi_Project").getValue();
                                  if (strKey != null) {
                                      strKey.trim();                                      
                                  }                               
                                  var items = @DbLookup(@DbName(),"VWL010",strKey,col,"[FAILSILENT]");
                                  if (items != null) {
                                      return items;
                                  }}]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                      &lt;/xp:comboBox&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label18" style="font-weight:bold; font-size:9pt;" value="Origin:" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow4"&gt;&lt;xp:this.facets&gt;
  &lt;xp:label value="Reason" id="label8" xp:key="label"
      style="font-weight:bold; font-size:9pt;"&gt;
  &lt;/xp:label&gt;&lt;/xp:this.facets&gt;
                  &lt;xp:div&gt;
                      &lt;xp:message id="message1" for="wi_Reason"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                  &lt;xp:comboBox id="wi_Reason"
                      value="#{WorkItem.wi_Reason}"
                      style="font-size:9pt; height:19px; width:200px;" required="true"
                      disableClientSideValidation="true"&gt;
                      &lt;xp:this.validators&gt;
                          &lt;xp:validateRequired
                              message="You must select a value."&gt;
                          &lt;/xp:validateRequired&gt;
                      &lt;/xp:this.validators&gt;
                      &lt;xp:selectItems&gt;
                          &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return "";}]]&gt;&lt;/xp:this.value&gt;
                      &lt;/xp:selectItems&gt;
                      &lt;xp:selectItems&gt;
                          &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:var col = (sessionScope.lang == "fr" ? 12 : 11);
                                  //var strKey = getComponent("wi_Project").getSubmittedValue();
                                  var strKey = getComponent("wi_Project").getValue();
                                  if (strKey != null) {
                                      strKey.trim();                                      
                                  }                               
                                  var items = @DbLookup(@DbName(),"VWL010",strKey,col,"[FAILSILENT]");
                                  if (items != null) {
  
                                      return items;
                                  }}]]&gt;&lt;/xp:this.value&gt;
                      &lt;/xp:selectItems&gt;
                      &lt;xp:eventHandler event="onchange" submit="true"
                          refreshMode="partial" refreshId="wi_Intervention"
                          immediate="true"&gt;
  
                      &lt;/xp:eventHandler&gt;
                  &lt;/xp:comboBox&gt;&lt;/xe:formRow&gt;
  
  
  
                  ////////////INTERVENTION////////////////////////////
                  &lt;xe:formRow id="formRow19"&gt;
                      &lt;xp:div&gt;&lt;xp:message id="msg06" for="wi_Intervention"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;                     
                      &lt;xp:comboBox id="wi_Intervention"
                          style="font-size:9pt; height:19px; width:200px;"
                          value="#{WorkItem.wi_Intervention}" required="true"
                          disableClientSideValidation="true"&gt;
                          &lt;xp:this.validators&gt;
                              &lt;xp:validateRequired
                                  message="You must select a value"&gt;
                              &lt;/xp:validateRequired&gt;
                          &lt;/xp:this.validators&gt;
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:@Text("")}]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
  
                          &lt;xp:selectItems&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:var col = (sessionScope.lang == "fr" ? 14 : 13);
  var value = getComponent("wi_Reason").getSubmittedValue(); 
  
  if (value != null) {
                  var value = value.trim();       
                  return @DbLookup(@DbName(),"VWL010",value,col);
                  }
                  else{
                  };
  
  
  
  
  
  
                      }]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:selectItems&gt;
                      &lt;/xp:comboBox&gt;
  
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label6" style="font-weight:bold; font-size:9pt;" value="Intervention:" xp:key="label"&gt;&lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                  &lt;/xe:formRow&gt;
  
                  &lt;xe:formRow id="formRow3"&gt;
                      &lt;xp:panel id="panelbroker"&gt;
                          &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:
                              var strValue:String = getComponent("chkLinkedBroker").getValue();
                              getComponent("chkLinkedBroker").getValue()=="yes";
                          }]]&gt;
                          &lt;/xp:this.rendered&gt;
                          &lt;xp:div&gt;&lt;xp:message id="msg07" for="wi_brokercode"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;                           
                          &lt;xp:label id="label5" style="font-weight:bold; font-size:9pt;" value="Broker code:"&gt;
                              &lt;xp:br /&gt;
                              &lt;xp:inputText id="wi_brokercode"
                                  value="#{WorkItem.brokercode}" style="width:100px;"
                                  required="true" disableClientSideValidation="true"&gt;
                                  &lt;xp:this.validators&gt;
                                      &lt;xp:validateRequired
                                          message="Enter a number of max. six digits."&gt;
                                      &lt;/xp:validateRequired&gt;
                                      &lt;xp:validateLength maximum="6"
                                          minimum="1" message="Enter a number of max. six digits."&gt;
                                      &lt;/xp:validateLength&gt;
                                  &lt;/xp:this.validators&gt;
                              &lt;/xp:inputText&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:panel&gt;
                  &lt;/xe:formRow&gt;
              &lt;/xe:formColumn&gt;
  
              &lt;xe:formRow id="formRow9"&gt;
                  &lt;xp:div&gt;&lt;xp:message id="msg09" for="document_form_body"&gt;&lt;/xp:message&gt;&lt;/xp:div&gt;
                  &lt;xp:inputTextarea value="#{WorkItem.wi_Comments}"
                      id="document_form_body"
                      style="width:464px; height:125px; font-size:9pt;" required="true"
                      disableClientSideValidation="true"&gt;
                      &lt;xp:this.validators&gt;
                          &lt;xp:validateRequired
                              message="You must enter a comment."&gt;
                          &lt;/xp:validateRequired&gt;
                      &lt;/xp:this.validators&gt;
                  &lt;/xp:inputTextarea&gt;
  
                  &lt;xp:this.facets&gt;
                      &lt;xp:label id="label1" value="Comments:" style="font-weight:bold; font-size:9pt;" xp:key="label"&gt;&lt;/xp:label&gt;
                  &lt;/xp:this.facets&gt;
              &lt;/xe:formRow&gt;
          &lt;/xe:formTable&gt;
      &lt;/xp:panel&gt;
  
      &lt;xp:eventHandler event="onHide" submit="true" refreshMode="partial" refreshId="tabbedPanel1"&gt;&lt;/xp:eventHandler&gt;
  &lt;/xe:dialog&gt;
  &lt;/xp:view&gt;
  </code></pre>