English 中文(简体)
JSF 2.0:我为什么选择 多种语言的盒式价值无效
原标题:JSF 2.0: why my selectManyListbox value is not valid

在我的管理下,我拥有以下财产:

@ManagedBean
@RequestScoped
public class MrBean {
    ...
    private long[]  IDs;
    private List<Item> items;
    ...
}

在我的“xhtml”档案中,我有以下几个箱子:

<h:selectManyListbox label="abc" 
    id="abc" size="5" value="#{MrBean.IDs}">
    <f:selectItems value="#{MrBean.items}" var="i" 
        itemLabel="#{i.name}" itemValue="#{i.id}" />
</h:selectManyListbox>
<h:message styleClass="errorMsg" for="abc" />

The id of my items are long numbers. Hence, I expected that I would get a list of IDs chosen. However, when I submit the form, abc: Validation Error: Value is not valid appears in the message part for my list box.

请允许我告诉我在这里做了什么错误?

Best regards, James Tran

最佳回答

当选定项目在提交表格时没有与任何现有项目相匹配时,你会发现这一验证错误。

由于您的传票范围很广,你需要确保你与展示表格时一样,在星号(邮政)施工器中设置同样的<代码>List<Item>。 如果由于名单内容取决于先前的行动而不可能这样做,那么,你就需要把信标放在眼中。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签