Mark,
I actually think the styling is very logical. When you submit the form,
the data is uploaded and the upload widget holds the reference to the
uploaded data. When after that the form is redisplayed, you don't want
the upload to happen again next time the user submits the form. That's
why the filename is displayed instead. If the user wants to upload
something else instead, he/she can press the "..." button.
Actually I don't understand what you are exactly trying to do.
On Thu, 2004-04-29 at 20:53, Mark Lundquist wrote:
> (I'm posting this on the dev list because I may end up filingsomething
> on Bugzilla, but I wanted to talk it over first...)
>
> Anyway.... I'm not getting the idea of what forms-field-styling.xsl
> istrying to do with <fi:upload>... all I know is that it's not what
> Ineed! :-)
>
> <xsl:template match="fi:upload">
> <xsl:choose>
> <xsl:when test="fi:value">
> <!-- Has a value (filename): display it with a change
> button-->
> <span title="{fi:hint}">
> [<xsl:value-of select="fi:value"/>] <input
> type="submit"id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]" value="..."/>
> </span>
> </xsl:when>
> <xsl:otherwise>
> <input type="file" id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]"
> title="{fi:hint}"accept="[EMAIL PROTECTED]"/>
> </xsl:otherwise>
> </xsl:choose>
> <xsl:apply-templates select="." mode="common"/>
> </xsl:template>
>
> My form has an action widget whose handler cares about the value ofthe
> upload widget (this handler does the upload). So when the form
> isredisplayed, I no longer get an <input type="file">, instead I get
> asubmit button (!).
>
> This handling of fi:upload was obviously designed to support
> somescenario, but it's undocumented and (a) obvious to me what that
> mightbe, and (b) as I mentioned, it doesn't fit what I'm trying to do.
>
> I tried to defeat this behavior by doing this immediately
> beforeexiting my action widget handler:
>
> wid.logoFile.value = null;
>
> ...but that loses: "value of <fd:upload> widget cannot be
> manuallyset", or something to that effect.
>
> I would petition that the default handling of <fi:upload> shouldalways
> just generate an <input type="file">, and let the specialhandling that
> is the current default be selected using an<fi:styling> attribute.
>
> Or, that it be allowed to set the value of an upload widget to
> null(fine with me if setting it to a non-null value were disallowed).
>
> WDYT?
> mark
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED] [EMAIL PROTECTED]