cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

JavaScript error when using HoverMenu

Former Member
0 Likes
269

Hi All,

´

i´m using a hovermenu for my links in my toolbar. With hoveritem.setClientSideScript("javascript:EPCM.doNavigate(.....)"); i would like to handle the navigation to the target. I found an older Thread where the same Problem is explained. ()

Can Anybody help me?

Alternative i can handle the navigation with hoveritem.setLinkReference("http://.....);

but in this case the context especially the History get lost. The right way is to use EPCM.doNavigate. But how can i use this with a Hovermenu??

Regards,

Peter Koop

View Entire Topic
former_member189428
Contributor
0 Likes

hi peter,

here i give the code try like that , in my case it is working.

Link l = new Link("LINK_" + nodeCount, title);

String navigationAction = "EPCM.doNavigate('" + node.getName() + "',2)";

l.setOnClientClick(navigationAction);

treeNode.setComponent(l);

try like that if u have any problem let me know.

JagadishBabu Nagarapu

Former Member
0 Likes

Hi JagadishBabu,

thanks for your post, but this codesnippet don´t solve my problem.

Maybe i have to post my codesnippet.

.....

HoverMenu menu = new HoverMenu("Menu");

String link = navurl://.....;

HoverMenuItem item = new HoverMenuItem(1, "test");

IPortalComponentURI componentURI = request.createPortalComponentURI();

String myUrl = componentURI.toString();

String contlink = "http://" + myUrl +"?NavigationTarget=" + link;

item.setClientSideScript("javascript:EPCM.doNavigate('ROLES://"contlink"')");

menu.addMenuItem(item);

....

Everthing is going fine, but if i hit the menuitem the browser throws a javascript error:

'EPCM' is undifined.

I don´t know why my IView can´t find EPCM or the relevant .js file.

I hope i could exlpain my Problem. Can you give me advice?

regards

Peter

former_member189428
Contributor
0 Likes

Hi Peter,

is there any restriction compulsary using EPCM here

with out using EPCM can i send my code??? . u r trying lightframe work environment??

Former Member
0 Likes

I don´t have to use EPCM but if i use instead of item.setClientSideScript(....)

item.setLinkReference(...) it works fine. I can navigate to the target, but my context is going lost. The history is empty because a full reload is done. I want only a reload of the contentarea. I tried it with item.setLinkTarget("_self") and so on, but there was no solution for this misery.

In my opinion i have to use EPCM.doNavigate(...)

Of course you can send your suggestion wihtout EPCM. I would like to see it.

No, i´m using the preview of the standard framework with my iview for testing.

regards,

Peter

former_member189428
Contributor
0 Likes

hi peter refer my code we made Hover Menu Light Frame Work

it is use ful to you go through it.

<%@ taglib uri="NavigationTagLibrary" prefix="nav" %>

<%@ taglib uri="FrameworkTagLibrary" prefix="frm" %>

<%-- variable for resources such as images --%>

<%

String mimeUrl = componentRequest.getWebResourcePath();

%>

<%@ include file="header_style.jsp" %>

<script type="text/javascript">

makeHoverable = function(navigationDiv) {

if (!document.all) return; // continue only for IE

var liEls = document.getElementById(navigationDiv).getElementsByTagName("LI");

for (var i=0; i<liEls.length; i++) {

liEls<i>.onmouseover = function() {

this.className += " hover";

}

liEls<i>.onmouseout = function() {

this.className = this.className.replace(new RegExp(" hover
b"), "");

}

}

}

</script>

<div id="logo"><img src="<%=mimeUrl%>/images/bg-leaves.gif"></div>

<div id="message">Welcome to ACS SYSTECH INTEGRATORS .</div>

<div id="welcome">

<nav:ifNotAnonymousUser>

<frm:userFirstName /> <frm:userLastName />

</nav:ifNotAnonymousUser>

<nav:ifAnonymousUser>

Guest

</nav:ifAnonymousUser>

</div>

<%-- a simple breadcrumb so the user can see where they are in the navigtion tree --%>

<div id="breadcrumb">You are here:

<%-- iterate through all the nodes in the current nav path --%>

<nav:iterateNavNodesInSelectedPath>

<nav:navNodeAnchor navigationMethod="byURL"/>

<%-- output '->' to separate the nodes, but only if there are more to come --%>

<nav:ifHasMoreIterations>-></nav:ifHasMoreIterations>

</nav:iterateNavNodesInSelectedPath>

</div>

<%-- this is the main navigation section --%>

<div id="branding">

<div id="navigation">

<%-- start the unordered list --%>

<ul>

<nav:launchedNavNode navNode="myNode">

You are in: <%=myNode.getTitle(request.getLocale())%>

</nav:launchedNavNode>

<br>

<br>

<%-- the following displays titles of siblings --%><nav:launchedNavNode>

<nav:navNodeParent>

<nav:iterateNavNodeChildren>

<nav:navNodeTitle/>

</nav:iterateNavNodeChildren>

</nav:navNodeParent>

</nav:launchedNavNode>

<nav:iterateInitialNavNodes>

<li class='Level1'><nav:navNodeAnchor navigationMethod="byURL" />

<nav:ifNavNodeHasChildren>

<ul>

<%-- again go through all the nodes in level 2 --%>

<nav:iterateNavNodeChildren>

<li class='Level2'><nav:navNodeAnchor navigationMethod="byURL" /></li>

</nav:iterateNavNodeChildren>

</ul>

</nav:ifNavNodeHasChildren>

</li>

</nav:iterateInitialNavNodes>

</ul>

</div>

</div>

<nav:iterateNavNodeChildren>

<li class='Level2'><nav:navNodeAnchor navigationMethod="byURL" /></li>

</nav:iterateNavNodeChildren>

</ul>

<!</nav:ifNavNodeHasChildren>>

</li>

</nav:iterateInitialNavNodes>

</ul>

</div>

</div>

<script>makeHoverable("navigation");</script>

peter in this code i included one file that style sheet only

i hope it is helps you to solve your problem.

JagadishBabu

Former Member
0 Likes

Hi JagadishBabu,

thank you very much for your post, but i solved my porblem already.

At runtime my Iview couldn´t find the js13_epcf.js

i have bound it in the PageToolbar.java. Now everything is going fine.

regards, Peter Koop