cancel
Showing results for 
Search instead for 
Did you mean: 

Cant acsess custom bean methods

redomancer
Champ in-the-making
Champ in-the-making
I have custom made bean for my own purposes (simple POJO). I also modified document-details.jsp to display my own panel with data from bean.
The problem is - I CANT access bean's methods (javax.faces.el.PropertyNotFoundException), but CAN access class variables.
And I cant understand - what I am missing here? Why this is not workinh

// when method - NOT WORKING
<a:richList id="signatureList" viewMode="details"
  value="#{MyBean.getItems}" var="s"
  styleClass="recordSet" headerStyleClass="recordSetHeader"
  rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt"
  width="100%" pageSize="10"
  initialSortDescending="false">

BUT

// when variable- WORKING
<a:richList id="signatureList" viewMode="details"
  value="#{MyBean.itemsList}" var="s"
  styleClass="recordSet" headerStyleClass="recordSetHeader"
  rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt"
  width="100%" pageSize="10"
  initialSortDescending="false">

?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Try #{MyBean.items}

And make sure you have public accessor methods (getItems)

pinkesh_gandhi
Champ in-the-making
Champ in-the-making
if you want to call method of your custom bean  in <a:richList value=""> then follow these steps,
(1) Create one property variable  of type "java.util.List" 
         For ex.
                   java.util.List myList;

(2) Create getter method of that property variable with public accessor 
         For ex.
                   public java.util.List getMyList(){
                        return this.myList;
                   }

(3) now just write only name of your property variable in <a:richList value="">
         For ex.
                   <a:richList ……. value="#{MyBean.myList}" >

Above steps will calls the newly created getter method.
Means,You can call only getter method of property variable from <a:richList>, otherwise you get the same error what you have got previosly.