I am making a JSF
project on eclipse neon
using JSF 2.0
, Primefaces
and Bootsfaces
components. Even though I am able to create the output and put it inside an arraylist, I am having hard time displaying that arraylist on datatable. Here is my Bean:
@ManagedBean
@SessionScoped
public class FinalList implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
List<ListElements> newList = new ArrayList<>();
public List<ListElements> getResultList(String url, String title) {
ListElements list = new ListElements();
list.setUrl(url);
list.setTitle(title);
newList.add(list);
return newList;
}
}
Here is the contents of my List:
public class ListElements implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String Title;
private String Url;
public String getTitle() {
return Title;
}
public void setTitle(String title) {
Title = title;
}
public String getUrl() {
return Url;
}
public void setUrl(String url) {
Url = url;
}
}
Here is my datatable on .xhtml page:
<h:form>
<b:dataTable id="datatbl" value="#{finalList.class}" var="d"
excel="true" csv="true" pdf="true" columnVisibility="true"
copy="true" print="true">
<b:dataTableColumn value="#{d.url}" />
<b:dataTableColumn value="#{d.title}" />
</b:dataTable>
</h:form>
Appearently I am not able to reach my ListElements list
. If I try to change value="#{finalList.class}"
with anything else , I get
list cannot be resolved as a member of finalList
error. I think I should be able to change it as value="#{finalList.list}"
. Can someone tell me where I go wrong?
I have tried every way I know but nothing changed. I desperately need help. All help will be appreciated.