You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by "Bertrand, Shawn R" <sh...@tycoelectronics.com> on 2007/03/22 17:19:20 UTC

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

 


RE: Dialog position

Posted by "Bertrand, Shawn R" <sh...@tycoelectronics.com>.
Mark,

Yeah, I suspected that would work, though I was hoping to not have to
implement an ActionListener in order to add window position control.

I'd expect windowTop and windowLeft attributes would be better
enhancements though, given their analogous counterparts in javascript.

Shawn


-----Original Message-----
From: Mark Millman [mailto:mark.millman@mizar.com] 
Sent: Thursday, March 22, 2007 3:16 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position

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

 



RE: Dialog position

Posted by William Hoover <wh...@nemours.org>.
When I do that I still get the 404 error.

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200609.mbox/%3C6dac79b90609151019m73bbd927p86666af89cf934a9@mail.gmail.com%3E

-----Original Message-----
From: Bertrand, Shawn R [mailto:shawn.bertrand@tycoelectronics.com]
Sent: Friday, March 23, 2007 10:27 AM
To: William Hoover; adffaces-user@incubator.apache.org
Subject: RE: Dialog position


William,

You'd just need to refer to *.jsf pages as *.faces in your view
directives.  We do the same thing to process *.jsp files in our app.

Shawn


-----Original Message-----
From: William Hoover [mailto:whoover@nemours.org] 
Sent: Thursday, March 22, 2007 7:29 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position

Do we still have to use:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>

instead of:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

to get the dialogs to work without getting the 404 Not Found
"__ADFv__.jsf"? 

-----Original Message-----
From: Mark Millman [mailto:mark.millman@mizar.com]
Sent: Thursday, March 22, 2007 3:16 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position


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

 





RE: Dialog position

Posted by "Bertrand, Shawn R" <sh...@tycoelectronics.com>.
William,

You'd just need to refer to *.jsf pages as *.faces in your view
directives.  We do the same thing to process *.jsp files in our app.

Shawn


-----Original Message-----
From: William Hoover [mailto:whoover@nemours.org] 
Sent: Thursday, March 22, 2007 7:29 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position

Do we still have to use:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>

instead of:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

to get the dialogs to work without getting the 404 Not Found
"__ADFv__.jsf"? 

-----Original Message-----
From: Mark Millman [mailto:mark.millman@mizar.com]
Sent: Thursday, March 22, 2007 3:16 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position


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

 




RE: Dialog position

Posted by William Hoover <wh...@nemours.org>.
Do we still have to use:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>

instead of:

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

to get the dialogs to work without getting the 404 Not Found "__ADFv__.jsf"? 

-----Original Message-----
From: Mark Millman [mailto:mark.millman@mizar.com]
Sent: Thursday, March 22, 2007 3:16 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Dialog position


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

 




RE: Dialog position

Posted by Mark Millman <ma...@mizar.com>.
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