permaculture playing cards*
The moose likes JSF and the fly likes Problem with a h:panelGrid and a ui:repeat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with a h:panelGrid and a ui:repeat" Watch "Problem with a h:panelGrid and a ui:repeat" New topic
Author

Problem with a h:panelGrid and a ui:repeat

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,
I am trying to use a h:panelgrid with a ui:repeat.
I would like for my h:panelgrid to show lines of three of the h:panelgroups that are inside the ui:repeat and end with the "hard coded" h:panelgroup. However, the h:panelgrid treats the ui:repeat as only one component. End result I have two components in my h:panelgrid!!
Can anyone please help?
Thanks,
Julien.

Here is the code:
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Julien

You're right the panelGrid treats the ui:repeat like a one component, and do it for every component, the panelGrid is rendered as a table, maybe you can construct your table without the panel grid, I give you an example

I hope this can give you a clue how to solve your problem.
Regards
Cesar


When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Thanks a lot Cesar,
However you'll notice that I won't get exactly what I want to achieve: with the proposed solution, I get one item per row whereas I would like 3 items per row...
I just hoped there was some way of circumventing the problem you described still using a h:datagrid...
Thanks anyway for taking the time to answer
Julien.
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Julien

I didn't understood your question very well, mmm It's difficult to resolve, but make it work, it's a weird solution but It works for me, try it.

Regards
Cesar
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
I'll try that. Thanks Cesar.
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Julien

I was thinking how to improve the code that I post, I find a perfect solution for this, this code enclose perfectly the <td> between the <tr>. Use this:

I think with this, it's properly corrected your problem.
Regards
Cesar
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Yes, the first part is perfect. However you see there is a problem with the last "hardcoded" h:panelgroup ("and there").
I would like it to follow directly the last "dynamic" element. Do you see my point?
Regards,
Julien.
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Of course Julien I understand you, I solve this, so use it:

So now, I hope this finally fix you problem.
Regards,
Cesar.
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
thanks Cesar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with a h:panelGrid and a ui:repeat
 
Similar Threads
Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them
Need help in display the page number in the data scroller
Question about java.text.Normalizer
EL Syntax exception - javax faces el ReferenceSyntaxException
Issue with jstl + facelets