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]

Reply via email to