How about subclassing the TextField component?

-----Original Message-----
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: woensdag 5 april 2006 15:34
To: Tapestry users
Subject: Re: Tap 3: Conditional component type in .jwc?

You could also use the RenderBlock component, I find it perfect for just
these types of scenerios. (there should be a 3.X series component
reference in the 3.X pages as well)

http://jakarta.apache.org/tapestry/tapestry/ComponentReference/RenderBlo
ck.html

On 4/5/06, Bode, Bianca <[EMAIL PROTECTED]> wrote:
>
> I started out like this, but that requires a lot of typing if you have

> a view with lots of fields ;) Hence my question :)
>
>
> -----Original Message-----
> From: Mike Snare [mailto:[EMAIL PROTECTED]
> Sent: woensdag 5 april 2006 15:24
> To: Tapestry users
> Subject: Re: Tap 3: Conditional component type in .jwc?
>
> I think you want to provide both in your template, and wrap them with 
> appropriate Conditional components:
>
> <component id="shouldShow" type="Conditional">
>   <binding name="condition" value="not editable" /> </component>
>
> <component id="showCity" type="Insert">
>   <binding name="value" expression="city"/> </component>
>
> <component id="shouldEdit" type="Conditional">
>   <binding name="condition" value="editable" /> </component>
>
> <component id="editCity" type="Insert">
>   <binding name="value" expression="city"/> </component>
>
> Then in your template:
>
> <span jwcid="shouldShow">
>   <span jwcid="showCity" />
> </span>
>
> <span jwcid="shouldEdit">
>   <span jwcid="editCity" />
> </span>
>
> -Mike
>
> On 4/5/06, Bode, Bianca <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I have created a component, that renders some plain html, with
> > parameters:
> >
> > <parameter name="editable" required="yes"></parameter> <parameter 
> > name="city" required="no"></parameter>
> >
> > And component:
> > <component id="city" type="Insert">
> >        <binding name="value" expression="city"/>  </component>
> >
> > Now, depending on the 'editable' parameter I want the type of my
> 'city'
> > component to be either
> > 'Insert' when 'editable' is false or 'TextField' when 'editable'is
> true.
> >
> > Can this be done, is there another way to easily switch the types of

> > a
>
> > component, or do I need to make two seperate components?
> >
> > Kind regards, Bianca.
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: 
> > [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> > [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.  http://opennotion.com

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

Reply via email to