-
1. Re: f:setPropertyActionListener not setting values to the ba
ilya_shaikovsky Jun 3, 2009 9:15 AM (in response to shivaji.byrapaneni)As far as I see you showing us the code from richfaces-demo almost without modifications. And it works there. Seems need more details.
-
2. Re: f:setPropertyActionListener not setting values to the ba
nbelaevski Jun 3, 2009 9:15 AM (in response to shivaji.byrapaneni)Where do you access currentRow and currentItem?
What is not stored: row key or item? -
3. Re: f:setPropertyActionListener not setting values to the ba
shivaji.byrapaneni Jun 3, 2009 9:26 AM (in response to shivaji.byrapaneni)To ilya_shaikovsky::
Im customizing the richfaces demo pages to fit my requirements. I hope it should not be a wrong thing to use the demos provided by the richfaces for building applications.
I apologize you haven’t identified any changes. Im just a tag user other than tag developer so you might have seen the same tags. -
4. Re: f:setPropertyActionListener not setting values to the ba
shivaji.byrapaneni Jun 3, 2009 9:29 AM (in response to shivaji.byrapaneni)Sorry if i had confused in my question
here is my complete page<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <!-- RichFaces tag library declaration --> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <a4j:region> <rich:dataTable value="#{manageCoursesBean.courseList}" var="course" rowKeyVar="row" id="manageCoursesTable"> <f:facet name="header"> <h:outputText value="Manage Courses" /> </f:facet> <rich:column> <f:facet name="header"> <h:outputText value="Course Id" /> </f:facet> <h:outputText value="#{course.courseId}" id="courseId" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Course Name" /> </f:facet> <h:outputText value="#{course.courseName}" id="courseName" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="No Of Seats" /> </f:facet> <h:outputText value="#{course.noOfSeats}" id="noOfSeats" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="On Date" /> </f:facet> <h:outputText value="#{course.onDate}" id="onDate" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Course Time" /> </f:facet> <h:outputText value="#{course.courseTime}" id="courseTime" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Location" /> </f:facet> <h:outputText value="#{course.location}" id="location" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Is Course Expired" /> </f:facet> <h:outputText value="#{course.isCourseExpired}" id="isCourseExpired" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Actions" /> </f:facet> <a4j:commandLink ajaxSingle="true" id="editlink" oncomplete="#{rich:component('editPanel')}.show()"> <h:graphicImage value="/Images/edit.gif" style="border:1" /> <f:setPropertyActionListener value="#{course}" target="#{manageCoursesBean.currentItem}" /> <f:setPropertyActionListener value="#{row}" target="#{manageCoursesBean.currentRow}" /> </a4j:commandLink> <rich:toolTip for="editlink" value="Edit Course" /> <a4j:commandLink ajaxSingle="true" id="deletelink" oncomplete="#{rich:component('deletePanel')}.show()"> <h:graphicImage value="/Images/delete.gif" style="border:0" /> <f:setPropertyActionListener value="#{row}" target="#{manageCoursesBean.currentRow}" /> </a4j:commandLink> <rich:toolTip for="deletelink" value="Delete Course" /> </rich:column> <f:facet name="footer"> <rich:datascroller renderIfSinglePage="false" maxPages="5" /> </f:facet> </rich:dataTable> </a4j:region>
bolded part is the code im expecting to set the current selected row in the sense the row on which user clicks to edit the current row.
Here i assumed the code to set the 'current' value to the backing bean item 'currentItem' . Which is setting the value null.
I hope im bit clear now... -
5. Re: f:setPropertyActionListener not setting values to the ba
ilya_shaikovsky Jun 3, 2009 10:01 AM (in response to shivaji.byrapaneni)code from demo could be freely used for sure :) And it designed for this :)
As about your problem.. I still see no difference with our case except that your page is jsp page and we using facelets.. But this should not be a reason. I'll forward this to QA in order to investigate. -
6. Re: f:setPropertyActionListener not setting values to the ba
ilya_shaikovsky Jun 3, 2009 10:03 AM (in response to shivaji.byrapaneni)and b.t.w. how about first Nick's question?
-
7. Re: f:setPropertyActionListener not setting values to the ba
mvitenkov Jun 3, 2009 11:00 AM (in response to shivaji.byrapaneni)Hello shivaji.byrapaneni,
I tried to reproduce issue, you described, it's not reproducible:
I have private Object currentRow;
and setter:public void setCurrentRow(Object currentRow) { if (currentRow == null) System.out.println("current row is NULL"); else System.out.println("current row:" + currentRow); this.currentRow = currentRow; }
When I click on 'editlink' following string output to console:current row:5
My page code is similar with your, except I wraped <a4j:region> in f:view and h:form.
My configuration: Myfaces 1.2.5, richfaces 3.3.2-snapshot, tomcat 6.0.16
Thanks -
8. Re: f:setPropertyActionListener not setting values to the ba
tkuprevich Jun 3, 2009 11:24 AM (in response to shivaji.byrapaneni)Thanks, this is a bug - https://jira.jboss.org/jira/browse/RF-7316
-
9. Re: f:setPropertyActionListener not setting values to the ba
shivaji.byrapaneni Jun 4, 2009 12:55 AM (in response to shivaji.byrapaneni)my managed bean is also more or else having the same. Other than giving its as a object i gave it as a Entity Object.
here is the codepackage com.managedbeans; import java.util.ArrayList; import javax.ejb.EJB; import com.constants.NominationConstants; import com.entities.CourseDetailsEO; import com.logger.NominationLogger; import com.services.local.CoursesInformationServiceLocal; public class ManageCoursesBean extends NominationBaseBean { private final String className = this.getClass().toString(); private ArrayList<CourseDetailsEO> courseList; @EJB(mappedName = NominationConstants.COURSEINFOSERVICE_LOCAL) private CoursesInformationServiceLocal coursesInformationService; private CourseDetailsEO currentItem; private CourseDetailsEO currentRow; public CourseDetailsEO getCurrentRow() { return currentRow; } public void setCurrentRow(CourseDetailsEO currentRow) { this.currentRow = currentRow; } public CourseDetailsEO getCurrentItem() { return currentItem; } public void setCurrentItem(CourseDetailsEO currentItem) { this.currentItem = currentItem; } public ArrayList<CourseDetailsEO> getCourseList() { return courseList; } public void setCourseList(ArrayList<CourseDetailsEO> courseList) { this.courseList = courseList; } public void loadManageCourses() { final String methodName = "loadManageCourses"; NominationLogger.logMethodEntry(className, methodName); courseList = coursesInformationService.getCourseInfo(); NominationLogger.logMethodExit(className, methodName); } public String updateCourseInfo() { final String methodName = "updateCourseInfo"; NominationLogger.logMethodEntry(className, methodName); NominationLogger.logMethodExit(className, methodName); return null; } public String deleteCourse() { final String methodName = "deleteCourse"; NominationLogger.logMethodEntry(className, methodName); NominationLogger.logMethodExit(className, methodName); return null; } }
am i supposed to give the current row as Object class instance...?
is that mandatory..? -
10. Re: f:setPropertyActionListener not setting values to the ba
shivaji.byrapaneni Jun 4, 2009 1:09 AM (in response to shivaji.byrapaneni)i tried changing the instance to Object. but that also didnt help
is there any other way to get the selected row in my backing bean....? -
11. Re: f:setPropertyActionListener not setting values to the ba
shivaji.byrapaneni Jun 4, 2009 4:37 AM (in response to shivaji.byrapaneni)could any body help me on this please...
-
12. Re: f:setPropertyActionListener not setting values to the ba
nbelaevski Jun 4, 2009 5:43 AM (in response to shivaji.byrapaneni)Watch created JIRA issue for workaround/resolution. Something will be posted after investigation.