?? rowaction.jsp
字號:
<%-- tpl:insert page="/template/jsfTemplate.jtpl" --%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="../theme/Master.css" rel="stylesheet" type="text/css">
<LINK href="../theme/new.css" rel="stylesheet">
<LINK rel="stylesheet" type="text/css" href="../theme/stylesheet.css" title="Style">
<%-- tpl:put name="headarea" --%>
<title>rowAction.jsp</title>
<%-- /tpl:put --%>
<LINK rel="stylesheet" type="text/css" href="/JSFandSDO/theme/stylesheet.css" title="Style">
</HEAD>
<f:view>
<BODY>
<TABLE class="title" cellpadding="0">
<TBODY>
<TR>
<TD class="noBorder" background="../images/gradient.jpg"
align="CENTER"><IMG border="0" src="../images/title.jpg"></TD>
</TR>
<TR>
<TD class="noBorder" align="RIGHT"><A href="/JSFandSDO">Return to Main Menu</A></TD>
</TR>
</TBODY>
</TABLE>
<%-- tpl:put name="bodyarea" --%>
<hx:scriptCollector id="scriptCollector1">
<h:form styleClass="form" id="form1">
<H2>Performing Actions on a Data Table Row</H2>
This sample contains data tables that demonstrate ways to allow a users to perform an action on a single row. A row action control allows a user to click anywhere inside a data table to perform an action on a particular row. A command-hyperlink can also be used to perform actions on a specific row; however, an advantage of using a command-hyperlink is that more than one action can be assigned to each row. Plus, using links make it more obvious to a user how to perform an action.<H3>Exercise 1 - Using the Data Table Row Action feature to perform An action on a fully clickable row.</H3>The table displays the Record High and Record Low temperature for various cities. Selecting a row brings up a table displaying the average monthly high in that city. <BR>
<BR>
<TABLE class="noBorder" cellpadding="5" width="100%">
<TBODY>
<TR>
<TD class="noBorder" width="55%" height="336" valign="top" align="left">
<H4>Select a Row to view Average Monthly Highs</H4>
<h:dataTable id="table1" value="#{pc_RowAction.temperature}" var="vartemperature" styleClass="dataTable2" headerClass="headerClass" footerClass="footerClass" rowClasses="rowClass1" columnClasses="columnClass1" border="1" cellpadding="2" cellspacing="0">
<h:column id="column1">
<hx:commandExRowAction id="rowAction1" action="#{pc_RowAction.doRowAction1Action}">
</hx:commandExRowAction>
<f:facet name="header">
<h:outputText styleClass="outputText" value="City" id="text1"></h:outputText>
</f:facet>
<h:outputText id="text2" value="#{vartemperature.CITY}" styleClass="outputText">
</h:outputText>
<f:attribute value="border-bottom-style: hidden; border-left-style: hidden; border-right-style: hidden; border-style: hidden; border-top-style: hidden" name="style" />
</h:column>
<h:column id="column2">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Record High" id="text3"></h:outputText>
</f:facet>
<h:outputText id="text4" value="#{vartemperature.RECORDHIGH}" styleClass="outputText">
<f:convertNumber />
</h:outputText>
<f:attribute value="right" name="align" />
<f:attribute value="background-color: #f9a951; border-bottom-style: hidden; border-left-style: hidden; border-right-style: hidden; border-style: hidden; border-top-style: hidden" name="style" />
</h:column>
<h:column id="column3">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Record Low" id="text5"></h:outputText>
</f:facet>
<h:outputText id="text6" value="#{vartemperature.RECORDLOW}" styleClass="outputText">
<f:convertNumber />
</h:outputText>
<f:attribute value="right" name="align" />
<f:attribute value="background-color: #b9b9ff; border-bottom-style: hidden; border-left-style: hidden; border-right-style: hidden; border-style: hidden; border-top-style: hidden" name="style" />
</h:column>
</h:dataTable><BR>
A small column on the left of the data table is created to hold the
row action JSF Tag when it is created. However, this tag
may be placed in any column of the table if you do not want this column displayed at runtime. If you want to remove
the extra column, copy the row action tag into another column of
the table and delete the extra one.
<BLOCKQUOTE><P class="code">Example:<BR><h:column id="column4"><BR> <hx:commandExRowAction id="rowAction1" action="#{pc_RowAction.doRowAction1Action}"><BR> </hx:commandExRowAction><BR> <f:facet name="header"></f:facet><BR> </h:column></P></BLOCKQUOTE></TD>
<%-- JSF: The details table is stored in a JSF Panel Group Box which can either be displayed or hidden --%>
<%-- /JSF: --%>
<TD class="noBorder" width="45%" height="336" valign="top" align="left"><hx:jspPanel id="averagePanel" rendered="false">
<H4>The Average Monthly Highs for: <h:outputText styleClass="outputText" id="text20" value="#{pc_RowAction.temperatureDetails.CITY}">
</h:outputText></H4>
<TABLE border="1" width="50%">
<TBODY>
<TR>
<TH align="left" class="thColor25">Month</TH>
<TH align="right" class="th75">Average High</TH>
</TR>
<TR>
<TD align="left" class="tdColor25">January</TD>
<TD align="right" class="td75"><h:outputText id="text8" value="#{pc_RowAction.temperatureDetails.JANUARY}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">February</TD>
<TD align="right" class="td75"><h:outputText id="text9" value="#{pc_RowAction.temperatureDetails.FEBRUARY}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">March</TD>
<TD align="right" class="td75"><h:outputText id="text10" value="#{pc_RowAction.temperatureDetails.MARCH}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">April</TD>
<TD align="right" class="td75"><h:outputText id="text11" value="#{pc_RowAction.temperatureDetails.APRIL}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">May</TD>
<TD align="right" class="td75"><h:outputText id="text12" value="#{pc_RowAction.temperatureDetails.MAY}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">June</TD>
<TD align="right" class="td75"><h:outputText id="text13" value="#{pc_RowAction.temperatureDetails.JUNE}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">July</TD>
<TD align="right" class="td75"><h:outputText id="text14" value="#{pc_RowAction.temperatureDetails.JULY}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">August</TD>
<TD align="right" class="td75"><h:outputText id="text15" value="#{pc_RowAction.temperatureDetails.AUGUST}" styleClass="outputText">
<f:convertNumber />
</h:outputText></TD>
</TR>
<TR>
<TD align="left" class="tdColor25">September</TD>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -