1

肝心なのは、(dojo) 確認の yes-no ダイアログが必要であり、それを xsl コード内で使用する必要があるということです。

アイデアは、xslt 変換を使用して 2 つのボタンを生成することです。1 つ目は編集、2 つ目は削除です。後者は確認ダイアログを開く必要があります。これらのボタンを作成するために使用する 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>

私は道場に本当に慣れていませんが、いくつかのチュートリアルを見つけたので、以下のコードを持っています。

<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();

私の質問は、dojo を xsl コードに組み込む方法ですか? alert() や confirm のような単純で短い javascipt 関数の場合、次のように「onclick」の値を持つ別の属性を追加します。

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

しかし、上記の長くてややこしい道場コードは、それに完全に適合していないようです。どんなアドバイスも適用されます。

4

0 に答える 0