Greetings.
What is the idiomatic RT/Mason way to do redirects?
I have a small component I’ve added to the ShowSummary page, and I want
to post a form back to that component, and then redirect to the
ShowSummary page.
(This is to avoid having to put the form on a separate page, which would
solve the problem, I realise, but that’s not what the boss wants.)
Thanks,
Jens
Greetings.
What is the idiomatic RT/Mason way to do redirects?
I have a small component I’ve added to the ShowSummary page, and I want
to post a form back to that component, and then redirect to the
ShowSummary page.
(This is to avoid having to put the form on a separate page, which would
solve the problem, I realise, but that’s not what the boss wants.)
Thanks,
Jens
http://www.masonhq.com/docs/manual/Request.html
Search for “redirect”
Greetings.
What is the idiomatic RT/Mason way to do redirects?
I have a small component I’ve added to the ShowSummary page, and I want
to post a form back to that component, and then redirect to the
ShowSummary page.
(This is to avoid having to put the form on a separate page, which would
solve the problem, I realise, but that’s not what the boss wants.)
Thanks,
Jens
http://www.masonhq.com/docs/manual/Request.html
Search for “redirect”
Thanks, Todd.
But from grepping I notice that RT does not seem to use the $m
object directly. Is there some sort of abstraction layer here?
If so, how does this affect my ability to get the $m object,
and call a redirect using it?
Jens
Greetings.
What is the idiomatic RT/Mason way to do redirects?
I have a small component I’ve added to the ShowSummary page, and I want
to post a form back to that component, and then redirect to the
ShowSummary page.
(This is to avoid having to put the form on a separate page, which would
solve the problem, I realise, but that’s not what the boss wants.)
Thanks,
Jens
http://www.masonhq.com/docs/manual/Request.html
Search for “redirect”
Thanks, Todd.
But from grepping I notice that RT does not seem to use the $m
object directly. Is there some sort of abstraction layer here?
If so, how does this affect my ability to get the $m object,
and call a redirect using it?
It’s always available from a Mason component.
If so, how does this affect my ability to get the $m object,
and call a redirect using it?
It’s always available from a Mason component.
Thanks!
The only time I ever use Mason is when I’m hacking on RT, so
I’m still finding my way around…
Cheers,
Jens
We have a /Elements/Redirect object that we use for all redirection
(e.g. /Tickets/Display.html whenever a value is changed), so a browser
reload "does the right thing"™. The object includes two layers of
automatic redirection HTTP (very fast), and Javascript (pretty fast),
and if that fails there is a link. It is simple to use:
/Elements/Redirect
$page: the page you want to send the client to
@actions: array of Result strings that you want diplayed on the target page.
For exmple from our /Tickets/Display.html:
if(@Actions){
$m->comp(‘/Elements/Redirect’,
page => $RT::WebPath . ‘/Ticket/Display.html?id=’ .
$TicketObj->Id,
actions => @Actions);
return 1;
}
/Elements/Redirect
Please go to this location:
<%$page%>
<%init>
$session{'actions'} = \@actions;
$page = $RT::WebBaseURL . $page;
$r->headers_out->{'Location'} = $page;
<%ARGS>
$page => '/index.html'
@actions => undef
Joby Walker
ITI SSG, C&C, University of Washington
Jens Porup wrote:> On Thu, Jan 05, 2006 at 12:01:17AM -0500, Todd Chapman wrote:
On Thu, Jan 05, 2006 at 03:52:39PM +1100, Jens Porup wrote:
If so, how does this affect my ability to get the $m object,
and call a redirect using it?
It’s always available from a Mason component.
Thanks!
The only time I ever use Mason is when I’m hacking on RT, so
I’m still finding my way around…
Cheers,
Jens
Rt-devel mailing list
Rt-devel@lists.bestpractical.com
The rt-devel Archives
|