openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

setSelectedWorksetItem is not triggering the event worksetItemSelected

Open avgcoderlife opened this issue 10 years ago • 1 comments

Hello All,

First of all thanks to a wonderful SHELL component in the framework :+1:

I had one requirement to change the current set work set item. The setSelectedWorksetItem method works fine and I can see that after calling it with the desired workset id , the navigation cursor points to the worksetitem.

But my main problem is changing the selected work set item via this method is not invoking event "worksetItemSelected".

Due to this, it never comes to our logic of changing the content of the shell :(

I feel this might be a bug where even after changing the selected work set item , the relevant event is not triggered,

Can anyone please check on this . I tried to fix this problem by looking into SHELL js class but since I am new to JS, I am stuck :(

avgcoderlife avatar Dec 07 '15 08:12 avgcoderlife

Hi, this behavior is intentional,following the guideline that state changes triggered by the user does result in events, but state changes triggered by the application code does not. The rationale is that the application does not need to be informed when it triggers the change and hence already knows about the change. So the recommendation is that when your own code sets the selected item (which is not the main use-case, as normally the user triggers the change), it also calls the same function that is normally triggered by the event.

Regards Andreas

akudev avatar Dec 07 '15 09:12 akudev