<af:panelGroupLayout id="pgl2"> <af:resource type="javascript"> function handleEnterEvent(evt) { var _keyCode = evt.getKeyCode(); //调用隐藏的按钮b4 if (_keyCode == AdfKeyStroke.ENTER_KEY) { var comp = evt.getSource(); AdfActionEvent.queue(comp.findComponent("b4"), true); evt.cancel(); } } </af:resource> <af:panelFormLayout id="pfl1"> <af:inputText label="就业协议书编号" id="it1" value="#{viewScope.xysfpBean.bh}" required="true"> <af:clientListener method="handleEnterEvent" type="keyPress"/> <!--<af:serverListener type="EnterEvent" method="#{viewScope.xysfpBean.handleEnterEvent2}"/>--> </af:inputText> <af:inputText label="领取人" id="it2" value="#{viewScope.xysfpBean.lqr}"/> <af:selectOneChoice value="#{bindings.XtglDwLov1.inputValue}" label="学院" autoSubmit="true" shortDesc="#{bindings.XtglDwLov1.hints.tooltip}" id="soc3"> <f:selectItems value="#{bindings.XtglDwLov1.items}" id="si3"/> <f:validator binding="#{bindings.XtglDwLov1.validator}"/> </af:selectOneChoice> </af:panelFormLayout> <af:button text="add" id="b4" visible="false" actionListener="#{viewScope.xysfpBean.addActionListener}"/>
</af:panelGroupLayout>
文本框是输入框,非拖拉的vo