Package javax.faces.view

Examples of javax.faces.view.StateManagementStrategy


     */
    public UIViewRoot restoreView(FacesContext context,
                                  String viewId,
                                  String renderKitId) {
        UIViewRoot result = null;
        StateManagementStrategy strategy = null;
       
        ViewDeclarationLanguage vdl =
              context.getApplication().getViewHandler().
                    getViewDeclarationLanguage(context, viewId);
        if (vdl != null) {
            strategy = vdl.getStateManagementStrategy(context, viewId);
        }

        if (null != strategy) {
            result = strategy.restoreView(context, viewId, renderKitId);
        } else {
            ResponseStateManager rsm =
                    RenderKitUtils.getResponseStateManager(context, renderKitId);
            Object[] state = (Object[]) rsm.getState(context, viewId);

View Full Code Here


    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

    public Object saveView(FacesContext context) {
        Object result = null;

        if (context != null && !context.getViewRoot().isTransient()) {
            UIViewRoot viewRoot = context.getViewRoot();
            StateManagementStrategy strategy = null;
            String viewId = viewRoot.getViewId();

            ViewDeclarationLanguage vdl =
                    context.getApplication().getViewHandler().
                    getViewDeclarationLanguage(context, viewId);

            if (vdl != null) {
                strategy = vdl.getStateManagementStrategy(context, viewId);
            }

            Map<Object, Object> contextAttributes = context.getAttributes();

            try {
                contextAttributes.put(StateManager.IS_SAVING_STATE, Boolean.TRUE);

                if (strategy != null) {
                    result = strategy.saveView(context);
                } else {
                    strategy = new JspStateManagementStrategy(context);
                    result = strategy.saveView(context);
                }
            } finally {
                contextAttributes.remove(StateManager.IS_SAVING_STATE);
            }
        }
View Full Code Here

     * @return the view root.
     * @see StateManager#restoreView(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
     */
    public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId) {
        UIViewRoot result;
        StateManagementStrategy strategy = null;

        ViewDeclarationLanguage vdl =
                context.getApplication().getViewHandler().
                getViewDeclarationLanguage(context, viewId);

        if (vdl != null) {
            strategy = vdl.getStateManagementStrategy(context, viewId);
        }

        if (strategy != null) {
            result = strategy.restoreView(context, viewId, renderKitId);
        } else {
            strategy = new JspStateManagementStrategy(context);
            result = strategy.restoreView(context, viewId, renderKitId);
        }

        return result;
    }
View Full Code Here

    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

    // ------------------------------------ Methods from ViewDeclarationLanguage

    @Override
    public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) {
        StateManagementStrategy result;
       
        StateContext stateCtx = StateContext.getStateContext(context);
        if (stateCtx.isPartialStateSaving(context, viewId)) {
            result = new FaceletPartialStateManagementStrategy(context);
        } else {
View Full Code Here

TOP

Related Classes of javax.faces.view.StateManagementStrategy

Copyright © 2018 www.massapicom. 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.