bind not working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bind not working

Ronthe

Hello,

 

A bind statement is not working. The SB-code I’m using:

<html xmlns="http://www.w3.org/1999/xhtml"

    xmlns:xforms="http://www.w3.org/2002/xforms">

    <head>

        <title>Hello World XForms</title>

        <xforms:model>

            <xforms:instance >

                <somedate xmlns=""/>

            </xforms:instance>

            <bind

                nodeset="/somedate"

                constraint="matches(normalize-space(.), '^\d{4}/\d{2}/\d{2}$')" />

            </xforms:model>

    </head>

    <body>

        <p>

            Please enter date:

            <xforms:input ref="/somedate" incremental="true" />

        </p>

        <p>

            <xforms:output value="if (matches(normalize-space(.), '^\d{4}/\d{2}/\d{2}$')) then 'ok' else 'fout'"/>

        </p>

    </body>

</html>

 

The date should have the format “yyyy/mm/dd”. The output-statement is working (prints “ok” when date has correct format), but the bind is not: no error (ie red background) is indicated in the input box.

What is wrong with the above code?

 

Gts,

Ronny



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: bind not working

Erik Bruchez
Administrator
Ronny,

Shouldn't you be using <xforms:bind> instead of just <bind>?

-Erik

Ronny Theunissen wrote:

> Hello,
>
>  
>
> A bind statement is not working. The SB-code I’m using:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>
>     xmlns:xforms="http://www.w3.org/2002/xforms">
>
>     <head>
>
>         <title>Hello World XForms</title>
>
>         <xforms:model>
>
>             <xforms:instance >
>
>                 <somedate xmlns=""/>
>
>             </xforms:instance>
>
>             <bind
>
>                 nodeset="/somedate"
>
>                 constraint="matches(normalize-space(.),
> '^\d{4}/\d{2}/\d{2}$')" />
>
>             </xforms:model>
>
>     </head>
>
>     <body>
>
>         <p>
>
>             Please enter date:
>
>             <xforms:input ref="/somedate" incremental="true" />
>
>         </p>
>
>         <p>
>
>             <xforms:output value="if (matches(normalize-space(.),
> '^\d{4}/\d{2}/\d{2}$')) then 'ok' else 'fout'"/>
>
>         </p>
>
>     </body>
>
> </html>
>
>  
>
> The date should have the format “yyyy/mm/dd”. The output-statement is
> working (prints “ok” when date has correct format), but the bind is not:
> no error (ie red background) is indicated in the input box.
>
> What is wrong with the above code?
>
>  
>
> Gts,
>
> Ronny
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: bind not working

Hank Ratzesberger
In reply to this post by Ronthe
 
Instance elements must have a single child element it's true,
but all the examples I have seen use it as a root element, so 
maybe it's worth a try to ...
 
<xforms:instance>
  <root xmlns="">
    <somedate/>
  </root>
</xforms:instance> 
 
Or, I wonder if the input needs an <xforms:alert> element for the exclamation
mark to show?
 
Cheers,
Hank
 
Hank Ratzesberger
University of California, Santa Barbara
----- Original Message -----
Sent: Thursday, January 11, 2007 7:10 AM
Subject: [ops-users] bind not working

Hello,

 

A bind statement is not working. The SB-code I’m using:

<html xmlns="http://www.w3.org/1999/xhtml"

    xmlns:xforms="http://www.w3.org/2002/xforms">

    <head>

        <title>Hello World XForms</title>

        <xforms:model>

            <xforms:instance >

                <somedate xmlns=""/>

            </xforms:instance>

            <bind

                nodeset="/somedate"

                constraint="matches(normalize-space(.), '^\d{4}/\d{2}/\d{2}$')" />

            </xforms:model>

    </head>

    <body>

        <p>

            Please enter date:

            <xforms:input ref="/somedate" incremental="true" />

        </p>

        <p>

            <xforms:output value="if (matches(normalize-space(.), '^\d{4}/\d{2}/\d{2}$')) then 'ok' else 'fout'"/>

        </p>

    </body>

</html>

 

The date should have the format “yyyy/mm/dd”. The output-statement is working (prints “ok” when date has correct format), but the bind is not: no error (ie red background) is indicated in the input box.

What is wrong with the above code?

 

Gts,

Ronny




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: bind not working

Ronthe
In reply to this post by Ronthe
Erik,

Yes, of course, you're right.
Sorry for that, guess I must have been sleeping.

Gts,
Ronny

-----Oorspronkelijk bericht-----
Van: Erik Bruchez [mailto:[hidden email]] Namens Erik Bruchez
Verzonden: Thursday, January 11, 2007 4:54 PM
Aan: [hidden email]
Onderwerp: Re: [ops-users] bind not working

Ronny,

Shouldn't you be using <xforms:bind> instead of just <bind>?

-Erik

Ronny Theunissen wrote:

> Hello,
>
>  
>
> A bind statement is not working. The SB-code I'm using:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>
>     xmlns:xforms="http://www.w3.org/2002/xforms">
>
>     <head>
>
>         <title>Hello World XForms</title>
>
>         <xforms:model>
>
>             <xforms:instance >
>
>                 <somedate xmlns=""/>
>
>             </xforms:instance>
>
>             <bind
>
>                 nodeset="/somedate"
>
>                 constraint="matches(normalize-space(.),
> '^\d{4}/\d{2}/\d{2}$')" />
>
>             </xforms:model>
>
>     </head>
>
>     <body>
>
>         <p>
>
>             Please enter date:
>
>             <xforms:input ref="/somedate" incremental="true" />
>
>         </p>
>
>         <p>
>
>             <xforms:output value="if (matches(normalize-space(.),
> '^\d{4}/\d{2}/\d{2}$')) then 'ok' else 'fout'"/>
>
>         </p>
>
>     </body>
>
> </html>
>
>  
>
> The date should have the format "yyyy/mm/dd". The output-statement is
> working (prints "ok" when date has correct format), but the bind is
not:

> no error (ie red background) is indicated in the input box.
>
> What is wrong with the above code?
>
>  
>
> Gts,
>
> Ronny
>
>
>
------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the
[hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws