You could, perhaps. Ideally I'd probably use just a TextField and pass in the appropriate disabled="boolean" on it depending on whether or not I wanted it to be editable, and then use css classes to make the disbabled field look the way I wanted when not enabled.
You can try subclassing though..It's probably something you'll have to play with a little bit to find the right fit. On 4/5/06, Bode, Bianca <[EMAIL PROTECTED]> wrote: > > 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] > > -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://opennotion.com
