📄 codetypeadd.jsp
字号:
<%@ page import="org.ofbiz.entity.*" %>
<%@ page import="org.ofbiz.entity.model.*" %>
<%@ page import="java.lang.reflect.Method" %>
<%@ page import="java.util.*" %>
<%@ page import="org.ofbiz.entity.util.SequenceUtil" %>
<%@ page import="com.sourcetap.sfa.replication.*" %>
<%@ include file="/includes/header.jsp" %>
<%@ include file="/includes/leftcolumn-codeType.jsp" %>
<%
String ENTITY = "CodeType";
String action = "";
String name = "";
String val = "";
ModelEntity entity = delegator.getModelEntity(ENTITY);
if(request.getParameter("action") != null){
//actions=search, update, create
action = request.getParameter("action");
}
// Handle creating a new code type.
if(action.equals("create")){
GenericValue genericValue = new GenericValue(entity);
genericValue.setDelegator(delegator);
// genericValue.set("codeTypeId", GenericReplicator.getNextSeqId(ENTITY, delegator));
Enumeration params = request.getParameterNames();
while(params.hasMoreElements()){
String pName = (String)params.nextElement();
if(!pName.equals("action") && !pName.equals("isVisible"))
genericValue.set(pName, request.getParameter(pName));
}
// Handle the check boxes.
if(request.getParameter("isVisible") != null && request.getParameter("isVisible").equalsIgnoreCase("on")){
genericValue.set("isVisible", "Y");
} else {
genericValue.set("isVisible", "N");
}
delegator.create(genericValue);
}
%>
<!-- title table -->
<table width="100%" height="30"><tr><td><div class="head1">Code Type</div></td></tr></table>
<table width='100%' class=viewOneHeader>
<tr>
<td width='100%' height='100%'>
<table class=viewOneHeader>
<tr >
<td colspan="2">Add a new code type</td>
</tr>
<form method="post" action="<ofbiz:url>/codeTypeAdd</ofbiz:url>">
<input type="hidden" value="create" name="action" >
<!-- Code Type ID -->
<tr>
<% name = "codeTypeId"; %>
<td class=viewOneLabel>Code Type ID</td>
<td><input type="text" name="<%=name%>"></td>
</tr>
<!-- Code Type Name -->
<tr>
<% name = "codeTypeName"; %>
<td class=viewOneLabel>Code Type Name</td>
<td><input type="text" name="<%=name%>"></td>
</tr>
<!-- Code Type Description -->
<tr>
<td class=viewOneLabel>Code Type Description</td>
<td class="viewOneField"><textarea cols="30" rows="15" name="codeTypeDescription"></textarea></td>
</tr>
<!-- Is Visible -->
<tr>
<td class="viewOneLabel">Visible</td>
<td class="viewOneField"><input type="checkbox" name="isVisible" CHECKED></td>
</tr>
<tr>
<td></td><td><input type="submit" value="Create" ></td>
</tr>
</form>
</table>
</td></tr></table>
</td>
<td valign="top">
</td>
</tr>
</table>
<%@ include file="/includes/footer.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -