I know this may annoy some folk as its not directly a struts question. But JSF is used with struts, bla , bla..

Does any one have any thoughts on scoping a List backed backing bean to request and being able to maintain the list without the Bean being reinstantated on each post..

public class HouseBean {
        
        private List roomList;

        public HouseBean() {
                this.roomList = new ArrayList();
        }

        public List getRooms() {
                return rooms;
        }

        //also tried using void method
        public String addRoomAction() {
                this.roomList.add(
                        new RoomBean(
                                        "Room "+ Integer.toString(roomList.size())
                        );
        return Outcomes.SUCCESS;
        }
}


<h:form id="houseForm"> <h:dataTable id="table" var="roomBean" value="#{houseBean.rooms}"> <h:column> <h:inputText id="room" value="#{roomBean.name}" /> </h:column> </h:form>

The first item works but then the bean is instantiated and I get a new List..

DO i need to scope to session or is there something i've missed? I've tried lazy list but the basic problem is that the Bean is instantiated everytime the addRoomAction is run..

Mark




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to