Hi,
I am trying to display validation messages as per the documentation and the
booking example.
The ajax\hibernate validation works fine but when I check for duplicate
manufacturer name on a form submit and add an error message to the injected
facesMessages nothing gets displayed.
if I add a <h:messages /> tag the message does however get displayed.
I think that for some reason the <s:message /> tag in edit.html is not outing
the message.
Code follows...
The session bean is a conversation scoped bean. The form submits calls the
persist method.
Any pointers as to what may be wrong?
BTW it works fine in the booking example on the same instance of jboss.
Thanks
Pieter
| <navigation from-action="#{manufacturerManager.persist}">
| <rule if="#{manufacturerManager.manufacturerValid}">
| <end-conversation/>
| <redirect view-id="/chemical/manufacturers.xhtml" />
| </rule>
| </navigation>
|
| <s:decorate id="manufacturerNameDecorate" template="../layout/edit.xhtml">
| <ui:define name="label">Name:</ui:define>
| <h:inputText id="manufacturerNameId" value="#{editManufacturer.name}"
required="true">
| <a:support event="onblur" reRender="manufacturerNameDecorate"/>
| </h:inputText>
| </s:decorate>
|
| // @End in pages with rule
| public void persist() {
| List<Manufacturer> existing = em
| .createQuery(
| "select m.name from
Manufacturer m where m.name=#{editManufacturer.name}")
| .getResultList();
| if (existing.size() == 0) {
| em.persist(editManufacturer);
| manufacturerNameSearchString =
editManufacturer.getName();
|
events.raiseTransactionSuccessEvent("persistManufacturerSuccess");
| manufacturerValid = true;
| } else {
| facesMessages.addToControl("manufacturerNameId",
| "Manufacturer #{editManufacturer.name}
already exists");
| manufacturerValid = false;
| }
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078885#4078885
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078885
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user