java - Call of action method from iterated h:commandButton fails -
i trying implement function adds book shopping cart.
the cart bean has fields hold request parameters. session scoped.
<h:form id="addbooktocartform"> <ui:repeat var="book" value="#{search.booklist}"> <h:commandbutton value="#{messages.addtocart}" action="#{cart.addbooktocart}"> <f:param name="bookid" value="#{book.bookid}" /> </h:commandbutton> </ui:repeat> </h:form>
the request view index.jsf, action method calls view cart.jsf.
the problem is: action method isn't called, not bean constructed. had @ solutions similar problems couldn't find solution pointed in right direction. @ first thought #{search.booklist} problem don't need booklist next view.
activating debugging via <ui:debug>
reveals this:
java.lang.unsupportedoperationexception: not supported. @ javax.faces.component.uiviewaction.getactionlistener(uiviewaction.java:249)
this message refers metadata @ top of index.jsf:
<f:metadata> <f:viewparam name="genretypeid" value="#{search.genretypeid}" /> <f:viewaction action="#{search.searchbygenretypeid}" /> </f:metadata>
the search bean booklist comes from.
update message using ajax update. show validation message.
Comments
Post a Comment