myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Udo Schnurpfeil <...@schnurpfeil.de>
Subject Re: [Tobago] foreach in c:sheet
Date Fri, 28 May 2010 07:30:14 GMT
Hi Hani,

to find the optimal solution for your problem it whould be helpful to 
have a screenshot of your app.

The question is: is the number of links in one column limited? Are the 
links mostly the same, or are they completely independent?
When we have limited links, we can use static links with rendered 
attributes and we don't have to create lots of components in each row.

Regards,

Udo

Am 27.05.10 12:04, schrieb Abushammala, Hani (EXTERN: FTP):
> Hi Volker,
>
> By component binding i used actually your tip for using rendered attribut (thank you!)
> After creating the main panel and his children panels for each row of the sheet, i've
> defined the rendered attribut of the children panels with:
>
> ComponentUtil.setBooleanProperty(childPanel /* the i child panel */, TobagoConstants.ATTR_RENDERED,
"#{" + sheetVar
>                                                                                     
    + ".index == "
>                                                                                     
    + item.getIndex() /* for i child panel */
>                                                                                     
    + "}");
>
> So that the first panel will be in rendered in the first row and the rest of panels will
be disabled and etc.
> It works fine, but i need a better solution. The jstl way works also, but all panels
will be displayed in each row of sheet.
> I didn't think about a new implementation of the UIPanel, i will try this one now.
>
>
> Thank you
>
> Regards,
> Hani
>
>
> -----Ursprüngliche Nachricht-----
> Von: weber.volker@googlemail.com [mailto:weber.volker@googlemail.com] Im Auftrag von
Volker Weber
> Gesendet: Donnerstag, 27. Mai 2010 09:45
> An: MyFaces Discussion
> Betreff: Re: [Tobago] foreach in c:sheet
>
> Hi,
>
> as Udo wrote, you can't use jstl inside tc:sheet!
> Or to be more precise: the var param of tc:sheet is not available when
> jstl iterates, because jstl evaluates before tobago starts renderring.
>
> I also can't imagine how you do this with component binding, because
> this is also done before rendering starts. Can you explain how you do
> this?
>
> But there is a way to solve this, you need binding to a extended
> UIPanel implementation which drops and recreates children depending on
> sheets var in each process* method.
>
>
> Regards,
>      Volker
>
>
> 2010/5/27 Abushammala, Hani (EXTERN: FTP)
> <extern.hani.abushammala1@volkswagen.de>:
>    
>> Hello Udo,
>>
>> Sorry, i forget to list the important libraries in use:
>>
>> avalon-framework-4.1.3.jar
>> tobago-core-1.0.24.jar
>> jstl-1.1.0.jar
>> myfaces-impl-1.1.7.jar
>> myfaces-api-1.1.7.jar
>> commons-el-1.0.jar
>> standard-1.1.2.jar
>>
>>
>> Thank you.
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Abushammala, Hani (EXTERN: FTP) [mailto:extern.hani.abushammala1@volkswagen.de]
>> Gesendet: Mittwoch, 26. Mai 2010 15:12
>> An: MyFaces Discussion
>> Betreff: AW: [Tobago] foreach in c:sheet
>>
>> Hello Udo,
>>
>>
>> I want to add a dynamic panel to a column, which has many elements for each row in
the sheet,
>> that means the content of the panel for each row is different (like sheet in sheet).
>> I could do it with programming of whole panel in java and binding it in the jsp,
but i am looking now for a different way.
>>
>> I've tried to use jstl, but it doesn`t work to render the right dynamic panel for
right row:
>>
>>
>> <tc:column sortable="false" align="left">
>>
>>     <tc:panel id="headPanel">
>>         <c:forEach items="${myBean.list}" var="x" varStatus="status1">
>>             <tc:panel id="subPanel${x.nr}" rendered="${status1.index} == ${x.nr}">
>>                 <c:forEach items="${x.subList}" var="w" varStatus="status2">
>>                     <tc:link image="${w.iconUrl}" id="link_${x.nr}_${w.nr}" />
>>                 </c:forEach>
>>             </tc:panel>
>>         </c:forEach>
>>     </tc:panel>
>>
>> </tc:column>
>>
>> I've used jstl 1.1.
>>
>> Thank you.
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Udo Schnurpfeil [mailto:udo@schnurpfeil.de]
>> Gesendet: Dienstag, 25. Mai 2010 09:16
>> An: users@myfaces.apache.org
>> Betreff: Re: [Tobago] foreach in c:sheet
>>
>> Hello Hani,
>>
>> I've never tried to use<c:set>, so I have no experience with that tag.
>>
>> Your code will not work, because the content inside of the<tc:sheet>
>> will be visited only one time.
>> The JSTL Tag needs to be called in each row to make it work.
>>
>> Mixing JSTL and JSF and use of iterators have some drawbacks. This
>> depends also on the version of the libraries. Which version you are using?
>>
>> You may try to make your data accessible via the var-attribute of the sheet:
>>
>> <tc:sheet var="row" ...>
>> ...
>>         <tc:column
>>                 <tc:out  value="#{row.subListAsString}" />
>>         </tc:column>
>> ...
>> </tc:sheet>
>>
>>
>> Regards,
>>
>> Udo
>>
>>
>> Am 20.05.10 16:39, schrieb Abushammala, Hani (EXTERN: FTP):
>>      
>>> Hello,
>>>
>>> We want to visualize some dynamic content within a column for each row
>>> of sheet with jstl.
>>>
>>>
>>> We tried to incrment a variable (defined outside of the tc:sheet
>>> element)  with:<c:set var="counter" value="${counter + 1}" />    to get
>>> the row index, but it doesn't work.
>>>
>>> Jsp:
>>>
>>> <tc:sheet ..>
>>>
>>> ...
>>>        <tc:column
>>>
>>>                <c:set var="counter" value="${counter + 1}" />
>>>
>>>                <c:forEach  items="${bean.itmesList[counter].subList}"
>>> var="w" varStatus="status">
>>>                                <tc:out  value="${w}" />
>>>                </c:forEach>
>>>
>>>        </tc:column>
>>> ...
>>>
>>> </tc:sheet>
>>>
>>>
>>>
>>>
>>> Is it possible and how?
>>>
>>>
>>> Thank you.
>>>
>>>
>>>        
>>      
>
>
>    

Mime
View raw message