xforms:alert/ xforms:message

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

xforms:alert/ xforms:message

Merin Shaji
Hi,

I am trying to display error message pop ups using XForms to display client side validation messages similar to Javascript alerts. I tried <xf:message> and <xf:alert>. Both didn't work.

I want to display an error message when the user types something in a text box (<xf:input>) and takes the focus out of that text box(DomFocusOut). For example, I want to display the text "Please enter a positive integer" when the focus is changed from the text box. I have given <xf:bind> for that text box reference. It shows a red exclamation mark for invalid entries. But I want to display my custom text as well.


I tried <xf:message>. It worked for only one case - when I entered a string instead of a positive integer and clicked inside the same window(not on any controls like text boxes) using the mouse. It is not working when I move to the next control using Tab. Again it is not working when I entered negative numbers.

This is my <xf:bind> tag:

<xf:bind nodeset="myField" type="xs: positiveInteger"/>

and this is my <xf:input> tag:

<xf:input ref="myField">
<xf:label>The field:</xf:label>
<xf:message level="modal" ev:event="xforms-invalid">
Please enter a positive integer
</xf:message>
</xf:input>

I got to know that these bugs are Orbeon specific. These are working fine with Mozilla XForms engine. Why such inconsistencies? Is there any work around? So please suggest the best method for client side validations which display pop up messages on DOMFocusOut.

Many Thanks
Merin



--
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: xforms:alert/ xforms:message

Merin Shaji
An update on my research...........

Today I created a separate schema (.xsd file) and gave its reference in my <xforms:model> tag using the schema attribute. Then I got the negative integer check working. That is, now it displays an error message when I enter a negative value for a field which has the positiveInteger constraint. This happens only when I click on the window outside all the controls just after typing in that particular text box. DOMFocusOut by pressing tab key also is not working. In short, the only difference from yesterday's situation is that I got the negative number validation working when I used a separate xsd file for validation.

Anticipating your valuable suggestions.

Thanks & Regards
Merin




--
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: xforms:alert/ xforms:message

Alessandro  Vernet
Administrator
In reply to this post by Merin Shaji
Hi Merin,

I created an XHTML+XForms file that run in the sandbox with code very
similar to yours. Have a look at it and see what is different in your
file. One possible source for the problem is the space between "xs:"
and "positiveInteger", but that might just be something in your email.

I hope this will help,

Alex

On 6/1/06, [hidden email] <[hidden email]> wrote:

> Hi,
>
> I am trying to display error message pop ups using XForms to display client side validation messages similar to Javascript alerts. I tried <xf:message> and <xf:alert>. Both didn't work.
>
> I want to display an error message when the user types something in a text box (<xf:input>) and takes the focus out of that text box(DomFocusOut). For example, I want to display the text "Please enter a positive integer" when the focus is changed from the text box. I have given <xf:bind> for that text box reference. It shows a red exclamation mark for invalid entries. But I want to display my custom text as well.
>
>
> I tried <xf:message>. It worked for only one case - when I entered a string instead of a positive integer and clicked inside the same window(not on any controls like text boxes) using the mouse. It is not working when I move to the next control using Tab. Again it is not working when I entered negative numbers.
>
> This is my <xf:bind> tag:
>
> <xf:bind nodeset="myField" type="xs: positiveInteger"/>
>
> and this is my <xf:input> tag:
>
> <xf:input ref="myField">
> <xf:label>The field:</xf:label>
> <xf:message level="modal" ev:event="xforms-invalid">
> Please enter a positive integer
> </xf:message>
> </xf:input>
>
> I got to know that these bugs are Orbeon specific. These are working fine with Mozilla XForms engine. Why such inconsistencies? Is there any work around? So please suggest the best method for client side validations which display pop up messages on DOMFocusOut.
>
> Many Thanks
> Merin
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/


--
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

merin.xhtml (2K) Download Attachment
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: xforms:alert/ xforms:message

Merin Shaji
Hi Alex,

I copied the code which you had sent. It is displaying the error message (xforms:message) when I enter a char string instead of a positive integer. But when I enter a negative number its not working. I am using OXF Studio for Eclipse (version 1.2.2).

Tabs is also not working properly. Its working fine in the example which you had sent because there is only one input control. I added one more text box. Then when I pressed tab key from the first text box (after entering some invalid input) the message for invalid inputs does not pop up. I understand that this happens because control is moved to the 2nd text box.

Here is my example code:

<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:f="http://orbeon.org/oxf/xml/formatting"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
        xmlns:widget="http://orbeon.org/oxf/xml/widget"
        xmlns:ev="http://www.w3.org/2001/xml-events"
        xmlns:xs="http://www.w3.org/2001/XMLSchema">
     
    <xhtml:head>
        <xhtml:title>Lead Details</xhtml:title>
        <xforms:model>
            <xforms:instance id="main">
                <form>
                    <age/>
                    <nationality/>
                </form>
            </xforms:instance>

           <xforms:bind nodeset="instance('main')/age" type="xs:positiveInteger"/>
               
            <xforms:submission id="save-details" method="post" action="/add-new-lead" ref ="instance('main')"/>
        </xforms:model>
       
    </xhtml:head>
   
