0

I have 2 selectonemenu elements, one that contains the status of the request, and the other contains a description of that status.

Im trying to implement it as follows :

I have a class called status that has 2 fields : status & description.

the selectonemenu would be :

<h:outputText id="requestStatusH" value="Status : " />
<h:selectOneMenu id="statusDD" value="#{exApp.status}">
    <f:selectItems value="#{exApp.statusList}" />
</h:selectOneMenu>

and my exApp bean would be :

private RequestStatus status;
private List<RequestStatus> statusList;
//Getters + Setters

when i select a status in one selectonemenu i want the corresponding description to appear in another disabled selectonemenu.

The problem is that im not able to even get the selected value in to the backing bean variables. after i submit the page, nothing is happening.

I tried to look into the stackoverflow selectonemenu guide, and i couldnt find anything about converters.

any help would be highly appreciated.

Edit :

My RequestStatus code :

public class RequestStatus implements Serializable {
public RequestStatus(String status, String description) {
    this.status = status;
    Description = description;
}

private String status;
private String Description;
//Getters + Setters

my form :

<h:form>
    <p:commandLink id="saveChanges" value="Save Changes" actionListener=
        "#{exApp.saveRespond()}"> </p:commandLink>
    <h:outputText id="requestStatusH" value="Status : " />
    <h:selectOneMenu id="statusDD" value="#{exApp.status}">
        <f:selectItems value="#{exApp.statusList}" />
    </h:selectOneMenu>
</h:form>

RequestStatus Class is not a backing bean, its a POJO that is used as a field in the RequestScope exApp backing bean. my page is using Form. and when i submit my form NOTHING happens.

Aritz
  • 30,971
  • 16
  • 136
  • 217
Anas Dawood
  • 101
  • 2
  • 8
  • Pasete mode code. What is the scope of your bean? Does your view use form/ajax? Does RequestStatus has converter? – pepuch Sep 01 '13 at 06:36
  • We need more code here. How does RequestStatus look like. What's the bean's scope, how does the form look like and so on... – noone Sep 01 '13 at 06:38
  • I solved this problem by changing the status datatype to String. – Anas Dawood Sep 01 '13 at 13:03

0 Answers0