如何将dojo确认对话框合并到xslt转换中?

如何将dojo确认对话框合并到xslt转换中?,xslt,dialog,dojo,confirm,Xslt,Dialog,Dojo,Confirm,底线是我需要一个(dojo)确认是非对话框,我需要在xsl代码中使用它 我的想法是使用xslt转换生成两个按钮,第一个是编辑,第二个是删除。后者应打开确认对话框。 下面是我用来创建这些按钮的xsl代码 <xsl:template match="report:submit-button"> <script type="text/javascript">require(["dojo/parser", "dijit/form/Button"]);</sc

底线是我需要一个(dojo)确认是非对话框,我需要在xsl代码中使用它

我的想法是使用xslt转换生成两个按钮,第一个是编辑,第二个是删除。后者应打开确认对话框。 下面是我用来创建这些按钮的xsl代码

 <xsl:template match="report:submit-button">
        <script type="text/javascript">require(["dojo/parser", "dijit/form/Button"]);</script>

        <button type="submit" data-dojo-type="dijit/form/Button">
            <xsl:if test="@name">
                <xsl:attribute name="name">
                    <xsl:value-of select="@name"/>
                </xsl:attribute>
            </xsl:if>

            <xsl:if test="@value">
                <xsl:attribute name="value">
                    <xsl:value-of select="@value"/>
                </xsl:attribute>
            </xsl:if>

        </button>
    </xsl:template>

require([“dojo/parser”,“dijit/form/Button”]);
我对dojo真的很陌生,但是我找到了一些教程,所以我有下面的代码

<div>
    <div class="dijitDialogPaneContentArea">
        Please confirm if you would like to delete the selected ${message}. <p/>
        This operation cannot be undone.
    </div>

    <div class="dijitDialogPaneActionBar">
        <button data-dojo-type="dijit/form/Button" type="submit" >OK</button>
        <button data-dojo-type="dijit/form/Button" type="button" >Cancel</button>
    </div>
</div>

var myWidget = new MyWidget({
  message: "Member"
});

var myDialog4 = new Dialog({
  title: "My Dialog 4",
  content: myWidget
});

myDialog4.show();

请确认是否要删除选定的${message}

此操作无法撤消。 好啊 取消 var myWidget=newmywidget({ 信息:“成员” }); var myDialog4=新建对话框({ 标题:“我的对话4”, 内容:myWidget }); myDialog4.show();

我的问题是如何将dojo合并到xsl代码中?如果它是一个简单而简短的javascipt函数,比如alert()或confirm,那么我会添加另一个值为“onclick”的属性,如下所示:

<xsl:if test="@verifyPopUp">
     <xsl:attribute name="onclick">
         var c = confirm("Please confirm deleting this item");                 
      </xsl:attribute>
</xsl:if>

var c=确认(“请确认删除此项目”);

但上面这段冗长的dojo代码似乎并不适合这种情况。任何建议都会收到。

我不太清楚,在上面的示例中,您有两个按钮,但在dojo示例中,您显示的是一个dojo对话框。您是否尝试获取2个按钮,然后在单击时执行操作?或者你想要一个dojo对话框我有两个普通的按钮。其中之一是“删除”。另一个是不相关的。如果有人点击“删除”,将会出现一个dojo确认对话框,其中有两个全新的按钮;“是,我想删除”和“不,不要删除”