-
1. Re: rich:dataGrid
nbelaevski Apr 6, 2010 5:14 PM (in response to sburgula1)Hi Sai,
Can you please clarify more on the problem? Page code, UI sketches/screenshots would be very helpful.
-
2. Re: rich:dataGrid
sburgula1 Apr 7, 2010 10:31 AM (in response to nbelaevski)Hi Nick
Please find the code below.
<
rich:dataGrid value="#{courseSearch.selCourseFceList}" var="fce" elements="1" >
<f:facet name="header">
<rich:datascroller > </rich:datascroller>
</f:facet>
<h:commandLink action="#{courseSearch.loadUpdFacultyCourseEval()}" value="Edit FCE"
style="font-size: 1em;" >
<f:setPropertyActionListener value="#{fce}"
target="#{courseSearch.selectedFce}" />
</h:commandLink>
<s:div>
<h:outputText escape="true" style="float:right;font-weight:bold;" value="Sequence No: #{fce.id.sequenceNo} of #{courseSearch.selCourseFceList.size()}" />
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="1. To what extent does the course content match the stated goals, objectives and requirements? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.objective}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="2. How well do the exams and quizzes cover the material presented in the class and in the assigned readings? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.exams}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="3. How well do the assignments cover the material presented in the class? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.assignments}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="4. How well do the lectures and readings contribute to your learning in this course? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.lectures}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="5. How well do the discussions and special review sessions contribute to your learning in this course? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.discussions}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="6. How relevant is this course to the curriculum? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.relevancy}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="7. In general how do you rate this course? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fce.overallRating}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<rich:separator />
<a4j:outputPanel rendered="#{courseSearch.facultyNames.size>0}" >
<rich:dataGrid value="#{courseSearch.facultyNames}" var="facName" >
<s:div>
<h:outputText escape="true" style="float:left;font-weight:bold;" value="INSTRUCTOR: #{facName.toString()}" />
</s:div><br/><br/>
<rich:dataGrid value="#{courseSearch.selCourseFceInsList}" var="fceIns" >
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="1. How enthusiastically does the instructor convey his or her knowledge of the subject matter? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceIns.enthusiasm}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="2. How well does the instructor answer questions and provide feedback on your performance? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceIns.answerNFeedback}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="3. To what extent does the instructor demand critical or original thinking? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceIns.criticalThinking}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="4. Overall how do you rate this instructor? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceIns.overallRating}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
</rich:dataGrid>
</rich:dataGrid>
</a4j:outputPanel>
<rich:separator />
<a4j:outputPanel rendered="#{courseSearch.taNames.size>0}">
<rich:dataGrid value="#{courseSearch.taNames}" var="taName" >
<s:div>
<h:outputText escape="true" style="float:left;font-weight:bold;" value="TEACHING ASSISTANT: #{taName.toString()}" />
</s:div><br/><br/>
<rich:dataGrid value="#{courseSearch.selCourseFceTaList}" var="fceTa" >
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="1. How would you rate the TA's enthusiasm and knowledge of the subject matter? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceTa.enthusiasm}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="2. Does the TA communiate information and ideas clearly and in a well-organized way? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceTa.communication}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="3. How much patience or rapport does the TA have with you in answering questions about problems"/>
<h:outputLabel escape="false" style="font-weight:bold;" value="&nbsp;&nbsp;&nbsp;you do not understand? " /><br/><br/>
<h:selectOneRadio style="float:right;"
value="#{fceTa.patience}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="4. Is the TA generally available during designated appointment times? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceTa.availablity}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
<s:div>
<h:outputLabel escape="true" style="font-weight:bold;" value="5. In general, how do you rate this person's abilities as a Teaching Assistant? " /><br/>
<h:selectOneRadio style="float:right;"
value="#{fceTa.overallRating}">
<f:selectItem itemLabel="1" itemValue="1"/>
<f:selectItem itemLabel="2" itemValue="2"/>
<f:selectItem itemLabel="3" itemValue="3"/>
<f:selectItem itemLabel="4" itemValue="4"/>
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="N/A" itemValue="0"/>
</h:selectOneRadio>
</s:div><br/><br/>
</rich:dataGrid>
</rich:dataGrid>
</a4j:outputPanel>
<f:facet name="footer">
<rich:datascroller> </rich:datascroller>
</f:facet>
</rich:dataGrid>
There are three lists selCourseFceList, selCourseFceInsList and selCourseFceTaList. courseSearch is the backing bean which references the entity CourseOffering. CourseOffering has one to many relationship b/w itself and FCE, FCE_INS, and FCE_TA. Thus there are three lists pertaining to the relationship.
I need to be able to iterate through each of the lists display first row of the list on the first page, second row on the second page, so on and so forth. Hence I made use of rich:dataScroller for paging. I am able to display the first list contents (selCourseFceList) in the manner specified. So if you click on the 5 on the dataScroller you are seeing the 5th row contents of the FCE table. But it is with FCE_INS and FCE_TA that it is a problem. I am noticing the same row contents getting repeated in all pages.
Do let me know if any other information is required.
Thanks again for your quick response.
Sai
-
3. Re: rich:dataGrid
nbelaevski Apr 7, 2010 6:34 PM (in response to sburgula1)I'd suggest to remodel your bean classes as a single list of helper object having three attributes standing for FCE, FCE_INS, and FCE_TA.
But the question is: do all the lists have the same size? If no, how should UI display missing items that exist only in one list, but absent in another?