hi nick,
this behaviour is intended by the spec (see 4.2 Initialization Events).
first, the xforms-model-construct is dispatched, which initializes a
model. at the end of model construct the events xforms-rebuild,
xforms-recalculate, and xforms-revalidate are dispatched. but the
initial revalidation won't lead to xforms-readonly, ..., events, since
the user interface is not initialized yet. there are simply no event
targets for xforms-readonly, ... . then, the form controls will be
initialized during xforms-model-construct-done processing. so moving ui
initialization to xforms-model-construct would break conformance.
keep in mind, that xforms-readonly and its relatives are only dispatched
when the corresponding model item property *changes*. so in your case
you will never see a xforms-readonly/xforms-readwrite event, since the
"readonly='true()'" condition uses a static function. if you'd use a
dynamic expression which might evaluate to different values at runtime,
you'll receive the appropriate events, e.g something like
"readonly='string-length(...) > 0'".
regards, uli.
Nick Van den Bleeken wrote:
Hi all,
I have a question in releation to the xforms-readonly vent. When you
have for example a Text Control that has a read-only attribute of
'true()' the xforms-readonly event is nevere triggered. Is this a bug or
is it a works as in the XForms specification?
I know why it is in chiba : the method readonlyChanged f DataElement is
called as a result of dispatching the xfroms-revalidate event at the end
of the modelConstruct method of Model (as defined in the XForms spec).
But because there is no listener is registered at this time the vent is
never sent to the DOM tree. The listener is registered in the
modelConstructDone method of Model through
Initializer.initializeUIElements.
Moving Initializer.initializeUIElements just before the dispatching of
the events ( in the modelConstruct method) solves the problem, but I
don't know if this is correct.
Thanks,
Nick Van den Bleeken
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer
--
Ulrich Nicolas Lissé
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
|