ExternalLink is used to provide a URL which may be used outside the
context of a Tapestry webapp to link back into the webapp.  The target
Tapestry page needs to implement IExternalPage and the
activateExternalPage method, and it is up to your app to do whatever it
wants with the parameter array passed to this method.

I think what you are wanting is to provide links to external
(non-Tapestry) applications from within a Tapestry app.  There are many
ways to do this, but two common ways are to either use the @Any
component to build the URL within your .html (or .page) directly, or a
possibly cleaner way is to build the URL strings within your .java page
handler.

Using the @Any solution:

<a jwcid="@Any" href='ognl: "http://maps.yahoo.com/maps_result?addr="; +
location.address.line + "&csz=" + location.address.city'> Yahoo Map </a>

Using the .java method solution:

public String getYahooUrl()
{
   String url = "http://maps.yahoo.com/maps_result";;
   url += "?addr=" + getLocation().getAddress().getLine();
   url += "&csz=" + getLocation().getAddress().getCity();
   return url;
}

<span jwcid="@Insert" value="ognl:yahooUrl" raw="ognl:true"/>


Shawn


Quoting Scott Sauyet <[EMAIL PROTECTED]>:

> I'm brand-new to Tapestry.  I've read the tapestry-user list back 
> through the beginning of the month (200 messages already!)  I've been
> 
> through a basic tutorial, and can do some simple things with
> Tapestry, 
> but I haven't yet really gotten a feel for it.  I suspect the
> question 
> below is pretty naive, but I'm hoping someone has a few minutes to 
> either suggest a solution or point me to an appropriate reference. 
> BTW, 
> although new to Tapestry, I'm fairly experienced with Java and XML,
> and 
> have used several other web framworks (Struts, SpringMVC).
> 
> ----------
> 
> I want to create links to external pages based on internal data.  The
> 
> url parameters would be based on data stored in one of my objects. 
> In 
> PHP or JSP I would use processing instructions inside the href
> attribute 
> of my template to grab the data.  I'm not sure how to do it here.
> 
> More specifically, I'm used to doing something like (in some
> pseudo-app 
> syntax):
> 
>      <p>View this location in <a 
>
href="http://maps.google.com/maps?q=<?location.address.line?>+<?location.address.city?>+<?location.address.state?>+<?location.address.zip?>">Google
> 
> Maps</a>
>      or <a 
>
href="http://maps.yahoo.com/maps_result?addr=<?location.address.line?>&csz=<?location.address.city?>+<?location.address.state?>+<?location.address.zip?>&country=us">Yahoo
> 
> Maps</a>
>      or <a 
>
href="http://www.mapquest.com/maps/map.adp?country=US&addtohistory=&searchtab=home&address=<?location.address.line?>&<?location.address.city?>&state=<?location.address.state?>&zipcode=<?location.address.zip?>">Mapquest</a>.
>      </p>
> 
> The point is that the address components (zip, citey, state, etc.)
> are 
> properties of an Address object, which is a property of the Location
> 
> object known to the page.
> 
> What would be the Tapestry way of building this?  I see the
> ExternalLink 
> class, and am wondering if that's what I need, and if that's the
> case, 
> do I need to build separate supporting classes for each of those 
> different URL styles?  Should I be using some other Tapestry object? 
> Or 
> is there a more direct way to embed this data in the page? 
> Everything I 
> see allows me to embed data in HTML elements, but I dont' see how I 
> might extend this to embedding data in attributes.
> 
> So... any suggestions?  Pointers to the right portions of the fine 
> manual?  Or to a working example which does this?
> 
> Thanks for any help you can offer,
> 
>    -- Scott Sauyet
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to