0

I got weird problem and I have no idea why is this happening, I got class like this:

@ManagedBean(name = "clientBean")
@SessionScoped
public class ClientBean implements Serializable {

private static final long serialVersionUID = 1L;

private ClientDao clientDao = new ClientDao();

private SearchService searchService = new SearchService();

private String tags;

private Client client = new Client();

private Order order = new Order();

and I have part of .xhtml:

       <div class="form-group">
        <label style="padding-top: 0px" class="col-sm-3 control-label">Tytuł zamówienia</label>
            <div class="col-sm-9">
                <h:inputText type="text"
                        value="#{clientBean.order.title}"
                        class="form-control" />
                        </div>
                    </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">Status</label>
                  <div class="col-sm-9">
                   <h:inputText type="text" value="PRZETWARZANIE"
                        class="form-control" disabled="true" />
                  </div>
            </div>

The question is... why I can't set value order.title? There is no problem with client.name and other fields in Client class, but when I try to set form fields with order's properties and enter this view then this exceptions appears (I got all getters and setters):

SEVERE: Error Rendering View[/clients.xhtml]
javax.el.PropertyNotFoundException: /clientRegistration.xhtml @112,67  value="#{clientBean.order.title}": Property 'order' not found on type  com.firanycrm.controller.ClientBean
at  com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
at javax.faces.component.UIInput.getValue(UIInput.java:291)
dante
  • 393
  • 1
  • 15
  • 31

1 Answers1

0

For JSF to get/set your properties you need to have getters and setter for everything, both in ClientBean class and the classes it's referencing Order, Client etc. Make sure you have all those getters and setters, I suggest just generating them if you are using IDE like Eclipse (right click > source > generate getters and setters).

Shadov
  • 5,421
  • 2
  • 19
  • 38
  • I have all getters and setters generated by Eclipse in ClientBean and Order class also.. – dante Sep 19 '16 at 12:40