It should be something like that ;) :

  <xsl:template match="wi:field[wi:[EMAIL PROTECTED]'read-only']]">
    <xsl:copy-of select="wi:value/node()"/>
    <input name="[EMAIL PROTECTED]" title="{wi:help}" type="hidden" value="[EMAIL 
PROTECTED]" >
      <xsl:copy-of select="wi:styling/@*[not(name() = 'type')]"/>
        <xsl:attribute name="value"><xsl:copy-of 
select="wi:value/node()"/></xsl:attribute>
    </input>
  </xsl:template>



On 09/01/2004 11:05, Michael Roth wrote:

I feared that the only way to do this is to write a special template
by myself.

Thank you

At 10:49 09.01.2004 +0100, you wrote:

On 09/01/2004 10:31, Michael Roth wrote:

Hi Olivier,
Thats a good idea, but how do you solve the problem
that an output widget does not read its value from the
request ?


The widget is still a field, not an output.
The styling is only for rendering. But in fact, with a styling of type 'output', no <input> will be generated and you'll have a binding error, or a null field (my bad).


You must write a special template in woody-field-styling.xsl, for read-only fields (it may already exist now) that renders the value as text, and adds an hidden input for the binding.

Michael

At 09:58 09.01.2004 +0100, you wrote:

Hi Michael,

You can use the role to filter the wd:styling (@type='output' for a read-only rendering) :
read-write : <wt:widget id="myWidget"/>
read-only : <wt:widget id="myWidget"><wi:styling type="output"/></wt:widget>


see woody-field-styling.xsl in the woody samples

To do this, you can render your template file with an XSP.
It works for me.

--
Olivier


On 09/01/2004 09:28, Michael Roth wrote:


I'm on my first project using the woody framework.
Till now I'm satiesfied with it, but there is a
big problem. I've to show a form and some of the fields
are read/write or read only depending on the role
of the user. How can I do this with Woody ?
Thanks a lot
Michael Roth




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Michael Roth
Technische Universit�t Wien
Zentraler Informatik Dienst -  Zentrale Services
Wiedner Hauptstra�e 8-10, 1040 Wien
Tel.: 58801 42091  /  Fax: 58801 42099


--
Olivier BILLARD



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to