1

I have this form:

<h:form>
    <h:outputLabel value="Entrez un id du compte a supprimer" for="id"/>
    <h:inputText id="id" value=""/>
    <h:commandButton id="supprimer" value="Supprimer" action="#{compteBancaireMBean.supprimer}"/>  
</h:form>

And this action method:

public String supprimer() {  
    gestionnaireDeCompteBancaire.supprimer(comptebancaire.getId());  
    return "CompteList";  
} 

When I submit the form, I get the following exception:

javax.el.PropertyNotWritableException: /Supprimer.xhtml @14,44 value="": Illegal Syntax for Set Operation

How is this caused and how can I solve it?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
marcAntoine
  • 668
  • 5
  • 19
  • 35

1 Answers1

4

value="" does not mean anything to the JSF el parser, it can't make sense of that. You need to actually provide a static value there, as in value="Some Text" or bind it to a variable in your backing bean as in value="#{compteBancaireMBean.myVariable}" where myVariable corresponds to an actual variable in your compteBancaireMBean backing bean. This variable must follow the javabean conventions i.e. you must have

   private Integer myVariable;  //I use Integer here just as an example, you can use any core java type

   public void setMyVariable(Integer myVariable){
    this.myVariable = myVariable 
   }

   public Integer getMyVariable(){
   return this.myVariable
   }
kolossus
  • 20,559
  • 3
  • 52
  • 104