cancel
Showing results for 
Search instead for 
Did you mean: 

Endless event loop for dialog window causes stack oveflow

Former Member
0 Kudos

The wdFireEvent* call in the controller keeps firing itself and causes a stack overflow from the endless loop. I see in debug that the dialog is only calling the fire event once when the close button in clicked. Also put a breakpoint in the handler on the view that launches the dialog but the handler code never gets touched.

I have:

- controller event DialogClickedEvent

- view method handleDialogClickEvent() as:

Event Source: <the controller name>

Subscribed Event: DialogClickedEvent <the controller name>

The window instance is being saved after window.open() but since the handler code never gets called it doesn't get a chance to get the instance ID and destroy it.

Anyone ever see this happen?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The event is fired from a popup dialog in the main view.

In main view:

The dialog is created when an error is displayed in a UI MessageArea

IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("IPSList");

IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);

window.setWindowPosition(300, 150);

window.setTitle("Multiple Sales Org for PRESALES");

window.open();

wdContext.currentSalesAreaPopupElement().setWindowInstance(window);

event handler (Event Source = TimeEntryComp , Subscribed Event = ChooseAreaEvent)

IWDWindow window = wdContext.currentSalesAreaPopupElement().getWindowInstance();

window.destroy();

In dialog: (user selects either Update or Cancel button -> both end up firing same event)

Button click OnAction:

wdThis.wdGetTimeEntryCompController().fireChooseAreaEvent();

In controller:

event: ChooseAreaEvent

method:

public void fireChooseAreaEvent( )

{

//@@begin fireChooseAreaEvent()

wdThis.fireChooseAreaEvent();

//@@end

}

I was originally just going to use IWDConfirmationDialog but got the missing button bug with MessageManager.

vmadhuvarshi_
Contributor
0 Kudos

Mike,

The code looks fine to me. have you redeployed and tested the application?

Vishwas.

Former Member
0 Kudos

Hi,

Try modifying the code like this especially the last bit:


public void fireChooseAreaEvent( )
{
//@@begin fireChooseAreaEvent()
wdThis.wdFireEventChooseArea();
//@@end
}

Regards,

Satyajit.

Answers (2)

Answers (2)

Former Member
0 Kudos

That was it - looks like I left out the "wd".

Thanks!

Former Member
0 Kudos

Hi Mike,

Please explain me when you fire this event ?.

You have created the event, probably you might have created a method which fires this event. when and where do you call this event ?

You also need to understand that when you fire this event , your view should be alive in the assembly. Then only your view can catch this event and hadle it.