CSDN博客

img Victor518

理解XForm——学习IBM DW的资料 (4)

发表于2004/9/15 13:51:00  1032人阅读

分类: XML

1、动态改变表单的字段

如增加、删除或修改表单的一个或一些字段,通过 XForm的Trigger元素中嵌入delete、add、setvalue属性来实现:

<xforms:trigger>  
  <xforms:label>Remove current item</xforms:label>  
  <xforms:delete event="xforms-activate" nodeset="order/soaps/item"     
            at="index('soaplist')"/>  
</xforms:trigger>
<xforms:trigger>  
  <xforms:label>Add an item</xforms:label>  
  <xforms:action event="xforms-activate">  
    <xforms:insert nodeset="order/soaps/item" at="index('soaplist')"
            position="after"/>  
    <xforms:setvalue ref="order/soaps/item[index('soaplist')]/
            qty">0</xforms:setvalue>

    <xforms:setvalue ref="order/soaps/item[index('soaplist')]/
            flavor">P</xforms:setvalue> 
    <xforms:setvalue  
            ref="order/soaps/item[index('soaplist')]/
                unitprice">2.50</xforms:setvalue> 
    <xforms:setvalue  
            ref="order/soaps/item[index('soaplist')]/
                totalprice">0.00</xforms:setvalue> 
  </xforms:action>  
</xforms:trigger>  

0 0

相关博文

我的热门文章

img
取 消
img