Setting 'readonly' attribute to fields

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

Setting 'readonly' attribute to fields

cargilan
Hello,

I have to populate some fields before the users interact with the forms, and
then set them to readonly.
What I am currently doing without success is:

1- I get the form XML with a Http Get to
"http://localhost:8080/orbeon/fr/service/persistence/crud/myApp/myForm/data/myDocumentID/data.xml"

2- Fill the XML with the fields i want and set the readonly attribute to
"true()". Example of the XML:
<my_section>
        <name readonly="true()">JOHN</name>
        <lastname readonly="true()">DOE</lastname >
 </my_section>

3- Http Post to
"http://localhost:8080/orbeon/fr/service/myApp/myForm/edit/myDocumentID/"
with the header "Content-Type application/xml" and the XML in the request
body.

Then when I access the form, the data was set correctly (JOHN DOE) but the
fields are not readonly.
Is there something I can do?

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Setting 'readonly' attribute to fields

fabio_barion
hi cargilan,
the correct setting for readonly attribute is:

readonly="true" and not readonly="true()"

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Setting 'readonly' attribute to fields

Alessandro  Vernet
Administrator
In reply to this post by cargilan
As mentioned by Fabio, in the data, I would use `readonly="true"` instead of
`readonly="true()"`. But, this by itself won't make the fields read-only.
You would need something more in the form definition that says that "if
there is an attribute `readonly="true"`, then the field is read-only". In
Form Builder, this could be done by setting the Read-Only formula to
`@readonly = 'true'`. You'll let me know if this helps.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Setting 'readonly' attribute to fields

cargilan
In reply to this post by cargilan
Thank you guys, It's working now perfectly. :)

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Setting 'readonly' attribute to fields

Alessandro  Vernet
Administrator
Excellent, and thank you for letting us know!

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet