-
1. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 5:59 AM (in response to shivaji.byrapaneni)could any body help me on thsi please...
i cant even see the action method mentioned in the a4j:support triggering. -
2. Re: How to get the selected row of Data tabel to Managed bea
nbelaevski Jun 5, 2009 6:03 AM (in response to shivaji.byrapaneni)Hi,
Add rich:messages to the page and check if any were generated. -
3. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 6:27 AM (in response to shivaji.byrapaneni)Thanks for your reply i added that as well and cheked but i cant see any messages..
-
4. Re: How to get the selected row of Data tabel to Managed bea
nbelaevski Jun 5, 2009 6:52 AM (in response to shivaji.byrapaneni)Does request fire at all? Add a4j:status to check.
-
5. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 6:56 AM (in response to shivaji.byrapaneni)i tried seeing the method call using debug mode but icant see the method getting called.
-
6. Re: How to get the selected row of Data tabel to Managed bea
nbelaevski Jun 5, 2009 6:59 AM (in response to shivaji.byrapaneni)"shivaji.byrapaneni" wrote:
i tried seeing the method call using debug mode but icant see the method getting called.
I see. Add a4j:status and check request presence. -
7. Re: How to get the selected row of Data tabel to Managed bea
ilya_shaikovsky Jun 5, 2009 7:04 AM (in response to shivaji.byrapaneni)<h:form> <h:panelGrid columns="2" columnClasses="top,top"> <rich:extendedDataTable value="#{extendedTableBean.capitalsDataModel}" var="cap" id="table" width="580px" height="150px"> <rich:column sortable="false" label="Flag"> <f:facet name="header"> <h:outputText value="Flag"/> </f:facet> <h:graphicImage value="#{cap.stateFlag}"/> </rich:column> <rich:column label="State Name"> <f:facet name="header"> <h:outputText value="State Name"/> </f:facet> <h:outputText value="#{cap.state}"/> </rich:column> <rich:column label="State Capital"> <f:facet name="header"> <h:outputText value="State Capital"/> </f:facet> <h:outputText value="#{cap.name}"/> </rich:column> <rich:column label="Time Zone"> <f:facet name="header"> <h:outputText value="Time Zone"/> </f:facet> <h:outputText value="#{cap.timeZone}"/> </rich:column> <a4j:support event="onRowClick" action="#{extendedTableBean.action}"> <f:setPropertyActionListener value="#{cap}" target="#{extendedTableBean.selectedCapital}" /> </a4j:support> </rich:extendedDataTable> </h:panelGrid> </h:form>
andpublic class ExtendedTableBean { private String sortMode="single"; private String selectionMode="multi"; private ExtendedTableDataModel<Capital> dataModel; private List<Capital> capitals = new ArrayList<Capital>(); private Capital selectedCapital; public void action() { System.out.println(selectedCapital.getName()); } public Capital getSelectedCapital() { return selectedCapital; } public void setSelectedCapital(Capital selectedCapital) { this.selectedCapital = selectedCapital; }
and after clicking the row there are clicked capital name in the console. -
8. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 7:26 AM (in response to shivaji.byrapaneni)Thanks a lot for your replay
but i too tried teh same but that idnt work
im posting here my jsp and mbean . please correct me if i did any thing absured<!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"%> <h:form> <h:panelGrid columns="2" columnClasses="top,top"> <rich:messages /> <rich:extendedDataTable value="#{courseListBean.coursesList}" id="courseListEDT" binding="#{courseListBean.courseListEDT}" var="course" width="700px" height="400px" sortMode="single" selectionMode="single"> <rich:column sortable="false" label="Course Image" width="40px" id="imageColumn" binding="#{courseListBean.imageColumn}"> <f:facet name="header"> <h:outputText value="" /> </f:facet> <h:graphicImage value="/Images/create_doc.gif" /> </rich:column> <rich:column sortable="true" sortBy="#{course.courseName}" filterBy="#{course.courseName}" filterEvent="onkeyup" width="170px" label="Course Name" id="courseNameColumn" binding="#{courseListBean.courseNameColumn}"> <f:facet name="header"> <h:outputText value="Course Name" /> </f:facet> <h:outputText value="#{course.courseName}" /> </rich:column> <rich:column sortable="true" sortBy="#{course.noOfSeats}" filterBy="#{course.noOfSeats}" filterEvent="onkeyup" width="170px" label="No Of Seats" id="noOfSeatsColumn" binding="#{courseListBean.noOfSeatsColumn}"> <f:facet name="header"> <h:outputText value="no Of Seats" /> </f:facet> <h:outputText value="#{course.noOfSeats}" /> </rich:column> <rich:column sortable="false" label="on Date" id="onDateColumn" binding="#{courseListBean.onDateColumn}"> <f:facet name="header"> <h:outputText value="on Date" /> </f:facet> <h:outputText value="#{course.onDate}" /> </rich:column> <rich:column sortable="false" label="Time" id="timeColumn" binding="#{courseListBean.timeColumn}"> <f:facet name="header"> <h:outputText value="Time" /> </f:facet> <h:outputText value="#{course.courseTime}" /> </rich:column> <rich:column sortable="false" label="location" id="locationColumn" binding="#{courseListBean.locationColumn}"> <f:facet name="header"> <h:outputText value="location" /> </f:facet> <h:outputText value="#{course.location}" /> </rich:column> <a4j:support event="onRowDblClick" reRender="table" actionListener="#{courseListBean.nominateToTheCourse}"> <f:setPropertyActionListener value="#{course}" target="#{courseListBean.currentRow}" /> </a4j:support> </rich:extendedDataTable> </h:panelGrid> </h:form>
and my mbean is thispackage com.managedbeans; import java.util.ArrayList; import javax.ejb.EJB; import javax.faces.event.ActionEvent; import org.richfaces.component.html.HtmlColumn; import org.richfaces.component.html.HtmlExtendedDataTable; import com.constants.NominationConstants; import com.entities.CourseDetailsEO; import com.logger.NominationLogger; import com.services.local.CoursesInformationServiceLocal; public class CourseListBean extends NominationBaseBean { private final String className = this.getClass().toString(); @EJB(mappedName = NominationConstants.COURSEINFOSERVICE_LOCAL) private CoursesInformationServiceLocal coursesInformationService; private ArrayList<CourseDetailsEO> coursesList = new ArrayList<CourseDetailsEO>(); private CourseDetailsEO currentRow ; private HtmlExtendedDataTable courseListEDT; private HtmlColumn imageColumn; private HtmlColumn courseNameColumn; private HtmlColumn noOfSeatsColumn; private HtmlColumn onDateColumn; private HtmlColumn timeColumn; public CourseDetailsEO getCurrentRow() { return currentRow; } public void setCurrentRow(CourseDetailsEO currentRow) { this.currentRow = currentRow; } public HtmlExtendedDataTable getCourseListEDT() { return courseListEDT; } public void setCourseListEDT(HtmlExtendedDataTable courseListEDT) { this.courseListEDT = courseListEDT; } public HtmlColumn getImageColumn() { return imageColumn; } public void setImageColumn(HtmlColumn imageColumn) { this.imageColumn = imageColumn; } public HtmlColumn getCourseNameColumn() { return courseNameColumn; } public void setCourseNameColumn(HtmlColumn courseNameColumn) { this.courseNameColumn = courseNameColumn; } public HtmlColumn getNoOfSeatsColumn() { return noOfSeatsColumn; } public void setNoOfSeatsColumn(HtmlColumn noOfSeatsColumn) { this.noOfSeatsColumn = noOfSeatsColumn; } public HtmlColumn getOnDateColumn() { return onDateColumn; } public void setOnDateColumn(HtmlColumn onDateColumn) { this.onDateColumn = onDateColumn; } public HtmlColumn getTimeColumn() { return timeColumn; } public void setTimeColumn(HtmlColumn timeColumn) { this.timeColumn = timeColumn; } public HtmlColumn getLocationColumn() { return locationColumn; } public void setLocationColumn(HtmlColumn locationColumn) { this.locationColumn = locationColumn; } private HtmlColumn locationColumn; public ArrayList<CourseDetailsEO> getCoursesList() { return coursesList; } public void setCoursesList(ArrayList<CourseDetailsEO> coursesList) { this.coursesList = coursesList; } public void loadCourseList() { final String methodName = "loadCourseList"; NominationLogger.logMethodEntry(className, methodName); coursesList = coursesInformationService.getCourseInfo(); NominationLogger.logMethodExit(className, methodName); //return NominationConstants.NominationHome; } public String nominateToTheCourse(ActionEvent event){ final String methodName = "nominateToTheCourse"; NominationLogger.logMethodEntry(className, methodName); NominationLogger.logMethodExit(className, methodName); return null; } }
please help me in sorting out this issue.
Many Thanks in advance. -
9. Re: How to get the selected row of Data tabel to Managed bea
nbelaevski Jun 5, 2009 7:38 AM (in response to shivaji.byrapaneni)Well, what does a4j:status show?
-
10. Re: How to get the selected row of Data tabel to Managed bea
ilya_shaikovsky Jun 5, 2009 7:39 AM (in response to shivaji.byrapaneni)I wanted you not to tried "almost the same" but explore the code listed and looked for problems in your code :)
which scope of your bean. -
11. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 7:46 AM (in response to shivaji.byrapaneni)im not aware of that tag. Any way i checked with debug and cant see teh method getting called
-
12. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 7:48 AM (in response to shivaji.byrapaneni)i had most of my questions answered in the demo site provided.
so, i m just trying to mix them up to make my application.
My managed bean is in request scope. -
13. Re: How to get the selected row of Data tabel to Managed bea
nbelaevski Jun 5, 2009 7:53 AM (in response to shivaji.byrapaneni)Ok, can you debug the reason why it's not being called? Start with UIViewRoot methods.
-
14. Re: How to get the selected row of Data tabel to Managed bea
shivaji.byrapaneni Jun 5, 2009 7:59 AM (in response to shivaji.byrapaneni)im afraid to say that im not that master in using richfaces
could please hlep me by telling how it should be done...?