Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

java - When <ui:repeat> works for X but <c:forEach> works for Y

I use <c:foreach> in my jsf app to iterate over a list of people. I don't use <ui:repeat> because every person has its own tab (primefaces). JSF hero 'BalusC' already helped my out on this one link. Now I tried to save (postback) the data. This doesn't work with <c:forEach>, the approriate setter of the Person object gets never called. With <ui:repeat> it works. Obviously I haven't grasped the difference between the two tags so I would appriciate some enlightenment.

Thanks

Marcel

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

<c:forEach> does not build JSF tree nodes on the server. You can see this directly in the html, the inputs do not have the usual long and distinct id="j_12:customerTabPanel:j_34:customerName".

Please, read this:

https://rogerkeays.com/jsf-c-foreach-vs-ui-repeat


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...