在PAT中编辑页面目录时抛出Java脚本错误:portletsElement为空(portletsElement is null)_Tomcat, WebLogic及J2EE讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Tomcat, WebLogic及J2EE讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 4541 | 回复: 0   主题: 在PAT中编辑页面目录时抛出Java脚本错误:portletsElement为空(portletsElement is null)        下一篇 
lxk
注册用户
等级:上尉
经验:547
发帖:109
精华:0
注册:2011-8-18
状态:离线
发送短消息息给lxk 加好友    发送短消息息给lxk 发消息
发表于: IP:您无权察看 2011-12-1 13:38:04 | [全部帖] [楼主帖] 楼主

Editing Page Content in PAT Throws a Java Script Error: 'portletsElement is null'
Applies to:
Oracle WebLogic Portal - Version: 10.3.0 to 10.3.2 - Release: AS10gR3 to
Information in this document applies to any platform.
Symptoms
When attempting to edit the page content under a desktop using Portal Administration Console, the following java script error occurs in the browser. The issue is observed while adding or deleting a portlet into a page that has custom layout. The placeholder number is defined inside the .html.txt file starting from 1 to 'n', where 'n' is number of column required for the custom layout.
Java Script Error Message:
portletsElement is null
The issue could be reproduced by following below steps:
1. Log into the IDE and create a .portal file.
2. Define a custom layout with place holder number inside the .html.txt file starting from 1 to 'n', where 'n' is number of column required for the custom layout.
3. Select above custom layout for the Page 1 in the .portal file and drag some sample portlets into the placeholders.
4. Deploy the above changes and log into PAT. Create a new portal, for instance TestPortal and then create a desktop, for instance MyDesktop.
5. Navigate to portal management-->TestPortal-->MyDesktop-->mainbook-->Page 1
6. Click edit content and try to add or remove a portlet. Notice the java script error message.
7. You may receive success message after submitting the save button, but the changes will not be persisted due to the java script error.
Cause
This is a configuration issue related to placeholder number indexing. The custom layout placeholder number is defined inside the ***.html.txt file (this file is located under webcontent->framework->markup->layout) starting from 1 and this is causing the above java script error. Please find below the sample which is causing this issue.
The WLP framework java script file contains method wlpGetPlaceableState and it is throwing the error, while trying to retrieve the portlet at position 0. Since the indexing starts with 1, all the portlets defined at the other placeholder number is returning correct values, except the first position, always returns null.
Solution
To resolve the issue, define the custom layout place holder number starting from 0 to n-1, where 'n' is the number columns in the custom layout. Always follow the standard used to define Array Indexing, to define the placeholder number indexing. The WLP framework java script is designed and expects that the array indexing is followed. Please find below sample code how it correctly should look like.
Please refer the following documentation for more information on Custom Layout.
http://download.oracle.com/docs/cd/E13218_01/wlp/docs102/portals/develop...


在PAT中编辑页面目录时抛出Java脚本错误:portletsElement为空(portletsElement is null)

应用于:Oracle WebLogic Portal – 版本: 10.3.0 到10.3.2 – 发行: AS10gR3

本篇文档的所有信息适用于任何平台

现象

在使用门户管理控制台来编辑页面目录时在浏览器中报java脚本错误。当在定制布局的页面上增加或删除一个portlet时会出现这个错误。占位符在.html.txt文件中定义,占位符从1到n, n是定制布局所需要的列数。

Java脚本错误信息

portletsElement is null


按照下面的步骤操作可以使这个问题重现:

1.    进入IDE环境并创建一个.portal文件

2.    在.html.txt文件中定义一个定制布局的占位符,占位符从1到n, n是定制布局所需要的列数。

3.    在.portal文件的第一页选择定制布局并拖拽一些portlet样例到占位符上。

4.    在PAT上部署并记录日志,创建一个新的门户TestPortal再创建一个桌面MyDesktop。

5.    导航至portal management-->TestPortal-->MyDesktop-->mainbook-->Page 1

6.    点击编辑目录,试着添加或删除一个portlet。注意是否有java脚本错误信息。

7.    你可能在点击保存按钮后接收到成功的信息,但由于java脚本错误所有的更改不会保存。

原因

这是一个与占位符的编号有关的配置问题。定制的布局的占位符的编号在.html.txt的文件(这个文件位于webcontent->framework->markup->layout)中定义,它从1开始,这就是导致java脚本错误的原因。请找到下面的样例来确定是什么引起了这个问题。

WLP框架java脚本包含wlpGetPlaceableState方法,这个方法在找回在位置0上的portlet时抛出错误。如果占位符的编号从1开始,除了第一个位置返回空值外,其它的portlet所在的占位符都返回正确的值。

解决方法

为解决这个问题,我们可以将定制布局的占位符的编号改为从0到n-1,n是定制布局所需的列数。我们经常使用数组的下标定义方式来定义占位符的编号。WLP框架java脚本被设计和期望使用数组下标的方式。

要了解更多关于定制布局的信息请参阅下面的文档

http://download.oracle.com/docs/cd/E13218_01/wlp/docs102/portals/develop...




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论