Hi,

I am using one logic iterate tag inside another. The data set at the inner
loop should update form bean. Following explains what i tried to do. This
way the data displays as I expected. But when I select the check box it
won't update the corresponding 'Book' object. (The form has list of
'BookList' objects. Each BookList object has set of Book objects. I wanted
to mark Book as selected.)

class BookList
        ArrayList<Book> books

class Book
        String name
        boolean selected

class BookInfoForm extends ActionForm{
        ArrayList<BookList> bookLists;
        
        public BookList getBookl(int index){
                return bookLists.get(index);
        }
        public void setBookl(int index,BookList element){
                bookLists.set(index, element);
        }
        public Book getBook(int index){
                
                return bookLists.get(?).getBooks().get(index);
        }
        public void setBook(int index,Book element){
                
                bookLists.get(?).getBooks().set(index,element);
        }

        
}

<logic:iterate name="bookInfoForm" id="bookl" property="bookLists"
indexId="i">

<logic:iterate id="book" name="bookl" property="books" indexId="j">
<html:checkbox name="book" property="selected" indexed="true" value="true"
/>
<bean:write name="book" property="name" />

</logic:iterate>

</logic:iterate>

Thanks in advance,
Thanuja


-- 
View this message in context: 
http://www.nabble.com/Multiple-Logic-iterate-tags-and-setting-indexed-properties-tp23031690p23031690.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to