Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpages 如何在“重复控制”中保存在线编辑的文档中的值_Xpages_Repeat_Inline Editing - Fatal编程技术网

Xpages 如何在“重复控制”中保存在线编辑的文档中的值

Xpages 如何在“重复控制”中保存在线编辑的文档中的值,xpages,repeat,inline-editing,Xpages,Repeat,Inline Editing,我在xPage上有一个repeat控件,在编辑模式下直接显示一个文本字段。当用户更改字段中的值时,我需要他们能够: 选择字段旁边的图标以将值保存在文档中 在多个文档中对此字段进行更改,然后单击按钮将所有这些更改保存到同时保存的相应文档中 到目前为止,我所拥有的是一种捕获其可编辑字段已更新的文档的UNID的方法 我无法使这两种保存都起作用。我在下面列出了控制这些区域的代码部分 这是全部保存和会话范围信息 <xp:panel id="InlineEditContainer" xp:key="f

我在xPage上有一个repeat控件,在编辑模式下直接显示一个文本字段。当用户更改字段中的值时,我需要他们能够:

  • 选择字段旁边的图标以将值保存在文档中
  • 在多个文档中对此字段进行更改,然后单击按钮将所有这些更改保存到同时保存的相应文档中
  • 到目前为止,我所拥有的是一种捕获其可编辑字段已更新的文档的UNID的方法

    我无法使这两种保存都起作用。我在下面列出了控制这些区域的代码部分

    这是全部保存和会话范围信息

    <xp:panel id="InlineEditContainer" xp:key="facetMiddle" style="width:100%">
    <xp:this.data>
    <xp:dominoView var="view1" viewName="vwMetricsByAssigned">
    <xp:this.postOpenView><![CDATA[#{javascript:var myList = new java.util.ArrayList();
    sessionScope.put("myList", myList);}]]></xp:this.postOpenView></xp:dominoView>
    </xp:this.data>
    <xp:button value="Submit All" id="button1">
    <xp:eventHandler event= <"onclick" submit="true" refreshMode="complete">
    <xp:this.action><![CDATA[#{javascript:// Getting list of unids from docs which have been        updated, and saving those docs
    var db:NotesDatabase
    
    if(sessionScope.myList == null){
    return;
    }else{
    for (var s in sessionScope.myList){
        var doc:NotesDocument = (db ? db.getDocumentByUNID(s) : database.getDocumentByUNID(s));
        if (doc && doc.isValid()) { 
            doc.save();
        }
    }
    }}]]></xp:this.action>
                    </xp:eventHandler>
                </xp:button>
                <xp:br></xp:br>
    <xp:repeat id="repeat1" rows="30" value="#{sessionScope.myList}" var="listData">        
        <xp:text escape="true" id="computedField6"><xp:this.value><![CDATA[#{javascript:listData +    " , "}]]></xp:this.value></xp:text></xp:repeat>
    
    <xp:br></xp:br>
    
    
    
    这是所有重复数据

    <xp:repeat id="repeat2" rows="20" var="FColl" indexVar="idx" value="#{javascript:view1}">
    <xp:panel id="InlineEditContainer2">
    <xp:this.data>
    <xp:dominoDocument var="document1" formName="frmMetricData"                                  action="editDocument" documentId="#    {javascript:FColl.getNoteID();}" >
    </xp:dominoDocument>
    </xp:this.data>
    <xp:tr>
    <xp:td id="td1">
    
    <xp:text escape="true" id="computedField3">
    <xp:this.value>    <![CDATA[#javascript:FColl.getDocument().getItemValueString("BusinessUnit")}]]>   
    </xp:this.value>
    </xp:text>
    </xp:td>
    <xp:td id="td2">
    <xp:link escape="true" id="link1" value="/MetricData.xsp">
    <xp:this.text><![CDATA[#{javascript:FColl.getDocument().getItemValueString("MetricName")}]]>  </xp:this.text>
    <xp:eventHandler event="onclick" submit="true"                                            refreshMode="norefresh" immediate="true">
    <xp:this.action>
    <xp:openPage name="/MetricData.xsp" target="editDocument"                              documentId="#{javascript:return FColl.getNoteID();}" />
    </xp:this.action></xp:eventHandler>
    </xp:link>
    </xp:td>
    <xp:td id="td3">
    <xp:inputText id="EditBox3" value="#{document1.Actual}" tabindex="1">
    <xp:this.defaultValue><![CDATA[#    {javascript:FColl.getDocument().getItemValueString("Actual")}]]></xp:this.defaultValue>
    <xp:this.converter>
    <xp:convertNumber type="number" integerOnly="true" />
    </xp:this.converter>
    <xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="repeat1">
    <xp:this.action><![CDATA[#{javascript:// get the universalID of the document
    var keyCode = FColl.getDocument().getUniversalID();
    
    // Create an Array
    var myArray = sessionScope.get("myList");
    
    //If it's not already in the Array then add it.
    if (!myArray.contains(keyCode)) {
    myArray.add(keyCode);
    }}]]></xp:this.action>
    </xp:eventHandler></xp:inputText>
    <xp:span>
    <xp:image url="/.ibmxspres/domino/oneuiv2/images/iconConfirmation16.png" id="image1">
    <xp:eventHandler event="onclick" submit="true"                                               refreshMode="complete">
    <xp:this.action>
    <xp:saveDocument var="document1" />
    </xp:this.action>
    </xp:eventHandler>
    </xp:image>
    </xp:span>
    
    
    
    简单点!有一个简单的动作“保存”。保存和保存所有口味。后者位于“重复”下方并保存任何更改的文档

    事实证明,我对其中两个按钮进行了全面更新,这需要为其他元素(如行)提供ID,这很有帮助。现在我可以通过UNID获取文档,但无法获取更改的值。这是因为,似乎没有保存文档,因为后端认为没有发生更改。所以我试图抓住改变了的前端值。实际上,我甚至无法获取后端值,这很奇怪。