Thanks for stopping by,
Following code works fine:
<hbj:hoverMenu id="hover1" standAlone="false" > <hbj:hoverMenuItem id="1" text="New" onItemClick="itemClicked" > <hbj:hoverMenu id="hoversub12"> <hbj:hoverMenuItem id="1112" text="Folder" linkRef="http://www.sap.com" linkTarget="_self" /> </hbj:hoverMenu> </hbj:hoverMenuItem> <hbj:hoverMenuItem id="" text="Details" hoverItemDivider="true" /> <% hover1.setMenuTrigger(com.sapportals.htmlb.enum.HoverMenuTrigger.ONLRCLICK); %> </hbj:hoverMenu> <hbj:image id="image_logo2" alt="Image not available" hoverMenuId="hover1" src="" > <% IResource rs2 = componentRequest.getResource(IResource.IMAGE, "images/context.jpg"); image_logo2.setSrc(rs2.getResourceInformation().getURL(componentRequest)); %> </hbj:image>
It won't work if try to do this:
<%String hoverID="hover1";%>
<hbj:hoverMenu id="<%=hoverID%>" standAlone="false" > <hbj:hoverMenuItem id="1" text="New" onItemClick="itemClicked" > <hbj:hoverMenu id="hoversub12"> <hbj:hoverMenuItem id="1112" text="Folder" .... ... </hbj:image>
Whatz wrong with it?? Iam trying to generate 5 Such Menus and want to make these IDs unique in the for Loop..
Thanks again!
This is probably because the hoverMenu tag doesn't allow you to use inline script for the ID property. Therefore you could try somethine like
<%String hoverID = "hover1";%>
<hbj:hoverMenu id="hover" standAlone="false" >
<%
hover.setID(hoverID);
%>
</hbj:hoverMenu>
This may or may not work as I haven't tested it
D
Add a comment