cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <o...@wlkp.org>
Subject woody read only fields
Date Mon, 24 Nov 2003 15:51:33 GMT
There seems to be a slight problem with woody if you want to work with a read
only field. You have some options:

1. use wd:output
The problem: cannot output field running if the parent is repeater and not
form. This syntax works for top level widget:

form.getWidget( "ouput_widget" ).setValue( "test value" );

but this works only for object of _Form_ type. getWidget() method cannot be
resolved for a widget so you cannot do:

var model = form.getModel();

model.output_widget = "test value";

2. use wd:field with wi:styling type="output"
You will get a value without form input control but after submission the
field's value will get reset (no appropriate parameter in request parameters)

The solution:

Introduce a new field styling : "read-only" that would render the field like
this:
<xsl:when test="wi:styling[@read-only='true']">
    <xsl:value-of select="wi:value"/>
    <input name="{@id}" id="{@id}" type="hidden" value="{wi:value}" title="{wi:hint}"/>
</xsl:when>

	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


Mime
View raw message