ZENURL

64 views
Skip to first unread message

Mike

unread,
Jul 16, 2008, 8:43:28 AM7/16/08
to InterSystems: Zen Community
Hi,

I'm trying to pass a parameter from a form page to a report page and
have tried the following.

<form page>
var route =
this.getComponentById("comboRouteErrorMain");

var width = 800;
var height = 600;
var left = (screen.width - width)/2;
var top = (screen.height - height)/2;
var params = 'width='+width+', height='+height;
params += ', top='+top+', left='+left;
params += ', directories=no';
params += ', location=yes';
params += ', menubar=yes';
params += ', resizable=yes';
params += ', scrollbars=yes';
params += ', status=yes';
params += ', toolbar=no';


zenPage.launchPopupWindow(zenLink('BioRef.ReportingMonitorRouteErrors.cls')
+ '?route=' + route.value, 'Reporting Monitor Route Errors', 'params)


This seems to work since the page that pops up has the following URL.

http://localhost:57772/csp/brlzen/BioRef.ReportingMonitorRouteErrors.cls?route=10||1&$ZEN_POPUP=1

The report page has the following.

Property route As %ZEN.Datatype.string (ZENURL = "route");
<also tried>
Property route As %String (ZENURL = "route");
...
Method showRouteErrors() [ ZenMethod ]
{
s route=%request.Data("route")
s ^temp($h)=route
}

The method gets called and I get a null entry in ^temp.

Any ideas or if there is another way to do this?

w $zv
>Cache for Windows (x86-32) 2008.1 (Build 401) Tue Feb 26 2008 14:16:08 EST

IE. 6.0.2900.2180
FF 2.0.0.15

Thanks,
Mike

Ray Fucillo

unread,
Jul 16, 2008, 9:03:48 AM7/16/08
to InterSys...@googlegroups.com

On 7/16/2008 8:43 AM, Mike wrote:
> Property route As %ZEN.Datatype.string (ZENURL = "route");
> <also tried>
> Property route As %String (ZENURL = "route");
> ...
> Method showRouteErrors() [ ZenMethod ]
> {
> s route=%request.Data("route")
> s ^temp($h)=route
> }
>
> The method gets called and I get a null entry in ^temp.
>
> Any ideas or if there is another way to do this?

route is a property of the page, so its %page.route in server code / zen
expressions, and zenPage.route in javascript

Mike

unread,
Jul 16, 2008, 9:14:15 AM7/16/08
to InterSystems: Zen Community
Yep, that was it.

I got the %request from the following post and it seemed like it
worked according to the replies. Did I misinterpret something?

http://groups.google.com/group/InterSystems-ZEN/browse_thread/thread/e01198628aca4f93/8deb1406c7235388?hl=en&lnk=gst&q=zenurl#8deb1406c7235388

Many thanks.

Ray Fucillo

unread,
Jul 16, 2008, 9:22:49 AM7/16/08
to InterSys...@googlegroups.com
Maybe there was some special case in that discussion you reference, but I'm not
sure. Using the CSP %request object may work, but now that I look at it more
closely you weren't using it correctly - you forgot the index. I think you'd
want %request.Data("route",1)

Anyway, I'm not sure if there's any reason to ever do it the CSP way. In ZEN
the easiest way to reference a property of a page, is as a property of the page
object: %page.route / zenPage.route.

Mike

unread,
Jul 16, 2008, 9:39:51 AM7/16/08
to InterSystems: Zen Community
I got <UNDEF> when using 's route=%request.Data("route",1)'.
When trying '%request.Get("route",1)' (as per the other post) I always
got '1' no matter what I selected.

Anyway, the %page works so I'm going with that.

Many thanks again.


On Jul 16, 9:22 am, Ray Fucillo <fuci...@intersystems.com> wrote:
> Maybe there was some special case in that discussion you reference, but I'm not
> sure.  Using the CSP %request object may work, but now that I look at it more
> closely you weren't using it correctly - you forgot the index.  I think you'd
> want %request.Data("route",1)
>
> Anyway, I'm not sure if there's any reason to ever do it the CSP way.  In ZEN
> the easiest way to reference a property of a page, is as a property of the page
> object: %page.route / zenPage.route.
>
> On 7/16/2008 9:14 AM, Mike wrote:
>
>
>
> > Yep, that was it.
>
> > I got the %request from the following post and it seemed like it
> > worked according to the replies.  Did I misinterpret something?
>
> >http://groups.google.com/group/InterSystems-ZEN/browse_thread/thread/...
>
> > Many thanks.
>
> > On Jul 16, 9:03 am, Ray Fucillo <fuci...@intersystems.com> wrote:
> >> On 7/16/2008 8:43 AM, Mike wrote:
>
> >>> Property route As %ZEN.Datatype.string (ZENURL = "route");
> >>> <also tried>
> >>> Property route As %String (ZENURL = "route");
> >>> ...
> >>> Method showRouteErrors() [ ZenMethod ]
> >>> {
> >>>    s route=%request.Data("route")
> >>>    s ^temp($h)=route
> >>> }
> >>> The method gets called and I get a null entry in ^temp.
> >>> Any ideas or if there is another way to do this?
> >> route is a property of the page, so its %page.route in server code / zen
> >> expressions, and zenPage.route in javascript- Hide quoted text -
>
> - Show quoted text -

Dave Runion

unread,
Jul 16, 2008, 9:53:33 AM7/16/08
to InterSys...@googlegroups.com
If I'm not mistaken, aren't the %request properties only passed/created as
part of a submit in a form? I could be wrong, just feel like I remember
that from somewhere in my now convoluted memory.

-Dave

Bill McCormick

unread,
Jul 16, 2008, 10:06:21 AM7/16/08
to InterSys...@googlegroups.com
Zen runs over CSP. For every page call there is a %request, %response
and a %session object still.

Method calls have %session and will have a %page depending on whether
its a class or an instance method


Bill McCormick
Product Manager
Development Technologies
+1 617 621 0600
bill.mc...@intersystems.com

logist

unread,
Jul 17, 2008, 3:32:17 AM7/17/08
to InterSys...@googlegroups.com
Hi Mike.

As we can see, you try to use %request from a ZenMethod. But ZenMethod is called
from browser, when the whole page is already served and user makes an AJAX call.
in AJAX call you don't have an access to %request properties of a page. This is
also true for CSP AJAX calls performed by #server()# syntax.

You have an access to %request only on an initial page generation. But anyway
you should avoid using %request directly, just to use same syntax in AJAX and
non-AJAX methods.

=logist (Sergei Shutov)
Dimas ltd., Khabarovsk

Mike пишет:
Reply all
Reply to author
Forward
0 new messages