on 09-26-2005 5:06 PM
Hi,
I need to create a link (in a jsp) to forced the navigation panel to collapse itself.
To do this in my jsp, I get back the script reference of the standard pageToolBar.par and I call the same javascript function as the one call by it.
So I have:
The reference script:
<script language='JavaScript' src='<%=componentRequest.getResource("com.sap.portal.layouts.framework", IResource.SCRIPT, "scripts/scenario/WAandNavPanel.js").getResourceInformation().getURL(componentRequest)%>'></script>
And the function called:
expNavPanel_onclick();
But it still does not work ...
Has somebody any idea ?
Thanks,
Fabien
PS: How can I forced other event as: call pageToolBar personnalize window ...?
You are correct, this method is in the javascript file, however, as long as you are using the standard portal this Javascript file is already included in the output to the browser. Therefore you would probably need something like the following
<script>
innerPage= "pcd:portal_content/com.sap.pct/every_user/general/com.sap.portal.frameworkpage/com.sap.portal.innerpage";
innerPageWindow = pageSupport.getIvuFrameWindow(innerPage);
innerPageWindow.collapsePanel();
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I just created a test component, which I have pasted the code below. This works fine. It basically consists of one line of Javascript. Now, depending on whether the iView is URL or EMBEDDED depends on which code you use.
I have tested both of the versions below and they work fine. I have only tested these when the iView is on a page and the page added to the workset.
I hope this helps
Darrell
EMBEDDED IVIEW
==============
public class CloseNavPanel extends AbstractPortalComponent{
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response){
StringBuffer output = new StringBuffer();
output.append("<a href=\"\" onClick=\"collapsePanel();return false;\">Close Nav Panel</a>\n");
response.write(output.toString());
}
}
URL IVIEW
=========
public class CloseNavPanel extends AbstractPortalComponent{
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response){
StringBuffer output = new StringBuffer();
output.append("<a href=\"\" onClick=\"parent.collapsePanel();return false;\">Close Nav Panel</a>\n");
response.write(output.toString());
}
}
Hi Darell,
Thanks you for your response ..
This is what I have tried to do but it is not working.
In fact, the error can come from the fact that I would like to put the link (to collapse navigation window) in a specific toolbar iview that I have already created.
The iview does not belong to the inner page so I think it does not have the visibility of the javascriptfile or the navigation component.
Because I have made the test to copy the javascript file "WAandNavPanel.js" in my iview application, and when I call the function "collapsepanel", a NULL error is coming when trying to get the element by id "nav_panel_div"...
Do you have a idea ?
Thanks,
Fabien
Hi
The iView that you have created, where exactly has it been put. It will have visibility of the javascript file somewhere, as the portal loads this as part of the complete page builder cycle. DO NOT include the javascript file in your own component, as it probably has references to other javascript objects which do not have visibility from your iview.
So, where exactly is your iView. You say it isn't part of the innerpage, but anything that is placed below the top level navigation is part of the innerpage. If you could explain where exactly it has been put I may be able to help
D
Hi,
As you say: anything that is placed below the top level navigation is part of the innerpage.
But the one I use is put on the top on the level navigation.
I have:
1. A specific Masthead
2. A specific Toolbar (where is my iView)
3. The top level navigation
4. The inner page
So my Iview is not under the inner page ...
Thanks for your help,
Fabien
Hi
Lets try another variation then. I have tried this and it also works
Put the following script into your component that is displayed in the masthead (or actually it can be anywhere)
<script language="JavaScript">
innerPage= "pcd:portal_content/com.sap.pct/every_user/general/com.sap.portal.frameworkpage/com.sap.portal.innerpage";
innerPageWindow = top.pageSupport.getIvuFrameWindow(innerPage);
innerPageWindow.collapsePanel();
</script>
I hope this works
Fabien
Do you mean that the innerpage is embedded. The code that I provided above retrieves the frame for the innerpage frame and not the iview frame.
Basically you should be able to find out where the WAandNavPanel.js is and call the closepanel mathod from there. The only way to find this is to find out which frame contains this javascript file. Normally this is the innerpage, which is why the code above retrieves the innerpage frame and then calls the closepanel method.
I hope this helps
Darrell
Hello Darell,
By chance, have you an idea of how I could call the personnalize window of the pageToolbar ...?
I've tried:
var toolbarIvu = "pcd:portal_content/every_user/com.sopra.test_fco/desktop_portal_test_id/frameworkPages/frameworkpage/com.sap.portal.pageToolbar";
top.pageSupport.ivuPersonalize(toolbarIvu);
Without success ....
Thanks,
Fabien
Hi
you can call the Javascript method collapsePanel() which should collapse the navpanel
I hope this helps
Darrell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.