0
我有以下問題,當我使用selectManyCheckBox:SelectManyCheckBox java.lang.Boolean中不能轉換到javax.faces.model.SelectItem
campaignInformationForm.campaignInformation.googleAnalytics(這是布爾對象)
java.lang.Boolean中不能轉換到 javax.faces.model.SelectItem
,我的代碼是:
<ice:selectManyCheckbox id="options" layout="pageDirection" >
<f:selectItem itemValue="#{campaignInformationForm.campaignInformation.googleMerchantAccount}" itemLabel="#{msgs['page.information.GoogleAccount']}" />
<f:selectItem itemValue="#{campaignInformationForm.campaignInformation.googleMap}" itemLabel="#{msgs['page.information.GoogleMap']}" />
<f:selectItem itemValue="#{campaignInformationForm.campaignInformation.googleAnalytics}" itemLabel="#{msgs['page.information.GoogleAnalytics']}" />
</ice:selectManyCheckbox>
任何想法?
編輯:
這是我的DTO
public class CampaignInformation implements Serializable{
.....BOILERPLAIT CODE ...
private boolean googleMerchantAccount;
private boolean googleMap;
private boolean googleAnalytics;
.....GETTER/SETTER ...
,我想一個複選框,可以與布爾合作選擇/取消根據自己的價值,能不能做到?
我想做的事設置#{campaignInformationForm.campaignInformation.googleMerchantAccount}所選的值...例如,如果被選中,這將是真實的,你是正確的我使用的價值,但現在我迷路了我怎麼可以將它與組件綁定 – Necronet 2011-03-22 21:45:49
我只是編輯我的答案。所選值的列表由selectManyCheckBox標籤指定。 – ymajoros 2011-03-22 22:11:02