Examples of DialogContext


Examples of org.richfaces.component.DialogContext

      Object  value = paramMap.get( clientId );
    return null != value;
  }
 
  public String getParentDialogId(DialogContext dcontext) {
    DialogContext parentContext = dcontext.getParentContext();
    return (parentContext == null) ? null : "'" + parentContext.getDialogId() + "'";
  }
View Full Code Here

Examples of org.richfaces.component.DialogContext

  public static String getRunCondition() {
    return "try {if(window.hasModalDialog) return false;this.onclick='';this.click=null; window.hasModalDialog=true;} catch (e) {'error in runCondition: ' + e.message};";
  }
 
  public static String getDialogPath(FacesContext context, UIComponent component) {
        DialogContext dcontext = DialogContextManager.getInstance(context).getContext(component.getClientId(context));
    return dcontext.getDialogPath();
  }
View Full Code Here

Examples of org.richfaces.component.DialogContext

  }

  public static void saveParameters(UIComponent uiComponent, FacesContext facesContext) {
    if(!(uiComponent instanceof UIDialogWindow)) return;
    String dialogId = uiComponent.getClientId(facesContext);
    DialogContext context = DialogContextManager.getInstance(facesContext).getContext(dialogId);
    for (Iterator it = uiComponent.getChildren().iterator(); it.hasNext();) {
      UIComponent child = (UIComponent) it.next();
      if (child instanceof UIParameter) {
        String name = ((UIParameter) child).getName();
        Object value = ((UIParameter) child).getValue();
        if (null == name) {
          throw new IllegalArgumentException(Messages.getMessage(
              Messages.UNNAMED_PARAMETER_ERROR, uiComponent
                  .getClientId(facesContext)));
        }
        boolean escape = true;
        if (child instanceof JavaScriptParameter) {
          JavaScriptParameter actionParam = (JavaScriptParameter) child;
          escape = !actionParam.isNoEscape();
        }
        if (escape) {
          context.setParameter(name, value);
        } else {
//          parameters.put(name, new JSReference(value.toString()));
        }
      }
    }
View Full Code Here

Examples of org.richfaces.component.DialogContext

    if(!isSubmitted(getUtils(), context, component)) {
      return;
    }
    String dialogId = component.getClientId(context);
    String action = (String)context.getExternalContext().getRequestParameterMap().get("action");
    DialogContext dcontext = DialogContextManager.getInstance(context).getContext(dialogId);
        DialogOpenEvent dialogEvent = new DialogOpenEvent(component);
       
    if(!"close".equals(action) && !"closeall".equals(action)) {
      DialogContext parentContext = DialogContextManager.getInstance(context).getActiveContext();
      DialogContextManager.getInstance(context).setActiveRequest(dialogId);
      if(parentContext != null && parentContext != dcontext) parentContext.addChildContext(dcontext);
      dcontext.setLocked(false);
      ViewHandler vh = UIDialogAction.getViewHandler(context);
      String targetActionURL = (String)((UIDialogWindow)component).getValue();
      targetActionURL = vh.getActionURL(context, targetActionURL);
          dcontext.setDialogPath(targetActionURL);
       component.queueEvent( new AjaxEvent(component));
       context.renderResponse();
    } else {
      String targetViewId = (String)context.getExternalContext().getRequestParameterMap().get("targetViewId");
      if(targetViewId != null) {
        dialogEvent.setSourceViewId(targetViewId);
      }
      DialogContext parentContext = dcontext.getParentContext();
      dcontext.deactivate();
          if(parentContext != null) {
        DialogContextManager.getInstance(context).setActiveRequest(parentContext.getDialogId());
          } else if("closeall".equals(action)) {
          DialogContextManager.getInstance(context).setActiveRequest(null);
      } else {
          DialogContextManager.getInstance(context).setActiveRequest(null);
      }
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.