Xpages 寻找xpage上签名按钮的最佳方法

Xpages 寻找xpage上签名按钮的最佳方法,xpages,Xpages,我需要一个简单的按钮,用户点击该按钮在文档上签字。每个文档只有一个签名者,但当他们单击它时,会将他们的姓名和日期放在两个可见字段中,并更改状态字段 最好的方法是什么?这可能非常简单,但由于某些原因,我无法让它工作 此时他们已被迫登录 提前谢谢 Matt请尝试以下操作: <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core">

我需要一个简单的按钮,用户点击该按钮在文档上签字。每个文档只有一个签名者,但当他们单击它时,会将他们的姓名和日期放在两个可见字段中,并更改状态字段

最好的方法是什么?这可能非常简单,但由于某些原因,我无法让它工作

此时他们已被迫登录

提前谢谢

Matt

请尝试以下操作:

    <?xml version="1.0" encoding="UTF-8"?>
    <xp:view xmlns:xp="http://www.ibm.com/xsp/core">
        <xp:this.data>
            <xp:dominoDocument var="document1" formName="test"></xp:dominoDocument>
        </xp:this.data>
        <xp:panel id="panelMain">
            <xp:table>
                <xp:tr>
                    <xp:td colspan="2">
                        <xp:label value="Main Form" id="label1"></xp:label>
                    </xp:td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:100.0px">
                        <xp:label value="Now" id="label2"></xp:label>
                    </xp:td>
                    <xp:td>
                        <xp:text escape="true" id="computedField1" value="${javascript:return @Now();}">
                            <xp:this.converter>
                                <xp:convertDateTime type="both"></xp:convertDateTime>
                            </xp:this.converter>
                        </xp:text>
                    </xp:td>
                </xp:tr>
            </xp:table>
        </xp:panel>
        <xp:panel id="panelSignature" style="background-color:rgb(192,192,192)">
            <xp:button value="I Agree" id="button1">
                <xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="SignatureTable">
                    <xp:this.action><![CDATA[#{javascript:
    document1.replaceItemValue("SignedDate",@Now());
    document1.replaceItemValue("SignedBy",userBean.getDisplayName());}]]></xp:this.action>
                </xp:eventHandler>
            </xp:button>
            <xp:table id="SignatureTable">
                <xp:tr>
                    <xp:td colspan="2">
                        <xp:label value="SignatureTable" id="label3"></xp:label>
                    </xp:td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:100.0px">
                        <xp:label value="SignedBy" id="label6"></xp:label>
                    </xp:td>
                    <xp:td>
                        <xp:inputText id="computedField4" value="#{document1.SignedBy}" readonly="true"></xp:inputText>
                    </xp:td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:100.0px">
                        <xp:label value="SignedDate" id="label5"></xp:label>
                    </xp:td>
                    <xp:td>
                        <xp:inputText id="computedField3" value="#{document1.SignedDate}" readonly="true">
                            <xp:this.converter>
                                <xp:convertDateTime type="both"></xp:convertDateTime>
                            </xp:this.converter>
                        </xp:inputText>
                    </xp:td>
                </xp:tr>
            </xp:table>
        </xp:panel>
    </xp:view>

从这一点来看,他们已经被迫在这个时候登录。您的问题在ACL中。看起来,您允许匿名读取文档,但在您想要保存文档的时候,ACL不允许匿名用户这样做,所以Domino要求他们提供身份


将匿名访问设置为无访问级别。

这里有一个按钮,但如果用户未登录并且没有匿名编辑访问权限,则会出现登录对话框。对于签名功能,我假设用户必须登录才能签名。document1是要签名的Xpage数据文档

    <xp:button
        value="Sign"
        id="button1"
        styleClass="btn btn-primary">
        <xp:eventHandler
            event="onclick"
            submit="true"
            refreshMode="complete">
                <xp:this.action>
                    <xp:executeScript>
                        <xp:this.script><![CDATA[#{javascript:
                        document1.appendItemValue("SignerName", session.getEffectiveUsername();
                        document1.document1("SignedDate",       session.createDateTime(@Now()));
                        document1.save();                                       
                    }]]></xp:this.script>
                </xp:executeScript>
            </xp:this.action>
        </xp:eventHandler>
    </xp:button>

如果您需要在不登录的情况下更新文档,则在按钮中,您必须使用sessionAsSigner获取文档,然后进行更新。

到目前为止您尝试了什么?向我们展示一些我们可以评论的代码:-解决这个问题的一种方法是直接在文档上下文/bean中设置字段并重新加载/刷新页面。所以你就不必处理编辑模式了…对不起,伙计们…昨天不是个好日子。事实上,这很简单,一旦我再看一遍,我就可以很容易地工作了。但谢谢你的回应。非常感谢你,保罗……今天学到了一些新东西,但用户bean并不知道它的存在。我让它工作得很好。我很感激大家在我越来越适应这一切的时候帮助我。不客气。。。顺便说一句,为了这个和未来,最好检查一下解决你问题的答案。。。帮助其他读者和海报获得分数;