xxforms:format with a control which does not refer to an element causes an exception

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

xxforms:format with a control which does not refer to an element causes an exception

David McIntyre
In adding internationalisation support for dates and times in our application, I've tried adding the xxforms:format attribute to some inputs and outputs.  However, I've found that this causes a problem when the control in question no longer refers to any element in the instance data (because its binding has a predicate which is no longer true): rather than simply no longer showing the control, an OXFException is thrown with the message "Control is no longer bound to a node. Cannot evaluate control display value".

The code causing this is presumably in the evaluateDisplayValueUseFormat method of the XFormsValueControl class.  Should the code simply call setDisplayValue(null) rather than throwing the exception?  Or would this cause a problem if the predicate becomes true again?

I've attached a simple example to illustrate the issue in the sandbox.  Entering a non-empty value in the Bar input should cause the Time and Date input to be hidden, but instead it causes an exception.

Cheers,
    Dave McIntyre
--
Orion Signature
Dave McIntyre
Software Developer
2nd Floor, Orion House, cnr Enfield & Mary St, Mt Eden, PO Box 8273, Auckland, New Zealand
M.+64 21 212 8087 P.+64 9 638 0600 F.+64 9 638 0699
S.<a href="callto:dave.mcintyre">dave.mcintyre E.[hidden email] W.www.orionhealth.com




This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.


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

format-without-bound-node.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:format with a control which does not refer to an element causes an exception

Erik Bruchez
Administrator
Dave,

Thanks for the reproducible case. This is now fixed in CVS.

-Erik

Dave McIntyre wrote:

> In adding internationalisation support for dates and times in our
> application, I've tried adding the xxforms:format attribute to some
> inputs and outputs.  However, I've found that this causes a problem when
> the control in question no longer refers to any element in the instance
> data (because its binding has a predicate which is no longer true):
> rather than simply no longer showing the control, an OXFException is
> thrown with the message "Control is no longer bound to a node. Cannot
> evaluate control display value".
>
> The code causing this is presumably in the evaluateDisplayValueUseFormat
> method of the XFormsValueControl class.  Should the code simply call
> setDisplayValue(null) rather than throwing the exception?  Or would this
> cause a problem if the predicate becomes true again?
>
> I've attached a simple example to illustrate the issue in the sandbox.  
> Entering a non-empty value in the Bar input should cause the Time and
> Date input to be hidden, but instead it causes an exception.
>
> Cheers,
>     Dave McIntyre
> --
> * Dave McIntyre
> Software Developer*
>
> 2nd Floor, Orion House, cnr Enfield & Mary St, Mt Eden, PO Box 8273,
> Auckland, New Zealand
> M.+64 21 212 8087 P.+64 9 638 0600 F.+64 9 638 0699
> S.dave.mcintyre <callto:dave.mcintyre> [hidden email]
> <mailto:[hidden email]> W.www.orionhealth.com
> <http://www.orionhealth.com>
--
Orbeon - XForms Everywhere:
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