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

类别:.NET开发 点击:0 评论:0 推荐:

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>  

本文地址:http://com.8s8s.com/it/it44084.htm