Yes, you can have components as parameters. See, for example,
RenderBlock, which takes a Block component as a parameter.
If you're only going to have multiple choice and true false, then
the simplest solution is probably to just do (TP4):

<span jwcid="[EMAIL PROTECTED]" source="ognl:section.items">
  <span jwcid="@If"
condition="components.items.value.type.equals("TrueFalse")
   element="ognl:null">
        <!-- render your true-false stuff here. -->
  </span>
  <span jwcid="@Else" element="ognl:null"
      <!-- render your multiplechoice stuff here. -->
  </span>
</span>

But... if it gets much more complex than that, or if you're looking at
a situation where, later on, you're going to have more than
truefalse/multiplechoice, and you're looking to be able to add more
types without changing the existing templates and code, then have a look
at block/render block.  You can grab blocks from other pages, which is
very useful for dynamic component inclusion. :) I'm using this now for a
very similar situation.

Robert

Henrik wrote:
> Hi
> 
> I have a situation where I have a component that will display certain 
> properties
> for a Section object. In addition it should display a list of items for that
> Section. The items in the list can be of type MultipleChoiceItem or
> TrueFalseItem. I would like from my html page to be able to specify that teh
> Section component should use the MultipleChoiceItem component if the list
> contains multipleChoiceItems or use the TrueFalseComponent if the list 
> contains
> truefalse items. 
> 
> Is it a way to specify components as a parameter in a component 
> specification??
> 
> ex: <span jwcid="@SectionEditor" itemEditor="MultipleChoiceEditor"/> ??? Where
> the MultipleChoiceEditor is a component
> 
> Henrik
> 
> 
> ---------------------------------------------------------------------
> 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