View this page "irwan"

3 views
Skip to first unread message

ori...@gmail.com

unread,
Aug 14, 2007, 3:58:47 AM8/14/07
to InterSystems: Zen Community (Beta)

Click on http://groups.google.com/group/InterSystems-ZEN/web/irwan -
or copy & paste it into your browser's address bar if that doesn't
work.

Istvan Hahn

unread,
Aug 14, 2007, 5:16:55 AM8/14/07
to InterSystems: Zen Community (Beta)
The menuItem control is not designed that way.

You can either add the menuItems to the staticaly defined menu in the
%OnAfterCreatePage method of the page or subclass the original
%ZEN.Component.menuCell.cls and change the property types to
%ZEN.Datatype.expression + overwrite the %DrawMenuCell method with the
new class.

ori...@gmail.com

unread,
Aug 14, 2007, 10:03:28 PM8/14/07
to InterSystems: Zen Community (Beta)
Hai Hahn,

Can you show me the simple example to query menu from database ?

Istvan Hahn

unread,
Aug 15, 2007, 3:18:16 AM8/15/07
to InterSystems: Zen Community (Beta)
Here it goes:

PS: Sorry, the text is in Hungarian.

Istvan

This the XML menu definition:

<lookoutMenu id="lookout" expandable="false"
onexpand="zenPage.onlayoutHandler();"
oncontract="zenPage.onlayoutHandler();"
remember="true">
<tab caption="Epizód történet" id="menuEpizodok">
</tab>
<tab caption="Dokumentum archívum" id="menuDokumentumok">
</tab>
</lookoutMenu>

and this is the related code in the %OnAfterCreatePage

Method %OnAfterCreatePage() As %Status
{
If (..beteg '= "") {
// Load document details to menu.
#dim menu as %ZEN.Component.tab

Set menu = ..%GetComponentById("menuDokumentumok")
If (menu '= $$$NULLOREF) {
Set rs = ##class(%ResultSet).
%New("ask.model.DokumentumQuery:Navigator")
If (rs '= $$$NULLOREF) {
Set st = rs.Execute(..beteg)
If ($$$ISOK(st)) {
While rs.Next() {
#dim item as %ZEN.Component.menuItem
Set item = ##class(%ZEN.Component.menuItem).%New()
Set item.caption = rs.Get("irat_nev")_" / "_rs.Get("szerzo")_" /
"_rs.Get("modosit_ido")
Set item.title = "A dokumentum megtekintéséhez kattintson ide."
Set item.image = "/csp/broker/images/folder.gif"
Set item.link =
"javascript:zenPage.menuClick('ask.Dokumentum.cls','DOKUMENTUMBELSOID="_rs.Get("tab_pk")_"')"
Set st = menu.%AddChild(item)
}
}
}
}

}
Quit $$$OK
}

ori...@gmail.com

unread,
Aug 15, 2007, 5:46:48 AM8/15/07
to InterSystems: Zen Community (Beta)

I want to know , what you mean by :

If (..beteg '= "")

AND

Set st = rs.Execute(..beteg)

what is ..beteg ? Is it a column for the table (class) ?

AND

"javascript:zenPage.menuClick('ask.Dokumentum.cls','DOKUMENTUMBELSOID="_rs.­
Get("tab_pk")_"')"

what is 'DOKUMENTUMBELSOID ?
are the menu only link to the page ask.Dokumentum.cls ?

Hahn Istvan

unread,
Aug 15, 2007, 6:18:07 AM8/15/07
to InterSys...@googlegroups.com
beteg is a property of the page. That is a parameter to the predefined query
used by method. From data point of view, this is a column in a table.

the javascript stuff is an URL. It can be any arbitrary URL.

Istvan

----- Original Message -----
From: <ori...@gmail.com>
To: "InterSystems: Zen Community (Beta)" <InterSys...@googlegroups.com>
Sent: Wednesday, August 15, 2007 11:46 AM
Subject: [InterSystems-Zen] Re: Discussion on irwan


>
>
>
> I want to know , what you mean by :
>
> If (..beteg '= "")
>
> AND
>
> Set st = rs.Execute(..beteg)
>
> what is ..beteg ? Is it a column for the table (class) ?
>
> AND
>

> "javascript:zenPage.menuClick('ask.Dokumentum.cls','DOKUMENTUMBELSOID="_rs.-

ori...@gmail.com

unread,
Aug 20, 2007, 3:05:37 AM8/20/07
to InterSystems: Zen Community (Beta)
Dear Istvan ,

I have try to use the code but I still cannot query the the menu from
database .

Can you show me how to use the code according to my table below :

===========
= menu table =
===========
name link
-------- --------
yahoo http://www.yahoo.com
google http://www.google.com
gmail http://www.gmail.com

Reply all
Reply to author
Forward
0 new messages