Package javax.faces.component

Examples of javax.faces.component.UIViewRoot.restoreState()


      newRoot = vh.createView(context, oldViewId);
    } else {
      if(!b) try {
//        System.out.println("Restore state");
        Object st = oldRoot.saveState(context);
        newRoot.restoreState(context, st);
      } catch (Exception e) {
        e.printStackTrace();
      }
      context.getExternalContext().getRequestMap().put(AjaxContext.AJAX_CONTEXT_KEY, event.getAjaxContext());
    }
View Full Code Here


    if(newRoot == null) {
      newRoot = vh.createView(context, oldViewId);
    } else {
      try {
        Object st = oldRoot.saveState(context);
        newRoot.restoreState(context, st);
      } catch (Exception e) {
        e.printStackTrace();
      }
      context.getExternalContext().getRequestMap().put(AjaxContext.AJAX_CONTEXT_KEY, event.getAjaxContext());
    }
View Full Code Here

        // simulate server-side-state-saving without serialization
        Object state = root.saveState(facesContext);

        // restore view
        UIViewRoot root1 = new UIViewRoot();
        root1.restoreState(facesContext, state);

        // restore view .. next request
        UIViewRoot root2 = new UIViewRoot();
        root2.restoreState(facesContext, state);
View Full Code Here

        UIViewRoot root1 = new UIViewRoot();
        root1.restoreState(facesContext, state);

        // restore view .. next request
        UIViewRoot root2 = new UIViewRoot();
        root2.restoreState(facesContext, state);

        // chaange attribute in root1
        root1.getAttributes().put("key", "borken");

        // other values should not have been changed
View Full Code Here

        }


        // must call restoreState so that we setup attributes, listeners,
        // uniqueIds, etc ...
        newRoot.restoreState(fc, viewRootState);

        // we need to use a temp list because as a side effect of
        // adding a child to a UIComponent, that child is removed from
        // the parent UIComponent. So the following will break:
        // newRoot.getChildren().addAll(root.getChildren());
View Full Code Here

        }

       
        // must call restoreState so that we setup attributes, listeners,
        // uniqueIds, etc ...
        newRoot.restoreState(fc, viewRootState);

        // we need to use a temp list because as a side effect of
        // adding a child to a UIComponent, that child is removed from
        // the parent UIComponent. So the following will break:
        // newRoot.getChildren().addAll(root.getChildren());
View Full Code Here

        UIViewRoot newRoot = (UIViewRoot)
          fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);
       
        // must call restoreState so that we setup attributes, listeners,
        // uniqueIds, etc ...
        newRoot.restoreState(fc, viewRootState);

        // we need to use a temp list because as a side effect of
        // adding a child to a UIComponent, that child is removed from
        // the parent UIComponent. So the following will break:
        // newRoot.getChildren().addAll(root.getChildren());
View Full Code Here

                    if (state != null) {
                        String cid = viewRoot.getClientId(context);
                        Object stateObj = state.get(cid);
                        if (stateObj != null) {
                            context.getAttributes().put("com.sun.faces.application.view.restoreViewScopeOnly", true);
                            viewRoot.restoreState(context, stateObj);
                            context.getAttributes().remove("com.sun.faces.application.view.restoreViewScopeOnly");
                        }
                    }
                }
                context.setProcessingEvents(true);
View Full Code Here

                    if (state != null) {
                        String cid = viewRoot.getClientId(context);
                        Object stateObj = state.get(cid);
                        if (stateObj != null) {
                            context.getAttributes().put("com.sun.faces.application.view.restoreViewScopeOnly", true);
                            viewRoot.restoreState(context, stateObj);
                            context.getAttributes().remove("com.sun.faces.application.view.restoreViewScopeOnly");
                        }
                    }
                }
                context.setProcessingEvents(true);
View Full Code Here

                    if (state != null) {
                        String cid = viewRoot.getClientId(context);
                        Object stateObj = state.get(cid);
                        if (stateObj != null) {
                            context.getAttributes().put("com.sun.faces.application.view.restoreViewScopeOnly", true);
                            viewRoot.restoreState(context, stateObj);
                            context.getAttributes().remove("com.sun.faces.application.view.restoreViewScopeOnly");
                        }
                    }
                }
                context.setProcessingEvents(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.