incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Millman" <mark.mill...@mizar.com>
Subject RE: Dialog position
Date Thu, 22 Mar 2007 19:15:37 GMT
We've been able to control the placement of server launched dialogs by
setting the windows properties as per the following example.

  public static void launchApprovalDialog(String title, String remark,
UIComponent source) {
    FacesContext context = FacesContext.getCurrentInstance();
    ViewHandler vh = context.getApplication().getViewHandler();
    UIViewRoot dialog = vh.createView(context, "/ApprovalDialog.jspx"); //
dialog:download does not work"

    HashMap winProps = new HashMap();
    winProps.put("width", new Integer(300));
    winProps.put("height", new Integer(200));
    winProps.put("left", new Integer(200));
    winProps.put("top", new Integer(200));
    HashMap props = new HashMap();
    props.put("title", title);
    props.put("remark", remark);
    if (source != null) {
      props.put("approveButton", Boolean.valueOf(true));
    } else {
      props.put("approveButton", Boolean.valueOf(false));
    }

    RequestContext afc = RequestContext.getCurrentInstance();
    afc.launchDialog(dialog, props, source, true, winProps);
  } 

It would be nice if the CoreCommand tags supported windowLeft and
windowRight in addition to windowHeight and windowWidth 

mark.millman@mizar.com | www.mizar.com 


-----Original Message-----
From: Bertrand, Shawn R [mailto:shawn.bertrand@tycoelectronics.com] 
Sent: Thursday, March 22, 2007 10:19 AM
To: adffaces-user@incubator.apache.org
Subject: Dialog position

Hello all,

 

Are we able to control position of dialogs displayed via buttons in a
JSP which use the "dialog:" notation in their action attributes?  The
dialogs always pop up with their top-left corner near the current
browser window's top-left corner, and I'd like to have them centered on
the window instead.

 

Thanks,

 

Shawn

 



Mime
View raw message