On Mon, 2004-04-26 at 23:43, Sylvain Wallez wrote: > 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.
Never thought of using it that way, but it's indeed a good case. > > > 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. I thought this is already the case? -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED]
