I think i found my answer and its basically scope to session and set the StateManager to save on the client.

<context-param>
   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
   <param-value>client</param-value>
</context-param>

This stores session information on the client rather than on the server..

I found it when i was read the jsf spec..
[McClanahan et al, JavaServer TM Faces Specification, February 2004, Revision 01, page 242]



" javax.faces.STATE_SAVING_METHOD -- The location where state information is saved. Valid values are “server” (typically saved in HttpSession) and “client (typically saved as a hidden field in the subsequent form submit). If not specified, the default value “server” must be used. "


I was trying to fix something that's already been done, all i have to say to that is "arses".

Mark

On 25 Sep 2004, at 14:00, Mark Lowe wrote:

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]


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



Reply via email to