A
abcde
Gast
Hallo,
ich versuche die ValidatorMessage durch validatorMessage manuell zu ändern. Bei zwei von 3 Feldern funktioniert das auch. Beim 3. Leider nicht und ich seh nicht was ich anders mach.
meine JSF
[XML]<h:form>
ISBN: <h:inputText id="isbn" value="#{books.isbn}" required="true" validatorMessage="ISBN has to be a number"/><br/>
Title: <h:inputText id="title" value="#{books.title}" required="true" validatorMessage="Title has to be a word between 2 and 20 characters"/><br/>
Author: <h:inputText id="author" value="#{books.author}" required="true" validatorMessage="Author has to be a word between 2 and 20 characters"/><br/>
Quantity: <h:inputText id="quantity" value="#{books.quantity}" required="true"/><br/>
<h:commandButton id="insert" action="#{books.insertBook()}" value="insert" />
</h:form><br/>[/XML]
Die zugehörige MessageBean:
Das Ergebnis:
Insert A New Book
ISBN: 0sfd
Title: s
Author: s
Quantity: 0
j_idt3:isbn: Bei '0sfd' muss es sich um eine Zahl mit einer oder mehreren Ziffern handeln.
Title has to be a word between 2 and 20 characters
Author has to be a word between 2 and 20 characters
Sieht jemand warum mir die Fehlermeldung nicht richtig angezeigt wird? Clear und Re-Build hab ich schon gemacht.
ich versuche die ValidatorMessage durch validatorMessage manuell zu ändern. Bei zwei von 3 Feldern funktioniert das auch. Beim 3. Leider nicht und ich seh nicht was ich anders mach.
meine JSF
[XML]<h:form>
ISBN: <h:inputText id="isbn" value="#{books.isbn}" required="true" validatorMessage="ISBN has to be a number"/><br/>
Title: <h:inputText id="title" value="#{books.title}" required="true" validatorMessage="Title has to be a word between 2 and 20 characters"/><br/>
Author: <h:inputText id="author" value="#{books.author}" required="true" validatorMessage="Author has to be a word between 2 and 20 characters"/><br/>
Quantity: <h:inputText id="quantity" value="#{books.quantity}" required="true"/><br/>
<h:commandButton id="insert" action="#{books.insertBook()}" value="insert" />
</h:form><br/>[/XML]
Die zugehörige MessageBean:
Java:
@Size(min = 10, max = 10)
private int isbn;
@Size(min = 2, max = 20)
private String title;
@Size(min = 2, max = 20)
private String author;
private int quantity;
Das Ergebnis:
Insert A New Book
ISBN: 0sfd
Title: s
Author: s
Quantity: 0
j_idt3:isbn: Bei '0sfd' muss es sich um eine Zahl mit einer oder mehreren Ziffern handeln.
Title has to be a word between 2 and 20 characters
Author has to be a word between 2 and 20 characters
Sieht jemand warum mir die Fehlermeldung nicht richtig angezeigt wird? Clear und Re-Build hab ich schon gemacht.