unable to process hyperevent

1,222 views
Skip to first unread message

Orion Correa

unread,
Aug 11, 2011, 9:40:11 AM8/11/11
to intersys...@googlegroups.com

I’m getting an alert popping up only in Chrome (not Firefox or IE, don’t know about safari) that says,

“Unexpected status code, cannot process hyperevent (0)”

 

This occurs right before I redirect to a new page at the end of a save method. The really weird thing is that I only get this alert when saving new objects and only on this particular page. I have other pages that save new things and those are fine. Also, it does save the object and the next page displays correctly.

I read the thread from January and I made sure that I give my server side method a return value. I don’t override the onloadhandler and my method doesn’t throw an exception, just this alert box.

 

Any ideas?

 

Orion

Roberto

unread,
Aug 11, 2011, 9:58:48 AM8/11/11
to InterSystems: Zen Community
This could be that the session timed out, but you are saying that it
redirects to the new page and saves, so that's not the issue.

Are you using &js() in your server side method?

-Roberto

On Aug 11, 9:40 am, Orion Correa <Orion.Cor...@intersystems.com>
wrote:

Orion Correa

unread,
Aug 11, 2011, 10:18:45 AM8/11/11
to intersys...@googlegroups.com
I call the server side save method from a client javascript method, return a value from the server side method, then use a gotoPage in the client method to go the next page. I don't get an exception from the catch block in SaveComp. I get the test alert from the clientSaveComp() and then my "unable to process hyperevent" alert

ClientMethod clientSaveComp() [ Language = javascript ]
{
zenPage.SaveComp();
alert('test');
zenPage.gotoPage('ZenApp.Company.cls?CompanyId='+id);
}
Method SaveComp() As %Integer [ ZenMethod ]
{
try {
set failed = 0
TSTART
// saving info here
TCOMMIT
} catch {
TROLLBACK
set failed = 1
&js<alert('Error in Saving Company.');>
}
quit 'failed
}

-Roberto

--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en
Zen Community Terms and Conditions: http://groups.google.com/group/InterSystems-ZEN/web/community-terms-and-conditions

Derek Day

unread,
Aug 11, 2011, 10:23:44 AM8/11/11
to intersys...@googlegroups.com
broker debug

Drag the link above into your bookmark toolbar and turn it on (click the bookmark), just before you save the object. This should pop up the "hyperevent" (aka Ajax or ZenMethod) response in a separate window. Please paste the contents of that window to this thread. Please also include your $ZV string.

~Derek

Orion Correa

unread,
Aug 11, 2011, 10:52:58 AM8/11/11
to intersys...@googlegroups.com

Ok, here it is

 

// InvokeInstanceMethod: 12@%ZEN.Component.select:ReallyRefreshContents()

try {

var enc = this.window.document.getElementById('addlist');

zenASSERT(enc,"Unable to find enclosing element.",arguments);

enc.innerHTML = '<select class=\"select\" id=\"control_34\"        onchange=\"zenPage.getComponent(34).onchangeHandler();\">\r\n<option selected=\"1\" value=\"0\">New Address</option>\r\n<option  value=\"189049\"></option>\r\n</select>\r\n';

var comp = zenPage.getComponent(34);

            if (comp.overlayMode!=0) { comp.setOverlayMode(comp.overlayMode); }

            if (comp.onRefreshContents) { comp.onRefreshContents(); }

            zenInvokeCallbackMethod(comp.onrefresh,comp,'onrefresh');

            if (comp.exposeComponent) { comp.exposeComponent(); }

}

catch(ex) {

zenExceptionHandler(ex,arguments,'A JavaScript error occurred while invoking a server instance method.\nClass: %ZEN.Component.select\nMethod: ReallyRefreshContents\n');

}

// %EndChangeTracking: sync client with server changes

try {

}

catch(ex) {

zenExceptionHandler(ex,arguments,'A JavaScript error occurred in %EndChangeTracking.');

}

 

if (zenPage && zenPage.onServerMethodReturn) {

            zenPage.onServerMethodReturn('ReallyRefreshContents');

}

           

 

