W3C home > Mailing lists > Public > www-forms@w3.org > August 2006

xforms:output - should value and ref/bind be mutally exclusive?

From: Adrian Baker <adrian@fastmail.net>
Date: Wed, 02 Aug 2006 12:43:44 +1200
Message-ID: <44CFF540.2020103@fastmail.net>
To: www-forms@w3.org

I find the @value attribute of xforms:output extremely useful for 
formatting/modifying values for output.

Often though I find when replacing an xforms:output's @ref with a @value 
xpath I get caught out because the model item properties like relevant 
stop getting translated down onto the control.

A workaround is to wrap the xforms:output in a group, eg

    <xforms:output ref="data"/>


    <xforms:group ref="data">
        <xforms:output value="concat('[',.,']')"/>

but this is a bit of a pain because I then need to make changes to my 
CSS to accurately simulate the original output. The alternative of using 
a calculate on a bind is troublesome (particularly inside a repeat) 
because it requires changes to the instance data.

The spec states that the @value attribute has no effect if a binding 
attribute is present (8.1.5). Wouldn't it be more useful to state that 
if both are present, model item properties are applied to the resulting 
control, but the output value is determined by the @value expression 
rather than the node? In which case you could simply write:

    <xforms:output ref="data" value="concat('[',.,']')"/>

Received on Wednesday, 2 August 2006 00:45:11 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:18 UTC