Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How can I manage dynamically the menu options??

4 posts in Objects Last posting was on 2005-06-10 07:49:37.0Z
Pedro Posted on 2005-04-12 18:30:52.0Z
Sender: 3bbf.425c0e50.1804289383@sybase.com
From: Pedro
Newsgroups: sybase.public.powerbuilder.objects
Subject: How can I manage dynamically the menu options??
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <425c13d8.3c3b.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 12 Apr 2005 11:30:48 -0800, 10.22.241.42
Lines: 10
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Apr 2005 11:30:49 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Apr 2005 11:30:52 -0700
X-Trace: forums-1-dub 1113330652 10.22.108.75 (12 Apr 2005 11:30:52 -0700)
X-Original-Trace: 12 Apr 2005 11:30:52 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8327
Article PK: 735554

I need to have roles associated with menu options, and users
associated with roles. After that, I need to show or not the
option depending on the user connected.

My problem is that I don´t know how to assign a value to
the "visible" property dinamically.

I´ll appreciate if someone can help me!

Pedro Aguila


BMartins Posted on 2005-04-12 19:57:35.0Z
From: "BMartins" <beatriz@pred.com.br>
Newsgroups: sybase.public.powerbuilder.objects
References: <425c13d8.3c3b.1681692777@sybase.com>
Subject: Re: How can I manage dynamically the menu options??
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478
X-Original-NNTP-Posting-Host: 200222214094.user.veloxzone.com.br
Message-ID: <425c282b@forums-2-dub>
X-Original-Trace: 12 Apr 2005 12:57:31 -0800, 200222214094.user.veloxzone.com.br
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Apr 2005 12:57:32 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Apr 2005 12:57:35 -0700
X-Trace: forums-1-dub 1113335855 10.22.108.75 (12 Apr 2005 12:57:35 -0700)
X-Original-Trace: 12 Apr 2005 12:57:35 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8328
Article PK: 735553

My sujestion is:
1. create a NVO to manage the user access to menu.
2. create a function on this nvo like this:

// parameters = window aw_parent, integer ai_profile (you can use yours)
// return integer

m_mdi_mymenu lm_menu // your mdi menu

lm_menu = aw_parent.menuid

if not isvalid(lm_menu) or isnull(lm_menu) then return 1

choose case ai_profile
case 1
// access all
case 2
// access limited
lm_menu.m_f1.m_x1.enabled = false
lm_menu.m_f1.m_x1.visible = false
lm_menu.m_f1.m_x1.enabled = false
...
end choose

return 1


--
Regards
BMartins (Brazil)


<Pedro> escreveu na mensagem news:425c13d8.3c3b.1681692777@sybase.com...
I need to have roles associated with menu options, and users
associated with roles. After that, I need to show or not the
option depending on the user connected.

My problem is that I don´t know how to assign a value to
the "visible" property dinamically.

I´ll appreciate if someone can help me!

Pedro Aguila


Philip Salgannik Posted on 2005-04-12 22:18:18.0Z
Sender: 6b32.425c484f.1804289383@sybase.com
From: Philip Salgannik
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: How can I manage dynamically the menu options??
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <425c492a.6b77.1681692777@sybase.com>
References: <425c13d8.3c3b.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Apr 2005 15:18:18 -0700
X-Trace: forums-1-dub 1113344298 10.22.241.41 (12 Apr 2005 15:18:18 -0700)
X-Original-Trace: 12 Apr 2005 15:18:18 -0700, 10.22.241.41
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8330
Article PK: 735556

Take a look at PFC's pfc_n_cst_menu object

> I need to have roles associated with menu options, and
> users associated with roles. After that, I need to show or
> not the option depending on the user connected.
>
> My problem is that I don´t know how to assign a value to
> the "visible" property dinamically.
>
> I´ll appreciate if someone can help me!
>
> Pedro Aguila


Jamal Ahamd (jimi1977 Posted on 2005-06-10 07:49:37.0Z
Sender: 33f3.42a9446e.1804289383@sybase.com
From: Jamal Ahamd (jimi1977@hotmail.com)
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: How can I manage dynamically the menu options??
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42a94611.33fc.1681692777@sybase.com>
References: <425c13d8.3c3b.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 10 Jun 2005 00:49:37 -0700
X-Trace: forums-1-dub 1118389777 10.22.241.41 (10 Jun 2005 00:49:37 -0700)
X-Original-Trace: 10 Jun 2005 00:49:37 -0700, 10.22.241.41
Lines: 56
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8442
Article PK: 735669

Please read the folowing sample code. in this code i am
reading a menu and writing Text associated with each menu
item in multi line text control. You can also access enabled
and visibled property like i am accessing text property. If
you have user role and rights stored in database then you
should aslo save the menu text in the table by which you can
compare the text property of menu and make it visible or
enable.


string ls_str
int L1, L2, L3, L4
m_main_manu uo_menuObject1[], uo_Tmenu[], uo_menuObject2[],
uo_menuObject3[], uo_menuObject4[]

//uo_menuObject = m_main_manu.Item
uo_menuObject1 = m_main_manu.Item
ls_Str = "Main Menu -> "
for L1 = 1 to UpperBound(uo_menuObject1[])
mle_1.Text = mle_1.Text + uo_menuObject1[L1].Text +
"~r~n"
uo_menuObject2[] = uo_menuObject1[L1].Item
For L2 = 1 to UpperBound(uo_menuObject2[])
mle_1.Text = mle_1.Text + "~t" +
uo_menuObject2[L2].Text + "~r~n"
uo_menuObject3[] = uo_menuObject2[L2].Item
For L3 = 1 To UpperBound(uo_menuObject3[])
mle_1.Text = mle_1.Text + "~t~t" +
uo_menuObject3[L3].Text + "~r~n"
uo_menuObject4[] = uo_menuObject3[L3].Item
For L4 = 1 to UpperBound(uo_menuObject4[])
mle_1.Text = mle_1.Text + "~t~t~t" +
uo_menuObject4[L4].Text + "~r~n"
Next
uo_menuObject4[]= uo_Tmenu[]

Next
uo_menuObject3[] = uo_Tmenu[]

Next
uo_menuObject2[] = uo_Tmenu[]
next



//MessageBox("Menu", ls_Str)

> I need to have roles associated with menu options, and
> users associated with roles. After that, I need to show or
> not the option depending on the user connected.
>
> My problem is that I don´t know how to assign a value to
> the "visible" property dinamically.
>
> I´ll appreciate if someone can help me!
>
> Pedro Aguila