当按下“ Enter”键时,如何使按钮“被按下”提交输入文本?

时间:2018-10-19 13:21:45

标签: jsf trinidad

仅使用JSF,我可以这样做吗?还是我需要在程序中添加更多的层和功能?

这是我到目前为止所拥有的:

	<tr:form usesUpload="true">
				<trh:tableLayout width="100%" cellPadding="10" borderWidth="0"
					id="Table">

					<trh:rowLayout>
						<trh:cellFormat columnSpan="4">
							<ocau:inlineMessage />
						</trh:cellFormat>
					</trh:rowLayout>
									
					<tr:panelBox styleClass="roundedPanelPrimary">
						 <trh:rowLayout halign="center">
							<trh:cellFormat halign="center">								
								<tr:inputText styleClass="tabdata" contentStyle="normalContent"
									label="Account Number"
									value="#{fraudSearch.fraudCustomerReqtUIModelBean.accountNumber}"
									accessKey="13"
	                               >
							   </tr:inputText>


							</trh:cellFormat>
							
							<trh:cellFormat halign="left">
								<tr:commandButton text="Search" id="Search"
									action="#{fraudSearch.getIBSNotesData}" styleClass="Button"
									halign="center"
									>
									</tr:commandButton>
							</trh:cellFormat>							
						</trh:rowLayout>						
					</tr:panelBox>

					<tr:panelBox styleClass="roundedPanelPrimary"
						rendered="#{fraudSearch.displaySearchResults}">
						<trh:tableLayout cellPadding="10" borderWidth="0" id="Table"
							width="100%">
							<trh:rowLayout>
								<tr:panelTabbed position="above" inlineStyle="width:auto">

									<tr:showDetailItem text="IBS Data Extract" id="IBSDataExtract"
										immediate="true">
										<ui:include
											src="/pages/recovery/fraud/displayFraudRPAIBSDataExtract.jspx">
										</ui:include>
									</tr:showDetailItem>
								 <!--  
									<tr:showDetailItem text="Non-Monetary Data" id="IBSNonMonData"
										immediate="true">
										<ui:include
											src="/pages/recovery/fraud/displayFraudRPANonMonetaryData.jspx">
										</ui:include>
									</tr:showDetailItem>
									-->
								</tr:panelTabbed>
								
								
								
								
							</trh:rowLayout>
						</trh:tableLayout>
					</tr:panelBox>
				</trh:tableLayout>


			</tr:form>​

到目前为止,我已经尝试将访问键添加到文本框和按钮中,但是似乎无法正常工作。朝正确方向的任何观点将不胜感激。

1 个答案:

答案 0 :(得分:0)

Trinidad在其formtag中提供了defaultCommand,您应该可以根据自己的意愿进行操作。看到这里:tr:form