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.
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.
Can you show me the simple example to query menu from database ?
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
}
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 ?
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.-
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