[jboss-user] [JBoss Seam] - AJAX Calls give
birwin
do-not-reply at jboss.com
Wed Nov 28 11:45:25 EST 2007
I have two selectOneMenu controls on my Seam page. One uses an AJAX call to re-render the employees associated with the division. All works well the first time I change a division (Note... No matter what division I select the first time, the other control appears to re-render correctly).
The second time I change the division I get this error... No matter what division I select.
sourceId=j_id10:j_id25[severity=(ERROR 2), summary=(value is not valid), detail=(value is not valid)]
The control is re-rendered, but with incorrect information.
I was assuming that the selected item was not in the re-rendered list, so I created an Employee object with a "0" employeeID. I then made sure the employee was included in each rendered list and I made sure that employee was the one that was selected each time I changed division. That did not make a difference.
| Division :
| <h:selectOneMenu value="#{payrollExport.selectedClient}">
| <s:selectItems value="#{payrollExport.clients}" var="c" label="#{c.pluses}#{c.description}" />
| <f:converter converterId="clientConverter" />
| <a:support event="onchange" actionListener="#{payrollExport.refreshEmployees}" reRender="employees" />
| </h:selectOneMenu>
|
| Employee :
| <h:selectOneMenu id="employees" value="#{payrollExport.employee}">
| <s:selectItems value="#{payrollExport.employees}" var="e" label="#{e.lastName}, #{e.firstName}" noSelectionLabel="All Employees" />
| <f:converter converterId="employeeConverter" />
| </h:selectOneMenu>
|
I have overriden the Employee "equals" and "hashCode" methods. The equals method compares the employeeID (A unique int from a database table) and the hashCode method simply returns the employeeID. Two objects with the same employeeID should be equal.
JBoss 4.2.0.GA
Seam 1.2
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108586#4108586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108586
More information about the jboss-user
mailing list