Cache for Windows (x86-64) 2011.1 (Build 496U) Tue May 10 2011 22:38:07 EDT

Orion Correa

unread,
Aug 11, 2011, 11:33:30 AM8/11/11
to intersys...@googlegroups.com

Ok, fixed it.

The problem was my server side save method was calling another method which updates some fields on the page because the save method didn’t move on to another page in a previous iteration of the page. And since the client method which started this whole chain of methods has a gotoPage command, Chrome was complaining because there were changes to the page which didn’t get applied since the method was moving to a new page.

 

 

Thanks,

Orion

Derek Day

unread,
Aug 11, 2011, 12:25:46 PM8/11/11
to intersys...@googlegroups.com
Is this something that is reasonable to handle within the application or the specific pages? Was the original code sub-optimal or does it seem that you should have expected it to work?

If you have an easily reproducible sample, could you please report this to the WRC? If I recall correctly this was treated as a Firefox bug when 3.5 or 3.6 started allowing XMLHttpRequests to be processed by a different page (they would allow a maps.google.com response to come back to your application if the back button was pressed at the right time). It looks as though FF 5, IE 9, and Chrome (not sure about Safari) or now restricting this to same domain responses -- but since it seems to apply to all browsers now, its probably necessary for Zen to handle this.

The HTTP response may be indicated that a response was received to an aborted request -- in which case 2011.2 may already provide the means for an application to handle it (Internal Ref: DDP304 - Improve HyperEvent error reporting)

The release notes for the improved error reporting should be in the 2011.2 documentation, but I haven't searched for them yet.

HTH,
Derek

On Thu, Aug 11, 2011 at 11:33 AM, Orion Correa <Orion....@intersystems.com> wrote:

Ok, fixed it.

The problem was my server side save method was calling another method which updates some fields on the page because the save method didn’t move on to another page in a previous iteration of the page. And since the client method which started this whole chain of methods has a gotoPage command, Chrome was complaining because there were changes to the page which didn’t get applied since the method was moving to a new page.

 

 

Thanks,

Orion

 

From: intersys...@googlegroups.com [mailto:intersys...@googlegroups.com] On Behalf Of Orion Correa
Sent: Thursday, August 11, 2011 10:53 AM

Subject: RE: [InterSystems-Zen] Re: unable to process hyperevent

 

Ok, here it is

 

// InvokeInstanceMethod: 12@%ZEN.Component.select:ReallyRefreshContents()

try {

var enc = this.window.document.getElementById('addlist');

zenASSERT(enc,"Unable to find enclosing element.",arguments);

enc.innerHTML = '<select class=\"select\" id=\"control_34\"        onchange=\"zenPage.getComponent(34).onchangeHandler();\">\r\n<option selected=\"1\" value=\"0\">New Address</option>\r\n<option  value=\"189049\"></option>\r\n</select>\r\n';

var comp = zenPage.getComponent(34);

            if (comp.overlayMode!=0) { comp.setOverlayMode(comp.overlayMode); }

            if (comp.onRefreshContents) { comp.onRefreshContents(); }

            zenInvokeCallbackMethod(comp.onrefresh,comp,'onrefresh');

            if (comp.exposeComponent) { comp.exposeComponent(); }

}

catch(ex) {

zenExceptionHandler(ex,arguments,'A JavaScript error occurred while invoking a server instance method..\nClass: %ZEN.Component.select\nMethod: ReallyRefreshContents\n');

Dawn Wolthuis

unread,
Aug 11, 2011, 3:33:23 PM8/11/11
to intersys...@googlegroups.com
This might not be helpful, but from a quick read I think it is relevant. We have a few places in our code where we threw up our hands re a hyperevent error, after changing everything we could easily change to run synchronously before exiting, and put in code like this before heading to another page

     window.setTimeout('zenPage.moveToPage(zenPage.returnPage, "");', 2000);

Of course until we really have users we will not know what that duration needs to be. This is really tacky, so if there is something else we ought to do, we will look into this again someday (and until then, hey, it is working!)  --dawn

Dawn M. Wolthuis

Take and give some delight today
Reply all
Reply to author
Forward
0 new messages