cancel
Showing results for 
Search instead for 
Did you mean: 

Custom IWDButton

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

http://www.sam-solutions.net

Former Member
0 Kudos

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?

Former Member
0 Kudos

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

http://www.sam-solutions.net

Former Member
0 Kudos

Indeed,

One time at init is enough because the visibility is most of the times dependent on the role of the user...

Thx for the replies.

Do you think that there will be the possibility to extend the iwd* interfaces in the near future?

J.

Former Member
0 Kudos

Not in NW04s, later maybe.

Armin

Answers (0)