Welcome Guest Search | Active Topics | Sign In | Register

Slide menu problem Options
mohan
Posted: Wednesday, September 3, 2008 11:15:07 AM
Rank: Newbie
Groups: Member

Joined: 9/3/2008
Posts: 5
hi ,

i am using client side monitor code when i am leaving the page,
if i select the No option i am getting the javascript error for slide menu

Thanks,
Mohana
eo_support
Posted: Wednesday, September 3, 2008 11:35:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

Thanks for posting in the forum. A JavaScript error occurs either due to a bug in our product, or a bug in your user code. In either case, we will be happy to take a look to see if we can help. If the issue is in our code, we will try our best to provide a fix or a workaround. When the problem is in your user code, we will usually point out where the problems are but we will not be responsible for fixing it.

In order for us to work on an issue, we need detailed description of the error and steps to reproduce it because most of the time we need to see and debug the problem in order to find out the root cause. For simple problems that can be reproduced by the control itself, we usually require you to post the control definition; For complex problems that only occurs in a certain page, we usually need you to create a test page that demonstrates the problem. Without those information, it would be like shooting in the dark for us.

You may also wish to review our support policy at here:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1368

Thanks for understanding!
mohan
Posted: Wednesday, September 3, 2008 12:36:44 PM
Rank: Newbie
Groups: Member

Joined: 9/3/2008
Posts: 5
Thanks for your reply.

this is the following code i am using

when i am clicking the slide menu it showing javascript error when i select the No option

<body onbeforeunload="confirmIELeave()">

<script language="JavaScript" type="text/javascript" >
var bPrompt = true;
function DoNotPrompt(){
bPrompt = false;
}
function confirmIELeave() {
if (bPrompt) {
event.returnValue = "Do you want to quit without saving?";
}
}
</script>



eo_support
Posted: Wednesday, September 3, 2008 12:49:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

Thanks for the additional information. The follow post should provide a solution for this situation:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=780

Please feel free to let us know if you have any more questions!

Thanks
mohan
Posted: Wednesday, September 3, 2008 2:01:42 PM
Rank: Newbie
Groups: Member

Joined: 9/3/2008
Posts: 5
Thanks,

but i need the common functionality, when ever i am clicking the buttons in the page
the following code is only for specific to the slide menu

eo_support
Posted: Wednesday, September 3, 2008 2:13:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

I believe you can use both. You would use methods provided by the previous post to handle navigating to another page from the slide menu; You would also use your original code to handle the rest. The key is to limit your original code to only handle "the rest", which are situations not caused by the slide menu. This can be achieved simply by setting a variable in the slide menu's on click event handler and check for this variable in your code. The following sequence should explain how it works:

1. If user clicks the slide menu to leave the current page, the slide menu handler will displays the message box to ask user whether he/she wants to continue without saving;
2. If user choose "No", then nothing happens;
3. If user choose "Yes", then you would set the flag;
4. The page continue to run and your onbeforeunload will be called;
5. Inside your confirmIELeave, you check whether the flag has already been set. If it has already been set, it means the situation has already been handled. In this case you do nothing;
6. Otherwise set e.returnValue to display the message;

If user exits the page from something else other than the slide menu, then the slide menu is not involved and your original code works fine.

Hope this helps.

Thanks
mohan
Posted: Wednesday, September 3, 2008 2:35:31 PM
Rank: Newbie
Groups: Member

Joined: 9/3/2008
Posts: 5
i am not understanding the following statement please can you explain
how to cancel this event
eo_CancelEvent();


function on_item_click(e, info)
{
if (!window.confirm("Are you sure"?))
eo_CancelEvent();
}
eo_support
Posted: Wednesday, September 3, 2008 2:42:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

eo_CancelEvent is a function provided by us. When user clicks a slide menu item, without calling that function the slide menu would go ahead and navigate to the page you specified with NavigateUrl property; If you call that function then it won't do that.

If you still have any questions, you will want to first go over this topic:

http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.html

And check out document sections below this topic, such as "JavaScript Objects", "Global Functions" etc. For example, you can find detailed information about eo_GetObject under "Global Function".

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.