[JBoss Seam] - Re: s:selectItems problems Seam 2 Beta1
by smithbstl
Ok it seems that my equals() method in DepartmentSection is failing which I am sure is the problem
public boolean equals(Object object) {
|
| if (object == this) return true;
| if (!(object instanceof DepartmentSection)) return false;
| DepartmentSection other = (DepartmentSection)object;
| if (!(other.getDepartmentSectionId() == this.getDepartmentSectionId())) return false;
| return true;
|
| }
Its failing on the instanceof check. I can't figure that one out. I would assume that it would have something to do with the DepartmentSectionList declaration on the Department class but it all seems correct.
Here is the declaration
| //Department Entity
|
| @OneToMany(cascade = CascadeType.ALL, mappedBy = "department")
| private List<DepartmentSection> departmentSectionList = new ArrayList<DepartmentSection>();
|
|
| public List<DepartmentSection> getDepartmentSectionList() {
| return this.departmentSectionList;
| }
|
| public void setDepartmentSectionList(List<DepartmentSection> departmentSectionList) {
| this.departmentSectionList = departmentSectionList;
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079358#4079358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079358
17Â years, 2Â months
[JBoss Seam] - s:selectItems problems Seam 2 Beta1
by smithbstl
I am having a strange problem with a selectOneMenu and s:selectItems
I have a series of menus that filter based on the previous selection.
| <h:selectOneMenu id="department_select" value="#{department}">
| <s:selectItems label="#{dept.departmentNumber} - #{dept.departmentName}"
| value="#{allDepartments.resultList}"
| var="dept"/>
| <s:convertEntity/>
| <a4j:support event="onchange"
| actionListener="#{serviceRequestManager.fillDepartmentSectionList}"
| ajaxSingle="true" reRender="departmentSection_select"/>
| </h:selectOneMenu>
|
| <h:selectOneMenu id="departmentSection_select" value="#{departmentSection}">
| <s:selectItems label="#{deptSection.departmentSectionName}"
| value="#{departmentSectionList}"
| var="deptSection"
| noSelectionLabel="(none)"/>
| <s:convertEntity/>
| <a4j:support event="onchange"
| actionListener="#{serviceRequestManager.fillComplaintTypeList}"
| ajaxSingle="true" reRender="complaintType_select"/>
| </h:selectOneMenu>
|
| <h:selectOneMenu id="complaintType_select" value="#{sectionComplaintType}">
| <s:selectItems label="#{sectionComplaint.complaintType.complaintTypeDescription}"
| value="#{sectionComplaintTypeList}"
| var="sectionComplaint"
| noSelectionLabel="(none)"/>
| <s:convertEntity/>
| </h:selectOneMenu>
The first menu filters the second, the second filters the third. This was working using under Seam 1.2
When I select from the first box, the second is filtered no problem. When I select the second, I get an error message
"value is not valid"
during either the Apply Request Values or Process Validations phase. No stack trace.
My actionListener is never called. When i choose the "(none)" noSelectionLabel, the actionListener is called.
Any idea what is going on?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079351#4079351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079351
17Â years, 2Â months