I have a xhtml with a ui:repeat.
In the ui:repeat I have a commandlink with Ajax that points to a certain ID to get rendered.
In this ui:repeat I also have a UI:include with the element that needs to be rendered.
1) I have tried to move my ui:include outside of the ui:repeat to avoid that it's generated multiple times.
If I do this, I get an error saying that the the element the rendered points to doesn't exist.
So I am guessing that when the UI:repeat is built the ui:include is not visible yet because it's outside the ui:repeat
2) When I click on the first item in my ui:repeat that should render the element it works like a charm - the data is updated in the elemnt
However, if I click on any other item in my ui:repeat - it doesn't render the element.
How can that be? I can see that Ajax returns the right values.
I will provide you with code in a minute, I just have to strip it a bit first.
It's best not to think of a JSF View Template (the xhtml file) as something programmable. The "commands" on a View Template should concern themselves only with page layout and not business logic. Not that what you're doing sounds like business logic, but if you're using ui:repeat, chances are that you're thinking about "programming" the View.
I try to avoid ui:repeat for the most part. If I need organized repetitive data, my first choice is to use the h:dataTable or one of its derivatives. However, dataTables are designed for vertical organization of rows, so for things like horizontal repetition, the ui:repeat comes in handy.
I'm afraid your description is too vague to offer more than general guidelines, though. If you could provide a short example, it would help a lot. And if you use the "Code" button to wrap format tags around the XML, it will make it nice and readable.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.
posted 4 months ago
If anyone else should encounter this problem, here is what I found out:
I moved the include-tag outside of the ui:repeat.
The problem with that was that the <f:ajax> tag couldn't render the component, it pointed to it but it didn't seem visible.
This was caused by a <form> in af <form>. Once I sorted that out, everything fell into place.
The ID's were now ok and the slide-in would render every time.