on 04-11-2007 3:04 PM
Dear all,
Is it possible to implement a custom iwdbutton with an extra property "roles". @designtime we can then type the names of the role(s) a user needs for this button to be visible... If this is possible we only ahve to implement the piece of code to determine if the button has to be visible one time. otherwise we have to implement it for every button separately and that's alot of work when there are a lot of buttons...
Kind regards,
J.
Joren,
Creating IWD* interfaces implementations is a privilege of SAP WD team, mere mortals like me and you may not implement this interfaces or, actually, just can't use their implementations.
However, try to rethink your problem: you want to control visibility of M buttons. There are probably N combinations of roles that defines visibility and N < M. So you can create N attributes of type Visibility, calculate their values in wdDoInit and bind "visible" property of buttons to respective attributes.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That really sucks
This means that if there's a new role it may be necessary to write new code.
If mortals could override some button methods like getVisibility() or whatever there methods are called to check if they have to show the button or not, we only needed to override that method to check if the user has the role(s) in the role property. New role only means new role adding @design in the property, but not implementing a new check in the code...
In another thread you said that that it's better to implement the code for the visibility attributes in the wdDoInit() in stead of in a calculation method of the attribute... Is the difference in execution time really significant?
Joren,
I bet in your case it's preferred to calculate values only once in wdDoInit and do not use calculated attributes. Accessing roles from UME or other back-end source is a time-/resource- consuming operation and it's better to do it once rather then at every time page is rendered.
Valery Silaev
SaM Solutions
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.