Sandip,
The paneBarItemSelected does not seem to be getting fired when the same pane that is already open is being closed. I guess a framework 'paneClosing' event would have been really handy!
As far as I have seen, the sId property of a control corresponds to the DOM ID. (Haven't seen this documented anywhere, but I'm pretty sure this is the case).
Since this is the case, I feel it is safe to use jQuery with a UI5 control's sId property as our jQuery selector.
function helper() { $("#" + oShell.getPaneBarItems()[0].sId).off(); // Turn off our 'click' handler to avoid a stack overflow $("#" + oShell.getPaneBarItems()[0].sId).trigger("click"); //Simulate a click $("#" + oShell.getPaneBarItems()[0].sId).on("click", helper); //Turn on our click handler again } $("#" + oShell.getPaneBarItems()[0].sId).on("click", helper);
As an additional precaution, it is best to escape characters in the sId string before passing it as a selector, as mentioned here.
Hope this helps.
Regards,
Pritin