You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pedro Januário <pr...@gmail.com> on 2009/04/20 14:22:54 UTC

Component server side identifiers

Hi,

I need to build one outputfield component that work's in two modes:
- read only mode: Render with span elements;
- write mode: renders with textfields;

SAMPLE: Component outputfield
    <t:if test="readOnly">
        <span id="${id}" style="${style}"
class="${cssClass}">${value}</span>
        <t:parameter name="else">
             <input id="${id}" t:id="${id}" t:type="textfield"
style="${style}" class="${cssClass}" value="${value}"/>
        </t:parameter>
    </t:if>

Use:
<inputt:id="${id}" t:id="${id}" t:type="outputfield" class="class"
value="val"/>

The main issue it's about the server side unique identifier, it's possible
to make some workaround about this.
The component have to be a constant field.

-- 
Regards,
Pedro Januário

Re: Component server side identifiers

Posted by Ulrich Stärk <ul...@spielviel.de>.
Static structure, dynamic behaviour. The t:id has to be known in advance 
and can't be computed dynamically. Why can't you just give it a static t:id?

Uli

Am 20.04.2009 14:22 schrieb Pedro Januário:
> Hi,
> 
> I need to build one outputfield component that work's in two modes:
> - read only mode: Render with span elements;
> - write mode: renders with textfields;
> 
> SAMPLE: Component outputfield
>     <t:if test="readOnly">
>         <span id="${id}" style="${style}"
> class="${cssClass}">${value}</span>
>         <t:parameter name="else">
>              <input id="${id}" t:id="${id}" t:type="textfield"
> style="${style}" class="${cssClass}" value="${value}"/>
>         </t:parameter>
>     </t:if>
> 
> Use:
> <inputt:id="${id}" t:id="${id}" t:type="outputfield" class="class"
> value="val"/>
> 
> The main issue it's about the server side unique identifier, it's possible
> to make some workaround about this.
> The component have to be a constant field.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org