You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christian Klocker <ch...@googlemail.com> on 2007/09/01 18:30:56 UTC

[Trinidad] custom renderer / use facet as template

i wrote a custom renderer for selectmany-components to render selectitems as user-defined components instead of checkboxes. actually this renderer uses a facet "template" to get the components, that should be renedered:

<ck:selectManyComps styleClass="imageSelection">
  <f:facet name="template">
    <tr:panelGroupLayout layout="vertical">
      <tr:icon name="sound"/>
      <tr:outputText value="#{label}"/>
    </tr:panelGroupLayout>
  </f:facet>
  <s:selectItems value="#{images}" var="i" label="#{i.url}" />
</ck:selectManyComps>

the problem here is that components inside the facet are already associated to an identifier and hence this ids are duplicated...

so, i'd like to ask:
- how can i reassign those component-ids?
- is there a better way to pass template-text to a renderer?

thanks 
christian

Re: Dynamic forms with JSF

Posted by Richard Yee <ry...@cruzio.com>.
Martin,
Thanks for the reply. Unfortunately, I don't know which half of the 
emails you are getting...
At the moment, we can't use 1.2 b/c we need to run on an Oracle OAS 
10.1.3.1 AppServer. I will check out Facelets. We are currently using 
the ADF af:table tag. We will be changing over to use Trinidad.

I have found a partial workaround for the problem. If I don't bind the 
components and instead use EL expressions for the attributes I get 
around the 'PropertyNotFoundException : error setting property in bean 
type null' problem.
My current problem is that if I use a af:inputDate with a af:chooseDate 
and link them with the chooseId and id attributes, I get a 
TrRequestQueue.getInstance is not a function JavaScript error. The error 
happens when there are multiple forms (more than one plan). I tried to 
fix this by dynamically generating the id for the chooseDate but found 
that this is not allowed from the post, "RE: Dynamic id's with Partial 
Page Rendering" from 03/04/07.

Do you think that the "TrRequestQueue.getInstance is not a function' is 
a bug or is using multiple inputDates and chooseDates in a tr:forEach 
not a supported usage?

I am using Trinidad 1.0.2

Thanks,

Richard

Martin Marinschek wrote:
> Hi Richard,
>
> I only seem to see half of your mails, but here some possible ways to
> get to such functionality easily:
>
> - use JSF 1.2 - c:forEach should work
> - use Facelets - c:forEach should work
> - Tomahawk t:dataList or Facelets ui:repeat or Standard table and
> Tomahawk Sandbox s:selectOneRow
> - Trinidad tr:table (has automatic selection features)
>
> regards,
>
> Martin
>
> On 9/3/07, Richard Yee <ry...@cruzio.com> wrote:
>   
>> Is it possible to have a dynamic number of forms in a JSF page? I would
>> like to have a forEach tag in my page that iterates over a list of
>> objects that contain a list if items to display in a multiselect table
>> and some UI components that will get updated based on the rows that get
>> selected.
>>
>> I have seen other postings that seem to indicate that UI components
>> cannot be inside a forEach tag and use the variable from the var attribute.
>>
>> Is there any way to do this?
>>
>> Ex.
>>
>> Plan A
>> ==============================
>> |    |  Name  |  Association |
>> -----+--------+---------------
>> | [] |   aaa  |     XYZ      |
>> -----+--------+---------------
>> | [] |   bbb  |     BBB      |
>> -----+--------+---------------
>> | [] |   ccc  |     CCC      |
>> -------------------------------------------------
>>
>> SelectOneChoice
>>
>> Checkbox
>>
>> SelectOneChoice
>>
>>
>> Plan B
>> ==============================
>> |    |  Name  |  Association |
>> -----+--------+---------------
>> | [] |   aaa  |     XYZ      |
>> -----+--------+---------------
>> | [] |   bbb  |     BBB      |
>> -----+--------+---------------
>> | [] |   ccc  |     CCC      |
>> -------------------------------------------------
>>
>>
>> SelectOneChoice
>>
>> Checkbox
>>
>> SelectOneChoice
>>
>>
>> ...... possibly more Plans...
>>
>>
>> APPLY         CANCEL
>>
>>
>>
>>
>> Thanks,
>>
>> Richard
>>
>>
>>
>>     
>
>
>   


Re: Dynamic forms with JSF

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Richard,

I only seem to see half of your mails, but here some possible ways to
get to such functionality easily:

- use JSF 1.2 - c:forEach should work
- use Facelets - c:forEach should work
- Tomahawk t:dataList or Facelets ui:repeat or Standard table and
Tomahawk Sandbox s:selectOneRow
- Trinidad tr:table (has automatic selection features)

regards,

Martin

On 9/3/07, Richard Yee <ry...@cruzio.com> wrote:
> Is it possible to have a dynamic number of forms in a JSF page? I would
> like to have a forEach tag in my page that iterates over a list of
> objects that contain a list if items to display in a multiselect table
> and some UI components that will get updated based on the rows that get
> selected.
>
> I have seen other postings that seem to indicate that UI components
> cannot be inside a forEach tag and use the variable from the var attribute.
>
> Is there any way to do this?
>
> Ex.
>
> Plan A
> ==============================
> |    |  Name  |  Association |
> -----+--------+---------------
> | [] |   aaa  |     XYZ      |
> -----+--------+---------------
> | [] |   bbb  |     BBB      |
> -----+--------+---------------
> | [] |   ccc  |     CCC      |
> -------------------------------------------------
>
> SelectOneChoice
>
> Checkbox
>
> SelectOneChoice
>
>
> Plan B
> ==============================
> |    |  Name  |  Association |
> -----+--------+---------------
> | [] |   aaa  |     XYZ      |
> -----+--------+---------------
> | [] |   bbb  |     BBB      |
> -----+--------+---------------
> | [] |   ccc  |     CCC      |
> -------------------------------------------------
>
>
> SelectOneChoice
>
> Checkbox
>
> SelectOneChoice
>
>
> ...... possibly more Plans...
>
>
> APPLY         CANCEL
>
>
>
>
> Thanks,
>
> Richard
>
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Dynamic forms with JSF

Posted by Richard Yee <ry...@cruzio.com>.
Is it possible to have a dynamic number of forms in a JSF page? I would 
like to have a forEach tag in my page that iterates over a list of 
objects that contain a list if items to display in a multiselect table 
and some UI components that will get updated based on the rows that get 
selected.

I have seen other postings that seem to indicate that UI components 
cannot be inside a forEach tag and use the variable from the var attribute.

Is there any way to do this?

Ex.

Plan A
==============================
|    |  Name  |  Association |
-----+--------+---------------
| [] |   aaa  |     XYZ      |
-----+--------+---------------
| [] |   bbb  |     BBB      |
-----+--------+---------------
| [] |   ccc  |     CCC      |
-------------------------------------------------

SelectOneChoice

Checkbox

SelectOneChoice


Plan B
==============================
|    |  Name  |  Association |
-----+--------+---------------
| [] |   aaa  |     XYZ      |
-----+--------+---------------
| [] |   bbb  |     BBB      |
-----+--------+---------------
| [] |   ccc  |     CCC      |
-------------------------------------------------


SelectOneChoice

Checkbox

SelectOneChoice


...... possibly more Plans...


APPLY         CANCEL




Thanks,

Richard