簡體   English   中英

如何識別在冰面上選擇了哪個單選按鈕?

[英]how to identify which radio button is selected in icefaces?

我有3個單選按鈕,我想確定選擇哪個單選按鈕進行進一步處理。

document.getElementById(“ minselected”); 還有document.getElementById(“ minselected”)。isSelected();

document.getElementByName(“ min”);

但它不起作用。

如果您使用的是icefaces,則不必使用任何javascript tweek來獲取復選框值。

嘗試使用ice:selectOneRadio組件。
示例代碼如下

<ice:selectOneRadio layout="pageDirection"
    partialSubmit="true" value="#{myBean.myButtonValue}">
    <f:selectItem id="1"
        itemLabel="val1"
        itemValue="val1" />
    <f:selectItem id="2"
        itemLabel="val2"
        itemValue="val2" />
    <f:selectItem id="3"
        itemLabel="val3"
        itemValue="val3" /> </ice:selectOneRadio>

myBean是我的bean名稱
myButtonValue是具有getter setter的bean中的字符串變量

提交表單時,您將在變量myButtonValue的bean中獲得itemValue

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM