Form builder control

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

Form builder control

msalmadan@yahoo.com
I am building a custom control in Orbeon form Builder that has the following behaviors:

1- An input box that is required and has constraint.
2- The input box value is validated by sending <xforms:submission> to server.
3- If the value entered into the box is valid the server validation routine will retrun as string “wrong” or “correct”.
4- If the valid returned is “wrong “I reset the the value of the input box in #1  to empty string “value=’’”.
5- Everything is working fine expect the required behavior never get set so the “submit” button is always is enabled.

The question how I accomplish making an input box in custom control  required.

This is how my model is defined:

<xforms:model id="captchacode-model">
                 

               <xforms:instance id="Test-Value">
                        <root>
                                <flag>0</flag>
                                <value>0</value>
                                <disable-enable>0</disable-enable>
                                <Error-Message/>
                                <button2/>
                        </root>
              </xforms:instance>



            <xforms:instance src="/xforms-jsp/captcha/2captchaxmlSubmit.jsp" id="captchas"/>
            <xforms:instance id="query">
                <query/>
            </xforms:instance>
            <xforms:submission id="do-query" method="post" replace="instance" ref="instance('query')"
                               instance="captchas"
                               action="/xforms-jsp/captcha/2captchaxmlSubmit.jsp"/>
 

            <xforms:bind nodeset="instance('query')" required="true()" constraint="string-length(.) >=5"/>

            </xforms:model>

Any help is appreciated.

Thanks,

Majeed
Reply | Threaded
Open this post in threaded view
|

Re: Form builder control

Alessandro Vernet
Administrator
On Mar 27, 2009, at 10:22 PM, [hidden email] wrote:

> I am building a custom control in Orbeon form Builder that has the  
> following
> behaviors:
>
> 1- An input box that is required and has constraint.
> 2- The input box value is validated by sending <xforms:submission> to
> server.
> 3- If the value entered into the box is valid the server validation  
> routine
> will retrun as string “wrong” or “correct”.
> 4- If the valid returned is “wrong “I reset the the value of the  
> input box
> in #1  to empty string “value=’’”.
> 5- Everything is working fine expect the required behavior never get  
> set so
> the “submit” button is always is enabled.
Initially, when the form is first loaded (before the service is  
called), if the input is empty, is the submit button disabled? If it  
is, it should also be disabled if the value is set to empty based on  
the response from a service.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws