You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Scott F. Walter" <sc...@vivare.com> on 2005/05/10 03:23:25 UTC

Popup and DirectLink

Hi,

Is there a way to have a popup where the url for the popup window is a 
@DirectLink.  I looked at the PopupLink inside the contrib package, but 
its for external links.

Thanks in advance,

scsott.
-- 

Scott F. Walter 	Scott F. Walter
Principal Consultant
Vivare, Inc.

E: scott.walter@vivare.com
E: scott@scottwalter.com
Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Popup and DirectLink

Posted by Paul Ferraro <pm...@columbia.edu>.
Yes - all link components have a "renderer" parameter.  Bind this to an 
instance of org.apache.tapestry.contrib.link.PopupLinkRenderer.

Paul

Scott F. Walter wrote:

> Hi,
>
> Is there a way to have a popup where the url for the popup window is a 
> @DirectLink.  I looked at the PopupLink inside the contrib package, 
> but its for external links.
>
> Thanks in advance,
>
> scsott.



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Popup and DirectLink

Posted by "Scott F. Walter" <sc...@scottwalter.com>.
Patrick Casey wrote:

>	You could do something like this which I use in a part of my app:
>
>	Step 1: Define your Direct Link Normally.
>	Step 2: Add an onClick handler to your direct link that passes your
>URL and a question into your handler.
>	Step 3: Have your javascript prompt the user, manually postpend the
>new parameter, and then catch it in your listener.
>
>	Some code snippets that might help:
>
>	Setting up a link that calls a javascript hander
>
>	url = cycle.getEngine().getService(Tapestry.DIRECT_SERVICE).getLink(
>				cycle, this, parameters).getURL();
>		// space(writer);
>		handler = PROMPT_FUNCTION + "('" + url
>				+ "', 'Question Goes Here:');return false;";
>		addOneLink(writer, url, "New Public Tag", "tag", handler);
>
>	A sample javascript handler function
>
>function promptForParam(url, question) {  
>  var result = prompt(question, "");
>  if (result != null && result != "") {
>  	var newurl = url + "&sp=S" + result;
>  	window.location = newurl;
>  }
>  return false;
>}
>
>  
>
>>-----Original Message-----
>>From: Scott F. Walter [mailto:scott.walter@vivare.com]
>>Sent: Monday, May 09, 2005 6:23 PM
>>To: tapestry-user@jakarta.apache.org
>>Subject: Popup and DirectLink
>>
>>Hi,
>>
>>Is there a way to have a popup where the url for the popup window is a
>>@DirectLink.  I looked at the PopupLink inside the contrib package, but
>>its for external links.
>>
>>Thanks in advance,
>>
>>scsott.
>>--
>>
>>Scott F. Walter 	Scott F. Walter
>>Principal Consultant
>>Vivare, Inc.
>>
>>E: scott.walter@vivare.com
>>E: scott@scottwalter.com
>>Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>
Paul posted something like this in the past:

url = cycle.getEngine().getService(Tapestry.DIRECT_SERVICE).getLink(
				cycle, this, parameters).getURL();
		// space(writer);
		handler = PROMPT_FUNCTION + "('" + url
				+ "', 'Question Goes Here:');return false;";
		addOneLink(writer, url, "New Public Tag", "tag", handler);

His example was putting up a javascript prompt, but you could have the "handler" variable be a javascript open() function with the desired window attributes



-- 

Scott F. Walter 	Scott F. Walter
Principal Consultant
Vivare, Inc.

E: scott.walter@vivare.com
E: scott@scottwalter.com
Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Popup and DirectLink

Posted by Patrick Casey <pa...@adelphia.net>.
	You could do something like this which I use in a part of my app:

	Step 1: Define your Direct Link Normally.
	Step 2: Add an onClick handler to your direct link that passes your
URL and a question into your handler.
	Step 3: Have your javascript prompt the user, manually postpend the
new parameter, and then catch it in your listener.

	Some code snippets that might help:

	Setting up a link that calls a javascript hander

	url = cycle.getEngine().getService(Tapestry.DIRECT_SERVICE).getLink(
				cycle, this, parameters).getURL();
		// space(writer);
		handler = PROMPT_FUNCTION + "('" + url
				+ "', 'Question Goes Here:');return false;";
		addOneLink(writer, url, "New Public Tag", "tag", handler);

	A sample javascript handler function

function promptForParam(url, question) {  
  var result = prompt(question, "");
  if (result != null && result != "") {
  	var newurl = url + "&sp=S" + result;
  	window.location = newurl;
  }
  return false;
}

> -----Original Message-----
> From: Scott F. Walter [mailto:scott.walter@vivare.com]
> Sent: Monday, May 09, 2005 6:23 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Popup and DirectLink
> 
> Hi,
> 
> Is there a way to have a popup where the url for the popup window is a
> @DirectLink.  I looked at the PopupLink inside the contrib package, but
> its for external links.
> 
> Thanks in advance,
> 
> scsott.
> --
> 
> Scott F. Walter 	Scott F. Walter
> Principal Consultant
> Vivare, Inc.
> 
> E: scott.walter@vivare.com
> E: scott@scottwalter.com
> Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org