W3C home > Mailing lists > Public > www-forms@w3.org > March 2005

Re: xforms:choose/if?

From: Alexander Anokhin <ava@vaz.ru>
Date: Thu, 31 Mar 2005 09:30:09 +0500
Message-ID: <424B7CD1.7070103@vaz.ru>
To: www-forms@w3.org

Alessandro Vernet wrote:
> Hi Alexander,
> 
> Could you clarify what you mean by "Now i need to do something (toggle
> some switch, send some data somewhere, etc..) depends on received
> number."?
> 
> You can compute the integer with a bind/calculate and store it in the
> instance.

My integer is an sql count(*) operation result from database, for
example and i can't compute it locally.

   Then if you want to display or hide something in the view based
> on that he can use a bind/relevant. But I am not sure this is what you are
> looking for.

I don't wand to show/hide something (with CSS & bind/relevant) but do
some action. The wanted feature like in XSLT:

<xforms:action ev:event="DOMActivate">
      <xforms:choose>
          <xforms:when test="instance('first_step')//count_result = 0">
              <xforms:send submission="ws_1"/>
          </xforms:when test="instance('first_step')//count_result = 1">
          <xforms:when test="instance('first_step')">
              <xforms:send submission="ws_2"/>
          </xforms:when>
          <xforms:otherwise">
              <xforms:toggle case="case3"/>
          </xforms:otherwise>
       </xforms:choose>
</xforms:action>

   Just let us know, so people on the list can elaborate
> further.

Thanx for answer anyway and sorry for my casual english.


> --- Alexander Anokhin <ava@vaz.ru> wrote:
> 
>>Hi, all...
>>Q: How can i achieve some kind of "choose/if" functionality in XForms?
>>The use case is:
>>1. User input some data and press "Proceed";
>>2. XForms send it to server (with replace="instance");
>>3. The answer is a some integer number;
>>4. Now i need to do something (toggle some switch, send some data 
>>somewhere, etc..) depends on received number.
>>
>>Is it possible?

-- 
Alexander Anokhin
AVTOVAZ JSC
email: ava@vaz.ru
icq: 123275798
Received on Thursday, 31 March 2005 04:35:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:00 GMT