【发布时间】:2014-05-15 09:10:35
【问题描述】:
我做了什么:
第 1 步:我在“测试”创作模板中制作了两个文本元素(假设元素的名称是 userName 和 UserId)。 第 2 步:我使用 jsp 自定义了第一个元素(用户名)。
但是在自定义第一个元素(userName)时,我需要将第二个文本元素(UserId)的值提取到 userName 中。
我可以使用下面的代码获取第一个文本元素(用户名)的值,但我将如何获取第二个元素值?
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
<%@ page import="com.ibm.workplace.wcm.api.authoring.CustomItemBean" %>
<portletAPI:init />
<%
CustomItemBean customItem =
(CustomItemBean) request.getAttribute("CustomItemBean");
customItem.setSubmitFunctionName("myoptionsubmit");
String fvalue = (String)customItem.getFieldValue();
%>
<script language='Javascript'>
function myoptionsubmit()
{
document.getElementById('<%=customItem.getFieldName()%>').value =
document.getElementById('<%=customItem.getFieldName()%>_mycustomoption').value;
}
</script>
<INPUT id='<%=customItem.getFieldName()%>_mycustomoption' value="<%=fvalue%>">
【问题讨论】:
-
忘记附上代码:
标签: jsp websphere-portal