开发者

How often will calculate works in Orbeon Xforms

I have a bind definition as follows:

<xforms:bind nodeset="instance('demo')/pointer"
                        type="xforms:integer"
                        calculate="
                        if($current-page &lt; '2') then '0'
                            else (
                            if($current-page &gt; '2') 
                            then ($max-pages - 1)
                            else .
                            )"/>

For every user click on the form, the current-page value changes. I wanted to understand how often does the calculate in the above the bind defnition execute?

The problem is that the pointer variable and current-page are dependent on each other, so if I click on something first, the value of pointer should be 开发者_Go百科evaluated immediately and in the next instruction I have to set the current-page value based on the pointer value that is changed. On the click, the code will be as below:

<xforms:setvalue ref="$pointer"
                 value="($pointer + 1)"/>
<!-- i am assuming if the current-page is 2,
     it will increment, else the value is set as per calculate -->
<xforms:setvalue ref="$current-page"
                 value="($current-page + 1)"
                 xxforms:if="($pointer = $max-pages)" />


  • When users click on the button (assuming it is a button) that trigger the two xforms:setvalue, those xforms:setvalue run first and the xforms:bind calculate runs later.
  • Pretty much all users' interaction with the form will cause the xforms:bind calculate to be be reevaluated.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