<xhtml:body>
                           
        <xforms:input ref="instance('main')/age">
            <xforms:label>Age:</xforms:label>
            <xforms:message level="modal" ev:event="xforms-invalid">
                Please enter a positive integer for age
            </xforms:message>
        </xforms:input>
        <br/>
        <xforms:input ref="instance('main')/nationality">
            <xforms:label>Nationality:</xforms:label>
        </xforms:input>    
        <br/><br/>
        <xforms:trigger>
            <xforms:label>Save</xforms:label>
            <xforms:action ev:event="DOMActivate">                                              
                <xforms:send submission="save-details"/>
            </xforms:action>                    
        </xforms:trigger><br/><br/>
       
</xhtml:body>
</xhtml:html>

The space between xs: and positiveInteger in the previous mail was not there in the actual example.

Thanks & Regards
Merin

>Hi Merin,
>
>
>I created an XHTML+XForms file that run in the sandbox with code very
>similar to yours. Have a look at it and see what is different in your
>file. One possible source for the problem is the space between "xs:"
>and "positiveInteger", but that might just be something in your email.
>
>
>I hope this will help,
>
>
>Alex


--
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: Re: xforms:alert/ xforms:message

Alessandro  Vernet
Administrator
Hi Merin,

I am wondering of the problem you are talking about has not been
resolved since the version of PresentationServer you are using. Try to
get a nightly build (URL below) and import the ops.war into a new
project, with: File / Import / OPS Application Project from WAR.

http://forge.objectweb.org/nightlybuilds/ops/ops/

You'll let me know if the problem persists with that version.

Alex

On 6/4/06, [hidden email] <[hidden email]> wrote:

> Hi Alex,
>
> I copied the code which you had sent. It is displaying the error message (xforms:message) when I enter a char string instead of a positive integer. But when I enter a negative number its not working. I am using OXF Studio for Eclipse (version 1.2.2).
>
> Tabs is also not working properly. Its working fine in the example which you had sent because there is only one input control. I added one more text box. Then when I pressed tab key from the first text box (after entering some invalid input) the message for invalid inputs does not pop up. I understand that this happens because control is moved to the 2nd text box.
>
> Here is my example code:
>
> <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
>         xmlns:f="http://orbeon.org/oxf/xml/formatting"
>         xmlns:xhtml="http://www.w3.org/1999/xhtml"
>         xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>         xmlns:widget="http://orbeon.org/oxf/xml/widget"
>         xmlns:ev="http://www.w3.org/2001/xml-events"
>         xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>     <xhtml:head>
>         <xhtml:title>Lead Details</xhtml:title>
>         <xforms:model>
>             <xforms:instance id="main">
>                 <form>
>                     <age/>
>                     <nationality/>
>                 </form>
>             </xforms:instance>
>
>            <xforms:bind nodeset="instance('main')/age" type="xs:positiveInteger"/>
>
>             <xforms:submission id="save-details" method="post" action="/add-new-lead" ref ="instance('main')"/>
>         </xforms:model>
>
>     </xhtml:head>
>
> <xhtml:body>
>
>         <xforms:input ref="instance('main')/age">
>             <xforms:label>Age:</xforms:label>
>             <xforms:message level="modal" ev:event="xforms-invalid">
>                 Please enter a positive integer for age
>             </xforms:message>
>         </xforms:input>
>         <br/>
>         <xforms:input ref="instance('main')/nationality">
>             <xforms:label>Nationality:</xforms:label>
>         </xforms:input>
>         <br/><br/>
>         <xforms:trigger>
>             <xforms:label>Save</xforms:label>
>             <xforms:action ev:event="DOMActivate">
>                 <xforms:send submission="save-details"/>
>             </xforms:action>
>         </xforms:trigger><br/><br/>
>
> </xhtml:body>
> </xhtml:html>
>
> The space between xs: and positiveInteger in the previous mail was not there in the actual example.
>
> Thanks & Regards
> Merin
>
> >Hi Merin,
> >
> >
> >I created an XHTML+XForms file that run in the sandbox with code very
> >similar to yours. Have a look at it and see what is different in your
> >file. One possible source for the problem is the space between "xs:"
> >and "positiveInteger", but that might just be something in your email.
> >
> >
> >I hope this will help,
> >
> >
> >Alex
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xforms:alert/ xforms:message

Merin Shaji
Thanks a lot Alex. It is working fine with the latest nightly build. Thank you once again for your prompt replies.

Best Regards
Merin



--
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