Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[faces-dev] Property mismatch ?

This error is normally due to a mismatch between .xhtml declaration and the Bean Class declaration.
However I do not believe that to be the case.
I have copied and  pasted the code here.

What could be the cause of the error ?
 
 javax.el.PropertyNotFoundException: The class 'jsfgui.Accounting' does not have the property 'ExpenseTypeOptions'.
 
 
 --- Java Code ---

    private String [] expenseType ;
  private SelectItem [] ExpenseTypeOptions;




public @PostConstruct  void init() {
      setExpenseTypeOptions(new SelectItem[] {
new SelectItem("Food","Food"),
            new SelectItem("Clothing","Clothing"),
   new SelectItem("Car","Car"),
   new SelectItem("Fun","Fun"),
   new SelectItem("Other","Other")
      });
}

--- .xhtml file

      <h:selectManyListbox
 value="#{accounting.expenseType}">
        <f:selectItems
         value="#{accounting.expenseTypeOptions}"/>
       </h:selectManyListbox>
    <p/>

   
prevously I was having another issue because this code was meant to work but produced blank values.

private Map<String, String> availableItems = new HashMap<>();

I had to change it to this , added string parameters for the dynamic values to be picked up.

private Map<String, String> availableItems = new HashMap<String, String>();

There was no error just  blank values rendered on page. I thought this new issue may be related so I thought I should post it.



Back to the top