[jboss-user] [JBoss Seam] - Nested repeats bug
msznapka
do-not-reply at jboss.com
Tue Nov 13 18:00:29 EST 2007
Hello.
I think that I found bug in nested repeats. I have following code:
| <h:commandLink action="#{repeatConversation.deleteItems}" value="commandLink"/><br/>
| <s:link action="#{repeatConversation.deleteItems}" value="sLink"/><br/>
| <ui:repeat value="#{repeatConversation.shoppingList.categories}" var="category">
| <ui:repeat value="#{category.items}" var="item">
| <h:inputText value="#{item.name}"/><br/>
| </ui:repeat>
| </ui:repeat>
|
| public String deleteItems() {
| Iterator<ItemCategory> iteratorCategories = shoppingList.getCategories().iterator();
| while(iteratorCategories.hasNext()) {
| Iterator<Item> iteratorItems = iteratorCategories.next().getItems().iterator();
| while(iteratorItems.hasNext()) {
| Item item = iteratorItems.next();
| if(item.getName().equalsIgnoreCase("thirdItem"))
| iteratorItems.remove();
| }
| }
| return null;
| }
|
So the code is simple, I am repeating through nested collections, rendering some string as a value of a input field and there are two links with the same functionality: delete third item. If you press h:commandLink, than the third item is deleted on the server correctly, but on the client it is rendered incorrectly. S:link renders all inputs correctly. Here is picture how it works:
Example
Delete directory jboss-seam-2.0.0.GA/examples/numberguess and copy directory from the example, build, deploy on jboss-4.2.1.GA and run http://localhost:8080/seam-numberguess in browser.
If this is not bug, please let me know how to solve it with h:commandLink, my app is waiting for solution ;)
Thx
msznapka
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104341#4104341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104341
More information about the jboss-user
mailing list