Two Buttons with ShowPopup on Same Applet

ShowPopup method is yet another old timer method that I have deployed more than a couple of times.

ShowPopup is self explanatory – the method is used on a button and it will enable you to popup a defined applet on top of the base applet. Of course, the base can itself be a popup applet – at times we are entitled for some fun at the users’ expense.

Defining a button with ShowPopup is easy.

  1. Create a button on applet with ‘Method Invoked’ as ShowPopup
  2. Define the following user properties for the control

All is fine up to this point. But, what if you have two popup buttons? That is simple enough – create two buttons and repeat the above story.

But, what if you want to write code to be triggered on click of the popup button?

Typically the named method is used to trigger off custom code before the actual method is invoked in case of other methods.

If there are two buttons with the same method called “ShowPopup”, we have a problem recognizing just when the logic needs to be triggered. As Siebel developers we are well aware of this complexity coming towards us from the darkest corners.

And, as Siebel developers, we know there are plenty of work around solutions.

Turns out, you can just invoke a custom method and use one of the myriad OOB services to trigger popup applets after the custom code.

To do this –

  1. Create a button on applet with ‘Method Invoked’ as “DoSomethingSuper”
  2. Write the following code in the PreInvokeMethod
  3. Create a function called HandlePopup

That is it!

Now you have your own super and amazing logic that will trigger for a specific button click and will later invoke the popup.

But, do note that all is not well with this approach. If you try to popup another applet on top of the popup applet invoked through the above method, you will get the below error

There is no known work around other than simplifying the crazy things you are attempting to do.

Leave a Reply

Notify of