title: Create document in view row. Two and more form documents inline in view
body: <p>I type a text in inline form, and do not close inline form, after that I create top main document by top form. Inline form which not closed move up in row which just created main document row. But it must stay in old place. How fix it? Or how to create 2 or more documents by inline form in view when forms all have a text?</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"
      xmlns:xc="http://www.ibm.com/xsp/custom"&gt;
      &lt;xp:this.beforePageLoad&gt;&lt;![CDATA[#{javascript:var documentId : String = context.getUrlParameter('documentId');
  if (documentId!="") {sessionScope.put("Channal",documentId)};
  if (!sessionScope.containsKey("Channal")) {
  var docChannal : NotesDocument = database.getView("subChannal").getDocumentByKey("True");
  if (docChannal != null) {
  sessionScope.put("Channal",docChannal.getUniversalID());
  }
  }}]]&gt;&lt;/xp:this.beforePageLoad&gt;
      &lt;xp:panel id="Main"&gt;
          &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:try {
  var docChannal : NotesDocument = database.getDocumentByUNID(sessionScope.get("Channal"));
  return docChannal.getUniversalID()!=""
  } catch(e) {
      return false
  }}]]&gt;&lt;/xp:this.rendered&gt;
          &lt;xp:panel id="documentMessageCreate"&gt;
              &lt;xp:this.data&gt;
                  &lt;xp:dominoDocument var="documentMessageCreate"
                      formName="Message" computeWithForm="onsave" action="newDocument"
                      scope="request" ignoreRequestParams="true"&gt;
                      &lt;xp:this.postNewDocument&gt;
                          &lt;xp:actionGroup&gt;
                              &lt;xp:this.condition&gt;&lt;![CDATA[#{javascript:return currentDocument.isNewNote() &amp;&amp; currentDocument.isResponse()}]]&gt;&lt;/xp:this.condition&gt;
                              &lt;xp:modifyField name="Read"
                                  var="currentDocument"&gt;
                                  &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:database.getDocumentByUNID(currentDocument.getParentId()).getItemValue("Read")}]]&gt;&lt;/xp:this.value&gt;
                              &lt;/xp:modifyField&gt;
                          &lt;/xp:actionGroup&gt;
                      &lt;/xp:this.postNewDocument&gt;
                      &lt;xp:this.parentId&gt;&lt;![CDATA[#{javascript:sessionScope.get("Channal") }]]&gt;&lt;/xp:this.parentId&gt;
                  &lt;/xp:dominoDocument&gt;
              &lt;/xp:this.data&gt;
              &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:var docChannal : NotesDocument = database.getDocumentByUNID(sessionScope.get("Channal"));
  return ! @IsNotMember(@UserName() ,docChannal.getItemValue("MessageCreate"))  || docChannal.getItemValueString("MessageCreate")==""
  /* var docChannal : NotesDocument = database.getDocumentByUNID(sessionScope.get("Channal"));
  var ArrayName=[];
  ArrayName=ArrayName.concat('[Manager]');
  ArrayName=ArrayName.concat('[Administrator]');
  return ! ( @IsNotMember(database.queryAccessRoles(@UserName()),ArrayName) &amp;&amp; @IsNotMember(@UserName() ,docChannal.getItemValue("MessageCreate")) ) || docChannal.getItemValueString("MessageCreate")==""
  */}]]&gt;&lt;/xp:this.rendered&gt;
              &lt;xp:table style="width:100%" id="tableMessage"
                  styleClass="messageCreate"&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td valign="top" style="width:32px"&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td&gt;
                          &lt;xp:inputRichText
                              value="#{documentMessageCreate.Body}" id="MainMessage"&gt;
                              &lt;xp:this.dojoAttributes&gt;
                                  &lt;xp:dojoAttribute
                                      name="autoGrow_minHeight" value="50"&gt;
                                  &lt;/xp:dojoAttribute&gt;
                              &lt;/xp:this.dojoAttributes&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td&gt;&lt;/xp:td&gt;
                      &lt;xp:td&gt;
                          &lt;xp:button
                              value="#{javascript:translateString('Send')}"
                              id="CreateMessage"&gt;
                          &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="Main"&gt;
                              &lt;xp:this.action&gt;
                                  &lt;xp:actionGroup&gt;
                                  &lt;xp:saveDocument
                                          var="documentMessageCreate"&gt;
                                      &lt;/xp:saveDocument&gt;
                                                  &lt;xp:executeScript&gt;
                                          &lt;xp:this.script&gt;&lt;![CDATA[#{javascript://context.redirectToPage("Main")
  getComponent("MainMessage").setValue("")
  }]]&gt;&lt;/xp:this.script&gt;
                                      &lt;/xp:executeScript&gt;
                                  &lt;/xp:actionGroup&gt;
                              &lt;/xp:this.action&gt;&lt;/xp:eventHandler&gt;&lt;/xp:button&gt;
                      &lt;/xp:td&gt;
                  &lt;/xp:tr&gt;
              &lt;/xp:table&gt;
          &lt;/xp:panel&gt;
          &lt;xp:panel id="dataViewMessage"&gt;
              &lt;xp:this.data&gt;
                  &lt;xp:dominoView var="viewMessage"
                      viewName="(xpMessage)"&gt;
                      &lt;xp:this.parentId&gt;&lt;![CDATA[#{javascript:sessionScope.get("Channal") 
  
  }]]&gt;&lt;/xp:this.parentId&gt;
                  &lt;/xp:dominoView&gt;
              &lt;/xp:this.data&gt;
              &lt;xp:repeat rows="10" var="row" value="#{viewMessage}"
                  id="viewRepeatMessage"&gt;
                  &lt;xp:panel id="documentMessage"&gt;
                      &lt;xp:this.data&gt;
                          &lt;xp:dominoDocument var="documentMessage"
                              action="openDocument" documentId="#{javascript:row.getNoteID()}"
                              ignoreRequestParams="true" formName="Message" scope="request"&gt;
                          &lt;/xp:dominoDocument&gt;
                      &lt;/xp:this.data&gt;
                      &lt;xp:table id="tableData"&gt;
                          &lt;xp:this.style&gt;&lt;![CDATA[#{javascript:if (row.getColumnIndentLevel()&gt;0) {
   return "width:100%;margin-left:"+(row.getColumnIndentLevel()*32).toString()+"px;"
    }  else {
     return "width:100%;"
    }
   }]]&gt;&lt;/xp:this.style&gt;
                          &lt;xp:this.styleClass&gt;&lt;![CDATA[#{javascript:if (row.getColumnIndentLevel()==0) {
  return "message" }}]]&gt;&lt;/xp:this.styleClass&gt;
                          &lt;xp:tr&gt;
                              &lt;xp:td rowspan="3" style="width:32px"
                                  valign="top"&gt;
                              &lt;/xp:td&gt;
                              &lt;xp:td&gt;
                                  &lt;xp:text escape="true"
                                      style="font-size:8pt;font-family:Arial;color:rgb(128,128,128);margin-right:10.0px"
                                      id="dataAuthor"&gt;
                                      &lt;xp:this.converter&gt;
                                          &lt;xp:convertDateTime
                                              type="date"&gt;
                                          &lt;/xp:convertDateTime&gt;
                                      &lt;/xp:this.converter&gt;
                                      &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:var document : NotesDocument = row.getDocument();
  return @Name('[CN]',document.getItemValue('Author'))}]]&gt;&lt;/xp:this.value&gt;
                                  &lt;/xp:text&gt;
                                  &lt;xp:text id="dataCreated"
                                      style="font-size:8pt;color:rgb(128,128,128)"&gt;
                                      &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:try{
      var document : NotesDocument = row.getDocument();
      var date : NotesDateTime = document.getItemValue('Created' )[0];
      var Today:NotesDateTime = session.createDateTime("Today");
      Today.setNow();
      if ( (Today.timeDifference(date) / 86400).toFixed(0) != 0) 
          {return date.toJavaDate()}
      else
          {return translateString('Today') +'  '+ @LeftBack(date.getTimeOnly(),6)}
  } catch (e){}}]]&gt;&lt;/xp:this.value&gt;
                                      &lt;xp:this.converter&gt;
                                          &lt;xp:convertDateTime
                                              pattern="dd.MM.yyyy HH.mm"&gt;
                                          &lt;/xp:convertDateTime&gt;
                                      &lt;/xp:this.converter&gt;
                                  &lt;/xp:text&gt;
                              &lt;/xp:td&gt;
                          &lt;/xp:tr&gt;
                          &lt;xp:tr&gt;
                              &lt;xp:td rowspan="2" valign="top"&gt;
                                  &lt;xp:text escape="false" id="messageBody"
                                      value="#{documentMessage.Body}"&gt;
                                  &lt;/xp:text&gt;
                              &lt;/xp:td&gt;
                          &lt;/xp:tr&gt;
                          &lt;xp:tr&gt;
                          &lt;/xp:tr&gt;
                          &lt;xp:tr&gt;
                              &lt;xp:td&gt;&lt;/xp:td&gt;
                              &lt;xp:td&gt;
                              &lt;xp:link
                                      text="#{javascript:translateString('CreateResponse')}"
                                      id="MessageResponse" style="font-size:8pt;margin-right:10.0px"
                                      escape="true"&gt;
                                      &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:var docChannal : NotesDocument = database.getDocumentByUNID(sessionScope.get("Channal"));
  return ! @IsNotMember(@UserName() ,docChannal.getItemValue("MessageReplyCreate"))  || docChannal.getItemValueString("MessageReplyCreate")==""}]]&gt;&lt;/xp:this.rendered&gt;
                                      &lt;xp:eventHandler event="onclick"
                                          submit="true" refreshMode="partial"
                                          refreshId="inPlaceFormMessageResponse" id="eventHandler1"&gt;
                                          &lt;xp:this.action&gt;
                                              &lt;xp:actionGroup
                                                  condition="#{javascript:true //!viewScope.containsKey('Response')}"&gt;
                                                  &lt;xp:executeScript&gt;
                                                      &lt;xp:this.script&gt;&lt;![CDATA[#{javascript:   
       viewScope.put('Response',row.getNoteID());
       var c = getComponent("inPlaceFormMessageResponse");
  c.toggle()
  }]]&gt;&lt;/xp:this.script&gt;
                                                  &lt;/xp:executeScript&gt;
                                              &lt;/xp:actionGroup&gt;
                                          &lt;/xp:this.action&gt;
                                      &lt;/xp:eventHandler&gt;
                                  &lt;/xp:link&gt;
                              &lt;/xp:td&gt;
                          &lt;/xp:tr&gt;
                      &lt;/xp:table&gt;
                      &lt;xe:inPlaceForm id="inPlaceFormMessageResponse"
                          partialEvents="true"&gt;
                          &lt;xp:panel&gt;
                              &lt;xp:this.data&gt;
                                  &lt;xp:dominoDocument
                                      var="documentMessageResponseCreate" formName="Message"
                                      parentId="#{javascript:row.getNoteID()}"
                                      computeWithForm="onsave" scope="view"&gt;
                                  &lt;xp:this.postNewDocument&gt;
                                          &lt;xp:actionGroup&gt;
                                              &lt;xp:this.condition&gt;&lt;![CDATA[#{javascript:return currentDocument.isNewNote() &amp;&amp; currentDocument.isResponse()}]]&gt;&lt;/xp:this.condition&gt;
                                              &lt;xp:modifyField name="Read"
                                                  var="currentDocument"&gt;
                                                  &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:database.getDocumentByID(currentDocument.getParentId()).getItemValue("Read")}]]&gt;&lt;/xp:this.value&gt;
                                              &lt;/xp:modifyField&gt;
                                          &lt;/xp:actionGroup&gt;
                                      &lt;/xp:this.postNewDocument&gt;
                                  &lt;/xp:dominoDocument&gt;
                              &lt;/xp:this.data&gt;
                              &lt;xp:table id="table2"&gt;
                                  &lt;xp:this.style&gt;&lt;![CDATA[#{javascript:"width: calc(100% - "+(row.getColumnIndentLevel()*32+32).toString()+"px); margin-left:"+(row.getColumnIndentLevel()*32+32).toString()+"px;"}]]&gt;&lt;/xp:this.style&gt;
                                  &lt;xp:tr&gt;
                                      &lt;xp:td&gt;
                                          &lt;xp:inputRichText
                                              id="inputRichText1"
                                              value="#{documentMessageResponseCreate.Body}"&gt;
                                              &lt;xp:this.dojoAttributes&gt;
                                                  &lt;xp:dojoAttribute
                                                      name="autoGrow_minHeight" value="50"&gt;
                                                  &lt;/xp:dojoAttribute&gt;
                                              &lt;/xp:this.dojoAttributes&gt;
                                          &lt;/xp:inputRichText&gt;
                                      &lt;/xp:td&gt;
                                  &lt;/xp:tr&gt;
                                  &lt;xp:tr&gt;
                                      &lt;xp:td&gt;
                                          &lt;xp:button
                                              value="#{javascript:translateString('Send')}"
                                              id="CreateMessageResponse" style="margin-right:10.0px"&gt;
                                              &lt;xp:eventHandler
                                                  event="onclick" submit="true" refreshMode="partial"
                                                  id="eventHandler3" refreshId="viewRepeatMessage"&gt;
                                                  &lt;xp:this.action&gt;
                                                      &lt;xp:actionGroup&gt;
                                                          &lt;xp:saveDocument
                                                              var="documentMessageResponseCreate"&gt;
                                                          &lt;/xp:saveDocument&gt;
                                                          &lt;xp:executeScript&gt;
                                                              &lt;xp:this.script&gt;&lt;![CDATA[#{javascript:var Agent : NotesAgent;
  var NoteID : string;
  var AgentName : string;
  AgentName = '(CreateEvent'+currentDocument.getDocument().getItemValueString('Form')+'Create)';
  NoteID = currentDocument.getNoteID();
      Agent = database.getAgent(AgentName);
      if(Agent != null){
        Agent.runOnServer(NoteID);      
      }
  }]]&gt;&lt;/xp:this.script&gt;
                                                          &lt;/xp:executeScript&gt;
                                                          &lt;xp:executeScript&gt;
                                                              &lt;xp:this.script&gt;&lt;![CDATA[#{javascript:viewScope.remove('Response');
  database.getView("(xpMessage)").refresh();
  var c = getComponent("inPlaceFormMessageResponse")
  c.hide()
  }]]&gt;&lt;/xp:this.script&gt;
                                                          &lt;/xp:executeScript&gt;
                                                      &lt;/xp:actionGroup&gt;
                                                  &lt;/xp:this.action&gt;
                                              &lt;/xp:eventHandler&gt;
                                          &lt;/xp:button&gt;
                                      &lt;/xp:td&gt;
                                  &lt;/xp:tr&gt;
                              &lt;/xp:table&gt;
                          &lt;/xp:panel&gt;
                      &lt;/xe:inPlaceForm&gt;
                  &lt;/xp:panel&gt;
              &lt;/xp:repeat&gt;
              &lt;xp:div style="text-align:center"&gt;
                  &lt;xe:pagerAddRows id="pagerAddRowsMessage"
                      text="#{javascript:translateString('ShowMore')}"
                      disabledFormat="hide" refreshPage="true" for="viewRepeatMessage"&gt;
                  &lt;/xe:pagerAddRows&gt;
              &lt;/xp:div&gt;
          &lt;/xp:panel&gt;
      &lt;/xp:panel&gt;
  &lt;/xp:view&gt;
  </code></pre>
  
  <p>Thanks for any help!</p>
  
  <p><strong>Create response forms with a text</strong> 
  <a href="https://i.stack.imgur.com/fhLo0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fhLo0.jpg" alt=" "></a></p>
  
  <hr>
  
  <p><strong>Save Main Form. InLine form response with text "1-resp=1" move Up and stay under just created Main doc (not under doc with text "1")</strong>
  <a href="https://i.stack.imgur.com/jurtP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jurtP.jpg" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>Save 1-resp=1</strong>
  <a href="https://i.stack.imgur.com/FDqos.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDqos.jpg" alt="enter image description here"></a></p>
  
  <hr>