[rt-devel] RE: [rt-users] Callback component not workig quite right.
AJ
rt at musefoundry.com
Thu Jan 22 15:36:50 EST 2004
Actually I am having the same issue myself with Callbacks and accessing
values set within.
However, a simpler way to take care of your issue would be to add the
following code into the <%INIT> block of the SelectNewTicketQueue:
my $callargs=$m->caller_args(-1);
if ($callargs->{ValueOfQueue}) {
$Default=$callargs->{ValueOfQueue};
} elsif ($callargs->{Queue}) {
$Default=$callargs->{Queue};
}
That will set the default of the new ticket select to the queue you are in.
Now, back to callbacks:
The autohandler kicks off and runs the default callbacks by using
$m->comp($comp,%ARGS). I have a call back that runs and it initializes some
variables but of course, under strict refs their scope is confined to the
callback.
I have tried the <%once>, <%shared>, <%attr>, and tried the 'return' perl
function but when I look at the component stack, using RTIR for example, Ill
see the base autohandler, the RTIR autohandler, and the page that was
called. The callbacks are not in there. This makes sence since the callbacks
are simply methods called by the autohandler, however, how do I get an
attribute or something set in the callback run by the autohandler to be
available to a child of the autohandler. I am not sure I can add to the
%ARGS hash.
Can anyone point me in the right direction?
Thanks in advance
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Todd Chapman
Sent: Thursday, January 22, 2004 11:36 AM
To: rt-users at lists.fsck.com
Subject: [rt-users] Callback component not workig quite right.
I created the follow file in:
/opt/rt3/local/html/Callbacks/VW/Ticket/Elements/ShowLinks/Default
<tr>
<td>
</td>
<td>
<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html">
<input type="hidden" name="new-MemberOf" value="<%$Ticket->Id%>">
<&|/l, $m->scomp('/Elements/SelectNewTicketQueue', Default =>
"<%$Ticket->QueueObj->Id%>" )&><input type="submit" value="New child
in"> [_1]</&>
</FORM>
</td>
</tr>
<%ARGS>
$Ticket => undef
</%ARGS>
The problem is that I am trying to set the Default queue as being
the queue of the Ticket, but it doesn't work. The first queue in
the list is selected.
Any ideas?
Thanks!
-Todd
_______________________________________________
rt-users mailing list
rt-users at lists.bestpractical.com
http://lists.bestpractical.com/mailman/listinfo/rt-users
Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
More information about the Rt-devel
mailing list