selectedpresidents.jsp
来自「j2ee开发优秀的表格控件」· JSP 代码 · 共 163 行
JSP
163 行
<%@ taglib uri="/tld/extremecomponents" prefix="ec" %><%@ taglib uri="/tld/c" prefix="c" %><html><head> <title>eXtremeComponents</title></head><body> <h3>Custom Form</h3> <p> In this example what you will notice is that the state of the checkboxes are maintained while sorting, filtering, and paging. Then when you press the List Selected Presidents button you are taken through a different action to see the results. </p> <p> Read the <a href="http://extremecomponents.org/wiki/index.php/Form_Tutorial"> tutorial </a> for more information. </p> <br/> <form id="presForm" action="<c:url value="selectedPresidentsListedController.run"/>" method="post"> <div> <span>Enter your name:</span> <span> <input type="text" name="userName" style="font-family:verdana,arial,helvetica,sans-serif;font-size:11px;" value="<c:out value="${param.userName}"/>" /> </span> </div> <ec:table items="presidents" action="${pageContext.request.contextPath}/selectedPresidentsController.run" view="compact" imagePath="${pageContext.request.contextPath}/images/table/compact/*.gif" autoIncludeParameters="false" form="presForm" > <ec:exportPdf fileName="output.pdf" tooltip="Export PDF" headerColor="black" headerBackgroundColor="#b6c2da" headerTitle="Presidents" /> <ec:row> <ec:column alias="checkbox" title=" " filterable="false" sortable="false" viewsAllowed="compact" cell="selectedPresident" style="width:5px" /> <ec:column property="fullName" title="Name"/> <ec:column property="nickName"/> <ec:column property="term"/> </ec:row> </ec:table> <p> <input type="button" name="sel" class="button" value="List Selected Presidents" onclick="document.forms.presForm.submit();" /> </p> <script type="text/javascript"> function setPresidentState(chkbx) { //make sure that always know the state of the checkbox if (chkbx.checked) { eval('document.forms.presForm.chkbx_' + chkbx.name).value='SELECTED'; } else { eval('document.forms.presForm.chkbx_' + chkbx.name).value='UNSELECTED'; } } </script> </form> <br/> <p> Below is the code that generates the above display. </p> <pre> <b><form id="presForm" action="<c:url value="selectedPresidentsListedController.run"/>" method="post"></b> <ec:table items="presidents" action="${pageContext.request.contextPath}/selectedPresidentsController.run" view="compact" imagePath="${pageContext.request.contextPath}/images/table/compact/*.gif" autoIncludeParameters="false" <b>form="presForm"</b> > <ec:exportPdf fileName="output.pdf" tooltip="Export PDF" headerColor="black" headerBackgroundColor="#b6c2da" headerTitle="Presidents"/> <ec:row> <ec:column alias="checkbox" title=" " style="width:5px" filterable="false" sortable="false" cell="selectedPresident" /> <ec:column property="fullName" title="Name"/> <ec:column property="nickName" /> <ec:column property="term" /> </ec:row> </ec:table> <b><input type="button" name="sel" class="button" value="List Selected Presidents" onclick="document.forms.presForm.submit();" /> <script type="text/javascript"> function setPresidentState(chkbx) { //make sure that always know the state of the checkbox if (chkbx.checked) { eval('document.forms.presForm.chkbx_' + chkbx.name).value='SELECTED'; } else { eval('document.forms.presForm.chkbx_' + chkbx.name).value='UNSELECTED'; } } </script></b> <<b>/form></b></pre> </body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?