- This topic has 4 replies, 3 voices, and was last updated 17 years, 1 month ago by amattas.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
amattasMember<h:inputText id=”phone” value=”#{Register.phone}” size=”10″ maxlength=”10″ required=”true” requiredMessage=”Field required.” validator=”#{Register.validateShort}”></h:inputText>
My eclipse says requiredMessage is invalid.
GregMemberIs that the only attribute that is shown to be invalid? I just tried to add this tag to my own JSF project and it validated just fine with now warning messages.
Is this source in a JSP file that is in a JSF Project?
amattasMemberIs in a Facelets project, to its a .xhtml file
Loyal WaterMemberWhat version of MyEclipse are you using ?
amattasMemberI was originally using M1, now I am using GA, when I originally loaded GA all the errors went away, as soon as I modified any of the tags with the requiredMessage attribute it reappeared. Below is my code.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en"> <ui:composition template="/templates/template.xhtml"> <head> <title>My XHTML Page</title> <meta http-equiv="keywords" content="enter,your,keywords,here" /> <meta http-equiv="description" content="A short description of this page." /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <!--<link rel="stylesheet" type="text/css" href="styles.css">--> </head> <body> <ui:define name="title"> Add New User </ui:define> <ui:define name="body"> <h:form id="adduser"> <table> <tr> <td> User Name: </td> <td> <h:inputText id="username" value="#{Register.username}" maxlength="50" validator="#{Register.validateUser}" required="true" requiredMessage="Field required."></h:inputText> </td> <td> <h:message for="username" style="color: #FF0000;"></h:message> </td> </tr> <tr> <td> First Name: </td> <td> <h:inputText id="firstname" value="#{Register.firstname}" maxlength="50" validator="#{Register.validateName}" required="true" requiredMessage="Field required."></h:inputText> </td> <td> <h:message for="firstname" style="color: #FF0000;" /> </td> </tr> <tr> <td> Last Name: </td> <td> <h:inputText id="lastname" value="#{Register.lastname}" maxlength="50" validator="#{Register.validateName}" required="true" requiredMessage="Field required."></h:inputText> </td> <td> <h:message for="lastname" style="color: #FF0000;" /> </td> </tr> <tr> <td> Suffix: </td> <td> <h:selectOneMenu id="suffix" value="#{Register.suffix}" validator="#{Register.validateShort}"> <f:selectItem itemLabel="" itemValue="" /> <f:selectItem itemLabel="DDS" itemValue="DDS" /> <f:selectItem itemLabel="DMD" itemValue="DMD" /> <f:selectItem itemLabel="FACS" itemValue="FACS" /> <f:selectItem itemLabel="FRCS(C)" itemValue="FRCS(C)" /> <f:selectItem itemLabel="MD" itemValue="MD" /> <f:selectItem itemLabel="MS" itemValue="MS" /> <f:selectItem itemLabel="PhD" itemValue="PhD" /> </h:selectOneMenu> </td> <td> <h:message for="suffix" style="color: #FF0000;" /> </td> </tr> <tr> <td> Phone: </td> <td> <h:inputText id="phone" value="#{Register.phone}" size="10" maxlength="10" required="true" requiredMessage="Field required." validator="#{Register.validatePhone}"></h:inputText> <h:inputText id="extension" value="#{Register.extension}" size="9" maxlength="9" validator="#{Register.validateExtension}"></h:inputText> </td> <td> <h:message for="phone" style="color: #FF0000;" /><h:message for="extension" style="color: #FF0000;" /> </td> </tr> <tr> <td> E-Mail: </td> <td> <h:inputText id="email" value="#{Register.email}" maxlength="75" validator="#{Register.validateEmail}" required="true" requiredMessage="Field required."></h:inputText> </td> <td> <h:message for="email" style="color: #FF0000;" /> </td> </tr> <tr> <td> <h:commandButton id="submit" action="#{Register.add}" value="Add User"></h:commandButton> <h:commandButton id="reset" type="reset" value="Clear"></h:commandButton> </td> </tr> </table> </h:form> </ui:define> </body> </ui:composition> </html>
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)