I'd like to do that, but to get it to generate the correct URL I'd have to
know the current template and pane.  Otherwise, I'd have to either hard code
the pane id into the template (bad) or the object that renders the template
(even worse).  Ideally, the portlet would be freely relocatable without code
changes.

I can almost get what I want with rundata.getRequest().getRequestURL().
However, this doesn't work in the case where the portlet lives on the
default page and the following happens:
1) The user accesses the following page: http://myhost/jetspeed
2) The user selects an item on the list generated by the portlet
3) While viewing the item details, the user selects a new tab
4) The user clicks the "back" button in their browser
5) The user then attempts to click the "back" link generated by getting
getRequestURL(), which doesn't have pane information

This will result in the "back" button taking them to the last pane they
viewed, since that information is stored in the session.

It's obscure enough that I could live with it, but I'd rather just do it
right the first time.  Eventually a user will complain.

I also figure that it's handy to know how to programmatically get the
current correct URL, active pane, etc.

-- Michael


On 12/20/02 12:24 AM, "Raffaele Ragni" <[EMAIL PROTECTED]> wrote:

> i've always used used $jlink.addQueryData(name,value) to post some query
> parameters,
> to retrieve the url just $jlink. Though $jlink should be an older version of
> $jslink, now i don't remember what changes it had, but if i remember right i
> coudln't use addQueryData with that last one.
> 
> 
> ----- Original Message -----
> From: "Michael Rothrock" <[EMAIL PROTECTED]>
> To: "Jetspeed Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 19, 2002 9:00 PM
> Subject: Getting URL for current page
> 
> 
>> Hi!
>> 
>> I've had no luck with the archives or the source, so I thought I'd try the
>> list.
>> 
>> The question:
>> Does anyone know how to grab the URL for the currently displayed page,
>> including current pane etc.?
>> 
>> The context:
>> I have a portlet that displays a list of items.  Each item has a link to
> get
>> the detail for that item, which calls the current page with the item id in
>> the query parameters.  In an ideal world, it would also include the
> current
>> url as a query parameter, so the detail template can display an
> appropriate
>> 'back' link.
>> 
>> As far as I can tell, I need to get the current URL for both setting up
> the
>> link for item details (basically referencing the current page + the
> selected
>> item), and for the 'back' link.  I'm currently doing it with
> getTemplate(),
>> but that's too dependent on the location of the portlet, breaking as soon
> as
>> someone moves the portlet.
>> 
>> Any ideas?
>> 
>> Thanks!
>> 
>> -- Michael
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>> 
>> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


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

Reply via email to