Problem with ZenURL-string given to a dialog-window

53 views
Skip to first unread message

Hanseat

unread,
May 2, 2008, 12:45:29 PM5/2/08
to InterSystems: Zen Community
Hello,

I tried to give two URL strings to a dialog window and get these back
there into variables. In the code I can write whatever I want but it
doesn't give me one of the variables back. First I have suggested
that
I have to encode the url with encodeURI, encodeURIComponent or escape
before I call the dialog window, but it doesn't change anything. If
somebody can help me with this I am really satisfied. My Code is:


In the parent page:


[..]
Method changeColumns() [ Language = javascript ]
{
var table = zenPage.getComponentById('table');
var tableColumns = table.getProperty('columns');
var columns = "";
var marked = "off";
var headers = "";
for(i=1; i<tableColumns.length-1; i++){
headers += tableColumns[i].getProperty('header')+'|';
}
headers += tableColumns[i].getProperty('header');
for(i=1; i<tableColumns.length-1; i++){
marked = tableColumns[i].getProperty('hidden') ?
'off' : 'on';
//columns += tableColumns[i].getProperty('colName')
+'='+marked
+'|';
columns += marked+'|';
}
marked = tableColumns[i].getProperty('hidden') ? 'off' :
'on';
//columns += tableColumns[i].getProperty('colName')
+'='+marked;
columns += marked;
var adresse = 'de.logisticus.user.gui.ColumnDialog.cls?
headers='+headers+'&columns='+columns
// This alert still shows me the right values!
// alert('adresse='+adresse);


zenLaunchPopupWindow(zenLink(adresse),'showHideColumns','status,scrollbars,­
resizable,width=700,height=550');


}


[..]

In the dialog page:


[..]
/// Contents of the dialog body.
XData dialogBody [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<pane id="dialogBody" xmlns="http://www.intersystems.com/zen">
<vgroup id="displayColumnGroup">
</vgroup>
</pane>



}


Method %OnAfterCreatePage() As %Status
{
Set group = %page.%GetComponentById("displayColumnGroup")
Set headers = %page.headers
Set ^pk($ZH) = headers
Set columns = %page.columns
Set ^pk($ZH) = columns
Set x = 1
While ($PIECE(headers, "|", x) '= "") {
Set header = $PIECE(headers, "|", x)
//Set ^pk($ZH)="header="_header
Set marked = $PIECE(columns, "|", x)
//Set ^pk($ZH)="marked="_marked
Set checkbox = ##class(%ZEN.Component.checkbox).
%New()
Set checkbox.id = "wahl"_x
Set checkbox.caption = header
Set checkbox.value = marked
Do group.%AddChild(checkbox)
Set x = $INCREMENT(x)
}

Set buttonOk=%page.%GetComponentById("btnOK")
Set buttonOk.caption = "OK"
Set buttonCancel=%page.%GetComponentById("btnCancel")
Set buttonCancel.caption = "Abbrechen"
Quit $$$OK


}


[..]

Hanseat

unread,
May 2, 2008, 12:46:33 PM5/2/08
to InterSystems: Zen Community
Best regards,

Philip

Hanseat

unread,
May 5, 2008, 5:38:55 AM5/5/08
to InterSystems: Zen Community
I have yet the reason and it seems a bit tricky: you may not create
following property (strictly written like I write it) in a Dialog Page
and pass a url string value to it:

Property columns As %String(ZENURL = "columns");

It's deadly! Please test it. Still I've no reasonable solution for
this behaviour. Maybe it's an internal property or any used codeword.

Best regards,

Philip

Hanseat

unread,
May 5, 2008, 6:43:49 AM5/5/08
to InterSystems: Zen Community
P.S.: Strangely this problem only appears when the column-value-string
of the posted code is used and these two pages work together. Does
somebody have a reasonable solution for that?

Jill Singer

unread,
May 5, 2008, 2:32:29 PM5/5/08
to InterSys...@googlegroups.com
Philip-

Try using the request object; as in:
(use in a cache object script code block)

Set headers = %request.Get("headers")
Set columns = %request.Get("columns")

-Jill

Hanseat

unread,
May 6, 2008, 5:43:14 AM5/6/08
to InterSystems: Zen Community
Thanks for your answer, Jill. Now I have easily renamed my Property
and it worked.

Best regards,

Philip

Hanseat

unread,
May 6, 2008, 5:53:36 AM5/6/08
to InterSystems: Zen Community
The next time I will remember your code and use it, Jill ;)
Reply all
Reply to author
Forward
0 new messages