[jboss-user] [JBoss Seam] - Re: My list of questions: Seam validation, transactions and
beligum
do-not-reply at jboss.com
Sun Jun 10 13:20:13 EDT 2007
Hi Gavin, here's my code without the templates:
| <h:form>
| <table>
| <tr>
| <td><h:outputLabel for="newSpaceName">name</h:outputLabel></td>
| <td>
| <h:inputText
| id="newSpaceName"
| value="#{selectedSpaceInstance.entityData.name}"
| required="true"
| validator="#{spaceManager.validateSpaceName}" />
| </td>
| </tr>
| <tr>
| <td><h:outputLabel for="newSpaceCompany">company</h:outputLabel></td>
| <td>
| <h:selectOneMenu id="newSpaceCompany" value="#{selectedSpaceInstance.entityData.company}" required="true">
| <s:selectItems value="#{companyManager.possibleSpaceCompanies}" var="company" label="#{company.name}" />
| <s:convertEntity />
| </h:selectOneMenu>
| </td>
| </tr>
| <tr>
| <td></td>
| <td>
| <h:commandButton action="#{spaceManager.updateInstance}" value="update" type="submit" />
| </td>
| </tr>
|
| </table>
| </h:form>
|
The action-method #{spaceManager.validateSpaceName} is doing some basic unicity-checking on the space-name, that's all. I really like JSF-validation (I hope this _is_ JSF-validation) over annotations in the entity beans, because of the freedom it gives me to do what I want with the data. (or perhaps I'm just too ignorant regarding annotations, that's possible, too)
Do I still need <s:validateAll/> in this case?
btw, yes, indeed, I check the DB to see if my changes are persisted or not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052929#4052929
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052929
More information about the jboss-user
mailing list