Tuesday, 15 March 2011

jsf - How to get the result List from managed bean to xhtml webpage? -



jsf - How to get the result List from managed bean to xhtml webpage? -

i trying build online exam system. right now, trying search particular question , displaying results on searchresult.xhtml.

i have session bean questionbankfacadebean - selects entity bean questionbank based on id , returns result list, managed bean questonbankbean passes on list xhtml page. trying utilize display result html table, failing so. getting error saying "/searchresult.xhtml @28,99 value="#{question.idquestionbank}": class 'entity.questionbank' not have property 'idquestionbank'." please allow me know missing.

thanks

code: session bean

public list<questionbank> searchquestion (integer questionid){ list <questionbank> results = new arraylist <questionbank>(); seek { results = em.createnamedquery("questionbank.findbyidquestionbank").setparameter("idquestionbank", questionid).getresultlist(); }....

managed bean:

public string searchquestion(){ if (questionid != null ) { questionlist = questionbankfacade.searchquestion(questionid); } if(questionlist != null) questionfound = questionlist.size(); else questionfound = 0; system.out.println("questionfound " + questionfound); homecoming "searchresult.xhtml"; }

searchresult.xhtml:

<h:datatable id ="questiontable" rendered ="#{quizbean.questionfound > 0}" value ="#{quizbean.questionlist}" var="question" binding ="#{quizbean.questiontable}" border ="3" cellspacing ="5" cellpadding ="5" > <h:column> <f:facet name="header"> <h:outputtext value="question "/> </f:facet> <h:commandlink value="#{question.idquestionbank}" action="#{quizbean.retrieve}"/> </h:column>

jsf java-ee xhtml managed-bean

No comments:

Post a Comment