Webページにドロップダウンリストがあります。これは次のとおりです。
<h:form>
<h:panelGrid columns="2">
<h:outputText value="Açılacak hesabın para birimi:"></h:outputText>
<h:selectOneMenu value="currency" >
<f:selectItem itemValue="choose" itemLabel="Seçiniz..." />
<f:selectItem itemValue="tl" itemLabel="Türk Lirası(TL)" />
<f:selectItem itemValue="usd" itemLabel="Amerikan Doları(USD)" />
<f:selectItem itemValue="euro" itemLabel="Euro" />
</h:selectOneMenu>
<h:outputText value="Açılacak hesabın cinsi:"></h:outputText>
<h:selectOneMenu value="vade" >
<f:selectItem itemValue="choose" itemLabel="Seçiniz..." />
<f:selectItem itemValue="vadesiz" itemLabel="Vadesiz mevduat hesabı" />
<f:selectItem itemValue="vadeli" itemLabel="Vadeli Mevduat Hesabı" />
</h:selectOneMenu>
<h:commandButton value="Onayla" action="#{events.createAccount}" ></h:commandButton>
</h:panelGrid>
</h:form>
次に、ボタンをクリックして、Events.java Bean に移動し、そこでいくつかの情報を処理します。しかし、関数 createAccount() でこれらのドロップダウン リストの値が必要です。これが私のイベントBeanです
@Named(value = "events")
@Dependent
public class Events {
/**
* Creates a new instance of Events
*/
public Events() {
}
public void createAccount(){
}
}
これどうやってするの?
ありがとう