cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: fi:booleanfield[fi:styling/@type='output']
Date Mon, 26 Apr 2004 21:43:37 GMT
Joerg Heinicke wrote:

> On 26.04.2004 22:58, Bruno Dumon wrote:
>
>> I saw the following template in forms-field-styling.xsl:
>>
>>   <!--+
>>       | fi:booleanfield with @type 'output' : rendered as text
>>       +-->
>>   <xsl:template match="fi:booleanfield[fi:styling/@type='output']">
>>     <xsl:choose>
>>       <xsl:when test="fi:value = 'true'">
>>         yes
>>       </xsl:when>
>>       <xsl:otherwise>
>>         no
>>       </xsl:otherwise>
>>     </xsl:choose>
>>   </xsl:template>
>>
>> And was wondering what people are using this for? Or how this can
>> possibly do something meaningful?
>>
>> The problem I see is that if a booleanfield is not present on the
>> request, it will always be reset to false. So I'd rather remove this
>> template then giving people the false impression this might work.
>
>
> The same is true for
>
> <!--+
>     | fi:field with a selection list and @type 'output'
>     +-->
> <xsl:template 
> match="fi:field[fi:selection-list][fi:styling/@type='output']" 
> priority="3">
>
> (line 210) and also for
>
> <!--+
>     | fi:field with @type 'output' and fi:output are both rendered as 
> text
>     +-->
> <xsl:template match="fi:output | fi:field[fi:styling/@type='output']" 
> priority="2">
>
> (line 240)
>
> They would also be reset after request.
>
> These stylings make only sense if the form widget values are not 
> evaluated. I can imagine a confirmation page, where just the submit 
> widget (ok vs. cancel) is evaluated.


BooleanField is special as "no parameter" means "false", but for regular 
Fields, what do you think about not resetting the value to null if the 
request parameter is not present? This would make @type="output" more 
useful than it is today.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message