RE: Tomahawk Extended datatable problem, running on Tomcat 4.1
Your dataTable needs a value attribute which calls a method in a backing bean that returns one of the supported collections holding 'rows' of data (in this case a list of ObjectWithData instances). The dataTable will iterate over all items in the list and reference the current row with the var attribute (in this case the var is called eachRow).. You then specify which of the parameters from the object referenced by 'eachRow' you wish to display in each column of the table. Your backing bean (as I'm using a list here) would have the following method: public List getListOfObjectsWithData() { List aList; // Populate list from underlying data source etc... return aList; } The item referenced by the var attribute value (eachRow) in the h:dataTable tag will then iterate over the List of objects, for instance: public class ObjectWithData { private String firstParam; private String secondParam; private String thirdParam; private String fourthParam; // Getters and setters... } So basically you need to provide the dataTable tag with a method that returns a supported collection of some type. Hope this helps, Marcus From: "Tran, Paul" <[EMAIL PROTECTED]> Reply-To: "MyFaces Discussion" To: Subject: Tomahawk Extended datatable problem, running on Tomcat 4.1 Date: Thu, 23 Nov 2006 16:55:08 -0500 Hi, I am currently trying to use some of your components and I have success with most of them, except for the extended datatable. The code that I wrote is really simple and I can't locate what is wrong. Here is a sample of my code calling the datatable : _ Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters
Tomahawk Extended datatable problem, running on Tomcat 4.1
Hi, I am currently trying to use some of your components and I have success with most of them, except for the extended datatable. The code that I wrote is really simple and I can't locate what is wrong. Here is a sample of my code calling the datatable : I am using these libraries: common-annotations.jar commons-beanutils.jar commons-collections.jar commons-digester.jar commons-logging.jar jsf-api.jar jsf-impl.jar jstl.jar.jar standard.jar tomahawk-1.1.3.jar geronimo-spec-jsp-2.0-rc2.jar commons-el-1.0.jar And the errors I get are: org.apache.jasper.JasperException: Can't instantiate class: 'org.apache.myfaces.component.html.ext.HtmlDataTable'. at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:207) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:306) at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.j ava:326) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.jav a:132) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase. java:87) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:225) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:194) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:198) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 32) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:138) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 32) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:245 9) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :132) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:595) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:593) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 32) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:126) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 32) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86 9) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc essConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint .java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow erWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Thread.java:534) Thank you! Paul
Re: Implementing Printable View for dataTable: Problem with target="_blank"?
Sorry, my last attempt to reply didn't come out right; just wanted to thank you for the tip, I ended up using media-specific css classes to solve my problem. I would like to eventually figure out what was wrong with my initial approach, as I can conceive situations where I will need to open new windows and access serialized backing beans from them, but I guess getting to that point with JSF/MyFaces takes time... Thanks again for taking the time to respond. Paul Spencer-3 wrote: > > Mjovanov, > I just have time for short answers. You will need to do the research. > > 1) Media specific CSS Classes may be the answer. This way the user > prints from the browser without the need of a "Printable Format" page. > > 2) Shale Dialogs. http://shale.apache.org. > > > Paul Spencer > > > > mjovanov wrote: >> Hello, >> >> Please consider the following scenario: a page with a dataTable component >> and a backing bean with two DataModel properties, one for the rows >> (binding >> to the 'value' attribute of the dataTable) and one for columns (binding >> to >> the 'value' attribute of the nested t:columns tag). The backing bean is >> configured in faces-config.xml to 'request' scope, but is being >> serialized >> between requests by using the t:saveState tag (so that paging for example >> would not require additional hits to the database). So far everything is >> working as expected. However, problems arise when I try to implement a >> link >> on the page that allows a user to open the table in a new window, and >> without paging (for printing purposes). The catch is that I want to be >> able >> to still use the same backing bean so that the data doesn’t have to be >> retrieved again, and also so that the sort would be preserved. Could >> anyone >> suggest the approach to take? I tried the following: >> >> Define a commandLink component and bind it to an action method on the >> backing bean, like this: >> >> > class="linkCaption" rendered="#{workbenchForm.dataFound}"> >> > alt="#{msg.labelPrintQueueSumm}" width="21" height="14" /> >> >> >> >> The body of the action method would then look like something like this: >> >> public void forwardToPrintView() throws IOException, ServletException { >> HttpServletRequest request = (HttpServletRequest)getRequest(); >> HttpServletResponse response = (HttpServletResponse)getResponse(); >> request.setAttribute("rows", rows.getWrappedData()); >> request.setAttribute("columns", columns.getWrappedData()); >> >> request.getRequestDispatcher("/workbenchPrint.faces").forward(request, >> response); >> getFacesContext().responseComplete(); >> } >> >> However this only works one time; after that I start seeing some really >> weird behavior, like all links on the original page that were previously >> working correctly start opening content in a new window?! At first I >> though >> there may be a problem with the target=”_blank” attribute, but when I >> switched the commandLink component to an outputLink and had it point to >> another page all together (without accessing the serialized backing bean) >> the problem went away; could it be that the JSF state some how got >> corrupted? Any suggestions/clues would be greatly appreciated. >> >> PS I was able to get very similar functionality to work for "Exporting >> to >> Excel"; the action method for this looks like this: >> >> public void exportHtmlTableToExcel() throws IOException{ >> >> /*Set the filename >> DateTime dt = new DateTime(); >> DateTimeFormatter fmt = >> DateTimeFormat.forPattern("-MM-dd_HHmmss"); >> String filename = dt.toString(fmt) + ".xls";*/ >> >> //Setup the output >> String contentType = "application/vnd.ms-excel"; >> FacesContext fc = FacesContext.getCurrentInstance(); >> String filename = >> fc.getExternalContext().getUserPrincipal().getName() >> + "-"+ System.currentTimeMillis() + ".xls"; >> HttpServletResponse response = >> (HttpServletResponse)fc.getExternalContext().getResponse(); >> response.setHeader("Content-disposition", "attachment; filename=" + >> filename); >> response.setContentType(contentType); >> >> //Write the table back out >> PrintWriter out = response.getWriter(); >> //First write column headings >> List columnList = (List)columns.getWrappedData(); >> for (Iterator it = columnList.iterator(); it.hasNext(); ) { >> out.print(((TableColumnDTO)it.next()).getLabel() + "\t"); >> } >> out.println(); >> List data = (List)rows.getWrappedData(); >> for (Iterator i = data.iterator(); i.hasNext(); ) { >> List row = (List)i.next(); >> for (Iterator j = row.iterator(); j.hasNext(); ) { >> Object value = j.next(); >> out.print((value != null ? value : "") + "\t"); >> } >> out.println(); >> } >>
Re: Implementing Printable View for dataTable: Problem with target="_blank"?
Paul Spencer-3 wrote: > > Mjovanov, > I just have time for short answers. You will need to do the research. > > 1) Media specific CSS Classes may be the answer. This way the user > prints from the browser without the need of a "Printable Format" page. > > 2) Shale Dialogs. http://shale.apache.org. > > > Paul Spencer > > > > mjovanov wrote: >> Hello, >> >> Please consider the following scenario: a page with a dataTable component >> and a backing bean with two DataModel properties, one for the rows >> (binding >> to the 'value' attribute of the dataTable) and one for columns (binding >> to >> the 'value' attribute of the nested t:columns tag). The backing bean is >> configured in faces-config.xml to 'request' scope, but is being >> serialized >> between requests by using the t:saveState tag (so that paging for example >> would not require additional hits to the database). So far everything is >> working as expected. However, problems arise when I try to implement a >> link >> on the page that allows a user to open the table in a new window, and >> without paging (for printing purposes). The catch is that I want to be >> able >> to still use the same backing bean so that the data doesn’t have to be >> retrieved again, and also so that the sort would be preserved. Could >> anyone >> suggest the approach to take? I tried the following: >> >> Define a commandLink component and bind it to an action method on the >> backing bean, like this: >> >> > class="linkCaption" rendered="#{workbenchForm.dataFound}"> >> > alt="#{msg.labelPrintQueueSumm}" width="21" height="14" /> >> >> >> >> The body of the action method would then look like something like this: >> >> public void forwardToPrintView() throws IOException, ServletException { >> HttpServletRequest request = (HttpServletRequest)getRequest(); >> HttpServletResponse response = (HttpServletResponse)getResponse(); >> request.setAttribute("rows", rows.getWrappedData()); >> request.setAttribute("columns", columns.getWrappedData()); >> >> request.getRequestDispatcher("/workbenchPrint.faces").forward(request, >> response); >> getFacesContext().responseComplete(); >> } >> >> However this only works one time; after that I start seeing some really >> weird behavior, like all links on the original page that were previously >> working correctly start opening content in a new window?! At first I >> though >> there may be a problem with the target=”_blank” attribute, but when I >> switched the commandLink component to an outputLink and had it point to >> another page all together (without accessing the serialized backing bean) >> the problem went away; could it be that the JSF state some how got >> corrupted? Any suggestions/clues would be greatly appreciated. >> >> PS I was able to get very similar functionality to work for "Exporting >> to >> Excel"; the action method for this looks like this: >> >> public void exportHtmlTableToExcel() throws IOException{ >> >> /*Set the filename >> DateTime dt = new DateTime(); >> DateTimeFormatter fmt = >> DateTimeFormat.forPattern("-MM-dd_HHmmss"); >> String filename = dt.toString(fmt) + ".xls";*/ >> >> //Setup the output >> String contentType = "application/vnd.ms-excel"; >> FacesContext fc = FacesContext.getCurrentInstance(); >> String filename = >> fc.getExternalContext().getUserPrincipal().getName() >> + "-"+ System.currentTimeMillis() + ".xls"; >> HttpServletResponse response = >> (HttpServletResponse)fc.getExternalContext().getResponse(); >> response.setHeader("Content-disposition", "attachment; filename=" + >> filename); >> response.setContentType(contentType); >> >> //Write the table back out >> PrintWriter out = response.getWriter(); >> //First write column headings >> List columnList = (List)columns.getWrappedData(); >> for (Iterator it = columnList.iterator(); it.hasNext(); ) { >> out.print(((TableColumnDTO)it.next()).getLabel() + "\t"); >> } >> out.println(); >> List data = (List)rows.getWrappedData(); >> for (Iterator i = data.iterator(); i.hasNext(); ) { >> List row = (List)i.next(); >> for (Iterator j = row.iterator(); j.hasNext(); ) { >> Object value = j.next(); >> out.print((value != null ? value : "") + "\t"); >> } >> out.println(); >> } >> out.close(); >> fc.responseComplete(); >> } >> >> One important difference to note is that the link for "Exporting to >> Excel" >> does not have the target attribute set to '_blank' (since the content >> type >> would force another application to handle it, thus opening it in a new >> window automatically). > > > -- View this message in context: http://www.nabble.com/Implementing-Printable-View-for-dataTable%3A-Problem-with-target%3D%22_blank%
Re: Implementing Printable View for dataTable: Problem with target="_blank"?
Mjovanov, I just have time for short answers. You will need to do the research. 1) Media specific CSS Classes may be the answer. This way the user prints from the browser without the need of a "Printable Format" page. 2) Shale Dialogs. http://shale.apache.org. Paul Spencer mjovanov wrote: Hello, Please consider the following scenario: a page with a dataTable component and a backing bean with two DataModel properties, one for the rows (binding to the 'value' attribute of the dataTable) and one for columns (binding to the 'value' attribute of the nested t:columns tag). The backing bean is configured in faces-config.xml to 'request' scope, but is being serialized between requests by using the t:saveState tag (so that paging for example would not require additional hits to the database). So far everything is working as expected. However, problems arise when I try to implement a link on the page that allows a user to open the table in a new window, and without paging (for printing purposes). The catch is that I want to be able to still use the same backing bean so that the data doesn’t have to be retrieved again, and also so that the sort would be preserved. Could anyone suggest the approach to take? I tried the following: Define a commandLink component and bind it to an action method on the backing bean, like this: alt="#{msg.labelPrintQueueSumm}" width="21" height="14" /> The body of the action method would then look like something like this: public void forwardToPrintView() throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest)getRequest(); HttpServletResponse response = (HttpServletResponse)getResponse(); request.setAttribute("rows", rows.getWrappedData()); request.setAttribute("columns", columns.getWrappedData()); request.getRequestDispatcher("/workbenchPrint.faces").forward(request, response); getFacesContext().responseComplete(); } However this only works one time; after that I start seeing some really weird behavior, like all links on the original page that were previously working correctly start opening content in a new window?! At first I though there may be a problem with the target=”_blank” attribute, but when I switched the commandLink component to an outputLink and had it point to another page all together (without accessing the serialized backing bean) the problem went away; could it be that the JSF state some how got corrupted? Any suggestions/clues would be greatly appreciated. PS I was able to get very similar functionality to work for "Exporting to Excel"; the action method for this looks like this: public void exportHtmlTableToExcel() throws IOException{ /*Set the filename DateTime dt = new DateTime(); DateTimeFormatter fmt = DateTimeFormat.forPattern("-MM-dd_HHmmss"); String filename = dt.toString(fmt) + ".xls";*/ //Setup the output String contentType = "application/vnd.ms-excel"; FacesContext fc = FacesContext.getCurrentInstance(); String filename = fc.getExternalContext().getUserPrincipal().getName() + "-"+ System.currentTimeMillis() + ".xls"; HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse(); response.setHeader("Content-disposition", "attachment; filename=" + filename); response.setContentType(contentType); //Write the table back out PrintWriter out = response.getWriter(); //First write column headings List columnList = (List)columns.getWrappedData(); for (Iterator it = columnList.iterator(); it.hasNext(); ) { out.print(((TableColumnDTO)it.next()).getLabel() + "\t"); } out.println(); List data = (List)rows.getWrappedData(); for (Iterator i = data.iterator(); i.hasNext(); ) { List row = (List)i.next(); for (Iterator j = row.iterator(); j.hasNext(); ) { Object value = j.next(); out.print((value != null ? value : "") + "\t"); } out.println(); } out.close(); fc.responseComplete(); } One important difference to note is that the link for "Exporting to Excel" does not have the target attribute set to '_blank' (since the content type would force another application to handle it, thus opening it in a new window automatically).
Implementing Printable View for dataTable: Problem with target="_blank"?
Hello, Please consider the following scenario: a page with a dataTable component and a backing bean with two DataModel properties, one for the rows (binding to the 'value' attribute of the dataTable) and one for columns (binding to the 'value' attribute of the nested t:columns tag). The backing bean is configured in faces-config.xml to 'request' scope, but is being serialized between requests by using the t:saveState tag (so that paging for example would not require additional hits to the database). So far everything is working as expected. However, problems arise when I try to implement a link on the page that allows a user to open the table in a new window, and without paging (for printing purposes). The catch is that I want to be able to still use the same backing bean so that the data doesn’t have to be retrieved again, and also so that the sort would be preserved. Could anyone suggest the approach to take? I tried the following: Define a commandLink component and bind it to an action method on the backing bean, like this: The body of the action method would then look like something like this: public void forwardToPrintView() throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest)getRequest(); HttpServletResponse response = (HttpServletResponse)getResponse(); request.setAttribute("rows", rows.getWrappedData()); request.setAttribute("columns", columns.getWrappedData()); request.getRequestDispatcher("/workbenchPrint.faces").forward(request, response); getFacesContext().responseComplete(); } However this only works one time; after that I start seeing some really weird behavior, like all links on the original page that were previously working correctly start opening content in a new window?! At first I though there may be a problem with the target=”_blank” attribute, but when I switched the commandLink component to an outputLink and had it point to another page all together (without accessing the serialized backing bean) the problem went away; could it be that the JSF state some how got corrupted? Any suggestions/clues would be greatly appreciated. PS I was able to get very similar functionality to work for "Exporting to Excel"; the action method for this looks like this: public void exportHtmlTableToExcel() throws IOException{ /*Set the filename DateTime dt = new DateTime(); DateTimeFormatter fmt = DateTimeFormat.forPattern("-MM-dd_HHmmss"); String filename = dt.toString(fmt) + ".xls";*/ //Setup the output String contentType = "application/vnd.ms-excel"; FacesContext fc = FacesContext.getCurrentInstance(); String filename = fc.getExternalContext().getUserPrincipal().getName() + "-"+ System.currentTimeMillis() + ".xls"; HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse(); response.setHeader("Content-disposition", "attachment; filename=" + filename); response.setContentType(contentType); //Write the table back out PrintWriter out = response.getWriter(); //First write column headings List columnList = (List)columns.getWrappedData(); for (Iterator it = columnList.iterator(); it.hasNext(); ) { out.print(((TableColumnDTO)it.next()).getLabel() + "\t"); } out.println(); List data = (List)rows.getWrappedData(); for (Iterator i = data.iterator(); i.hasNext(); ) { List row = (List)i.next(); for (Iterator j = row.iterator(); j.hasNext(); ) { Object value = j.next(); out.print((value != null ? value : "") + "\t"); } out.println(); } out.close(); fc.responseComplete(); } One important difference to note is that the link for "Exporting to Excel" does not have the target attribute set to '_blank' (since the content type would force another application to handle it, thus opening it in a new window automatically). -- View this message in context: http://www.nabble.com/Implementing-Printable-View-for-dataTable%3A-Problem-with-target%3D%22_blank%22--tf2265822.html#a6287426 Sent from the MyFaces - Users forum at Nabble.com.
DataTable problem
Hi all, I have a data table as shown below. As you can see forceIdIndexFormula and rowId is same. Problem is when I click on a row which has already been deleted by someone else (during concurrent operations) , the row simply disappears. It does not invoke the set method that i have written in my bean. And in set method itself I come to know the row id of the row which has been clicked. But this method does not get invoked if row has been deleted by someone else(by other user). In set method itself I can give message to user whether row has been deleted by someone else. One soln to this is that I can make preserveDataModel="true". But if preserveDataModel is true then on deletion of row , it deletes the entries form database but row still remains with table. what I need is that on deletion of row the row should disapper from table and if I try to delete the same row which has been deleted by other user then I should be able to get the message like row has already been deleted by other user. Table is shown below: . ... ... . ... ... . ...This is delete button for the rows. If I click the delete button, row should disapper from the table in same page. But if the row is already deleted by some other user then I shold be able to get a nessage like 'row has already been deleted ' . ... Any suggestion ? Thanks and regards Arvind __ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/
RE: dataTable> problem.
This is one of the issues I'm trying to handle internally. We had two browser sessions opened and update the tables and perform delete actions. What we found was that the selection of objects to delete by one user actually deletes the elements added by another user. And this was because we work on the row Index and as well, the dataTable makes calls to the getter of the model before doing any further operation which updates the new model with the latest value. I'm worried concurrent user support might have to be handled by the application developer (and I thought life would be simpler ;-) ). I have put this issue on the back burner for a while now, will update you once I test it. Thanks Balaji -Original Message- From: Mr Arvind Pandey [mailto:[EMAIL PROTECTED] Sent: Monday, August 21, 2006 2:49 PM To: users@myfaces.apache.org Subject: problem. Hi, I am using to display customer info. Each row contains delete button also to delete the info a particular customer. preserveDataModel attribute of the datatable is set to false. Everything working properly when i am going straight. Now suppose I have 10 rows in the table and I delete the first row , the first row gets deleted from table and database also. But when I go back to previous page using back button of Browser and try to delete the first row again which has been deleted already, then it deletes the next immediate row , I mean second row. If anyone can help me, I will be highly obliged. Any suggestion will be appreciated. Thanks and regards... Arvind Pandey __ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Re: Tomahawk dataTable Problem - replacing standard dataTable with tomahawks one shows nothing
Thats the bug - so thx for help ;) i found it myself. Good to hear ;-) kind regards Torsten -- 0 and 1. Now what could be so hard about that? -- -- Matthias Wessendorf Aechterhoek 18 48282 Emsdetten blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com
Re: Tomahawk dataTable Problem - replacing standard dataTable with tomahawks one shows nothing
http://issues.apache.org/jira/browse/TOMAHAWK-89 Thats the bug - so thx for help ;) i found it myself. kind regards Torsten -- 0 and 1. Now what could be so hard about that? --
Re: Tomahawk dataTable Problem - replacing standard dataTable with tomahawks one shows nothing
http://issues.apache.org/jira/browse/MYFACES-278 Might be the cause - but according to this report, it should have been fixed in 1.1.3 - i am using latest 1.1.3 snapshot, but it doesnt work, is it fixed or not in 1.1.3? kind regards
Re: Tomahawk dataTable Problem - replacing standard dataTable with tomahawks one shows nothing
Investigated a little bit and tried other models. If i am using a SortableModel made with an ArrayDataModel with Customers supplied statically in the Code it works, t:dataTable shows what i want to see. But if i am going to use a SortableModel from a ResultSetDataModel to get the Customers from a database table, only h:dataTable still works, t:dataTable shows nothing. Any things with this Model type to get it working with tomahawk extended Table? code which works with the tomahawk dataTable: ... private Customer[] customers = { new Customer("1","Anna","034142","My Street","Leipzig","Sachsen"), new Customer("2","Bert","014142","Ny Street","Halle","Sachsen-Anhalt"), }; public TableData() { ... ArrayDataModel ar_model = new ArrayDataModel(customers); filterModel = new SortableModel(ar_model); ... } code which doesnt work with tomahawks dataTable, but with the default one: public TableData() { open(); Statement stmt = conn .createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet result = stmt.executeQuery("SELECT * FROM Customers"); CachedRowSetImpl crs = new CachedRowSetImpl(); crs.populate(result); ResultSetDataModel db_model = new ResultSetDataModel(crs.getOriginal()); filterModel = new SortableModel(db_model); close(); } The database table was made with this sql script: CREATE TABLE Customers ( Cust_ID INT, Name CHAR(30), Phone_Number CHAR(15), Street_Address CHAR(30), City CHAR(30), State CHAR(15) ); INSERT INTO Customers VALUES (1, 'William Dupont', '(652)488-9931', '801 Oak Street', 'Eugene', 'Nebraska'); INSERT INTO Customers VALUES (2, 'Anna Keeney', '(716)834-8772', '86 East Amherst Street', 'Buffalo', 'New York'); INSERT INTO Customers VALUES (3, 'Mariko Randor', '(451)842-8933', '923 Maple Street', 'Springfield', 'Tennessee'); Some hints would be nice. kind regards Torsten
Tomahawk dataTable Problem - replacing standard dataTable with tomahawks one shows nothing
Hello. I am new to JSF and doing some tutorials, reading docs and so on for learning. Reading corejsf Book and doing their examples i want to modifiy it for learning purposes, so i've taken the chapter 5 tutorial and modified it to use a resultsetmodel, which worked flawless. The problem now is, if i replace h:dataTable with t:dataTable to use the tomahawk one, only the table headers are rendered, the data is missing. Leaving the h:tableData, it works. Thats my index.jsp: <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t" %> Using h:dataTable instead of t:dataTable works. Wheres the problem, reading the docs and looking at sortTable.java from the examples, i thought replacing the original one with tomahawks should work without any modification? Tomcat logs are free from errors or warnings, i am using myfaces and tomahawk 1.1.3. kind regards Torsten
Tree2 in a DataTable problem
Title: Tree2 in a DataTable problem Hi All, I have na page with a tree2 component on a column inside a dataTable component. The tree2 is configured to use clientSideToogle, but the toogle does not work I think because the component tree2 generate the same clientID for all the tree2 components in each row of the table. Does anyone used a tree2 inside a data table and have the same problem??? Thanks in advance Rogerio "Essa mensagem é destinada exclusivamente ao seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional ou cuja divulgação seja proibida por lei. O uso não autorizado de tais informações é proibido e está sujeito às penalidades cabíveis. This message is intended exclusively for its addressee and may contain information that is confidential and protected by a professional privilege or whose disclosure is prohibited by law. Unauthorized use of such information is prohibited and subject to applicable penalties."
delete rows of dataTable Problem .......setRowIndex() bug??
Hi everybody, I'm deleting elements of a dataTable with help of a UISelectBoolean component on each line of my dataTable like that: i=0; for (Iterator iter = l.iterator(); iter.hasNext();) { TableElecteur element = (TableElecteur) iter.next(); this.dataTable.setRowIndex(i); if (this.selectToDel.isSelected()) session2.delete(element); i++; } The delete process worf fine but I've got the following error when the datatable is refresh: 24 mars 2006 11:01:58 org.apache.catalina.core.ApplicationDispatcher invoke GRAVE: "Servlet.service()" pour la servlet jsp a lancé une exception java.lang.NullPointerException at org.apache.myfaces.component.html.ext.HtmlDataTableHack.restoreDescendantComponentStates(HtmlDataTableHack.java:245) at org.apache.myfaces.component.html.ext.HtmlDataTableHack.restoreDescendantComponentStates(HtmlDataTableHack.java:257) at org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex(HtmlDataTableHack.java:200) at org.apache.myfaces.component.html.ext.HtmlDataTable.setRowIndex(HtmlDataTable.java:129) at javax.faces.component.html.HtmlDataTable.encodeBegin(HtmlDataTable.java:35) at org.apache.myfaces.component.html.ext.HtmlDataTableHack.encodeBegin(HtmlDataTableHack.java:126) at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(HtmlDataTable.java:312) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:441) at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427) at org.apache.myfaces.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:62) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:450) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:203) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331) at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:349) at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:253) at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55) at org.apache.jsp.pages.maintabbed_jsp._jspx_meth_h_panelGrid_2(org.apache.jsp.pages.maintabbed_jsp:1558) at org.apache.jsp.pages.maintabbed_jsp._jspx_meth_h_form_0(org.apache.jsp.pages.maintabbed_jsp:360) at org.apache.jsp.pages.maintabbed_jsp._jspx_meth_f_view_0(org.apache.jsp.pages.maintabbed_jsp:277) at org.apache.jsp.pages.maintabbed_jsp._jspService(org.apache.jsp.pages.maintabbed_jsp:243) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(Stan
RE: DataTable Problem
We fixed the problem we were having by saving the state of the table's backing bean using . Now, the button within the table fires fine. - Brendan -Original Message- From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] Sent: Thursday, October 27, 2005 2:51 AM To: MyFaces Discussion Subject: Re: DataTable Problem We have quite a lot of such issues. Maybe we should add a check if the number of rows in the decode phase don´t match with the row number while rendering. 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > Oh, I understand now. Sorry for being so dense! > > Thanks to both of you! > > - Brendan > > -Original Message- > From: Mike Kienenberger [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 26, 2005 11:29 AM > To: MyFaces Discussion > Subject: Re: DataTable Problem > > > What Mathias is saying is that you have to maintain the model during > the Restore View phase for the next page.Without a model, your > command link is effectively set to rendered=false, and no action event > will be generated. I've never tested to see if it matters what model > is available on the next page, but I'd expect it'd have to be the same > model in order for you to determine which row was clicked, if that is > important to you. > > On 10/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote: > > #{maintainSkillBean.skillList} returns at least one row, because that > > provides the link that we click. The problem is, when we click the link, > > the next page does not get displayed. > > > > - Brendan > > > > -Original Message- > > From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, October 26, 2005 3:05 AM > > To: MyFaces Discussion > > Subject: Re: DataTable Problem > > > > > > The value for #{maintainSkillBean.skillList} must not return null or > > an empty list during the decode phase. Place a debug-breakpoint into > > the getter method to see when it is called. You can also use > > t:datatable and preserveDataModel="true". > > > > 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > > > We're experiencing a problem using a commandLink (or commandButton) > > > inside a dataTable. We're hoping that it's just something we're doing > > > wrong. > > > > > > If we copy the commandLink outside the dataTable (just as a test), and > > > then click on the commandLink outside the dataTable, then control goes > > > to the desired page. > > > > > > However, if we click on the commandLink that is inside the table, the > > > same page gets displayed (with an empty table). > > > > > > Here is the JSP code: > > > > > > > > styleClass="commandLinkHomePage"> > > > > > > > > > > > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > > > cellpadding="2" cellspacing="2"> > > > > > > > > > > > > > > > > > styleClass="commandLinkHomePage" > > > > > > styleClass="link"/> > > > > > > > > > > > > > > > Any clues about why clicking the first commandLink would correctly bring > > > us to the home page, whereas clicking the second commandLink would just > > > redisplay the current page? We have up top, and no error > > > messages are getting displayed. > > > > > > - Brendan > > > > > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > > > the same result. We also tried using both and > > > , but still no luck. > > > > > > > > > -- > > Mathias > > > -- Mathias
Re: DataTable Problem
We have quite a lot of such issues. Maybe we should add a check if the number of rows in the decode phase don´t match with the row number while rendering. 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > Oh, I understand now. Sorry for being so dense! > > Thanks to both of you! > > - Brendan > > -Original Message- > From: Mike Kienenberger [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 26, 2005 11:29 AM > To: MyFaces Discussion > Subject: Re: DataTable Problem > > > What Mathias is saying is that you have to maintain the model during > the Restore View phase for the next page.Without a model, your > command link is effectively set to rendered=false, and no action event > will be generated. I've never tested to see if it matters what model > is available on the next page, but I'd expect it'd have to be the same > model in order for you to determine which row was clicked, if that is > important to you. > > On 10/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote: > > #{maintainSkillBean.skillList} returns at least one row, because that > > provides the link that we click. The problem is, when we click the link, > > the next page does not get displayed. > > > > - Brendan > > > > -Original Message- > > From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, October 26, 2005 3:05 AM > > To: MyFaces Discussion > > Subject: Re: DataTable Problem > > > > > > The value for #{maintainSkillBean.skillList} must not return null or > > an empty list during the decode phase. Place a debug-breakpoint into > > the getter method to see when it is called. You can also use > > t:datatable and preserveDataModel="true". > > > > 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > > > We're experiencing a problem using a commandLink (or commandButton) > > > inside a dataTable. We're hoping that it's just something we're doing > > > wrong. > > > > > > If we copy the commandLink outside the dataTable (just as a test), and > > > then click on the commandLink outside the dataTable, then control goes > > > to the desired page. > > > > > > However, if we click on the commandLink that is inside the table, the > > > same page gets displayed (with an empty table). > > > > > > Here is the JSP code: > > > > > > > > styleClass="commandLinkHomePage"> > > > > > > > > > > > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > > > cellpadding="2" cellspacing="2"> > > > > > > > > > > > > > > > > > styleClass="commandLinkHomePage" > > > > > > styleClass="link"/> > > > > > > > > > > > > > > > Any clues about why clicking the first commandLink would correctly bring > > > us to the home page, whereas clicking the second commandLink would just > > > redisplay the current page? We have up top, and no error > > > messages are getting displayed. > > > > > > - Brendan > > > > > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > > > the same result. We also tried using both and > > > , but still no luck. > > > > > > > > > -- > > Mathias > > > -- Mathias
RE: DataTable Problem
Oh, I understand now. Sorry for being so dense! Thanks to both of you! - Brendan -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 11:29 AM To: MyFaces Discussion Subject: Re: DataTable Problem What Mathias is saying is that you have to maintain the model during the Restore View phase for the next page.Without a model, your command link is effectively set to rendered=false, and no action event will be generated. I've never tested to see if it matters what model is available on the next page, but I'd expect it'd have to be the same model in order for you to determine which row was clicked, if that is important to you. On 10/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote: > #{maintainSkillBean.skillList} returns at least one row, because that > provides the link that we click. The problem is, when we click the link, the > next page does not get displayed. > > - Brendan > > -Original Message- > From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 26, 2005 3:05 AM > To: MyFaces Discussion > Subject: Re: DataTable Problem > > > The value for #{maintainSkillBean.skillList} must not return null or > an empty list during the decode phase. Place a debug-breakpoint into > the getter method to see when it is called. You can also use > t:datatable and preserveDataModel="true". > > 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > > We're experiencing a problem using a commandLink (or commandButton) > > inside a dataTable. We're hoping that it's just something we're doing > > wrong. > > > > If we copy the commandLink outside the dataTable (just as a test), and > > then click on the commandLink outside the dataTable, then control goes > > to the desired page. > > > > However, if we click on the commandLink that is inside the table, the > > same page gets displayed (with an empty table). > > > > Here is the JSP code: > > > > > styleClass="commandLinkHomePage"> > > > > > > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > > cellpadding="2" cellspacing="2"> > > > > > > > > > > > styleClass="commandLinkHomePage" > > > > styleClass="link"/> > > > > > > > > > > Any clues about why clicking the first commandLink would correctly bring > > us to the home page, whereas clicking the second commandLink would just > > redisplay the current page? We have up top, and no error > > messages are getting displayed. > > > > - Brendan > > > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > > the same result. We also tried using both and > > , but still no luck. > > > > > -- > Mathias >
Re: DataTable Problem
What Mathias is saying is that you have to maintain the model during the Restore View phase for the next page.Without a model, your command link is effectively set to rendered=false, and no action event will be generated. I've never tested to see if it matters what model is available on the next page, but I'd expect it'd have to be the same model in order for you to determine which row was clicked, if that is important to you. On 10/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote: > #{maintainSkillBean.skillList} returns at least one row, because that > provides the link that we click. The problem is, when we click the link, the > next page does not get displayed. > > - Brendan > > -Original Message- > From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 26, 2005 3:05 AM > To: MyFaces Discussion > Subject: Re: DataTable Problem > > > The value for #{maintainSkillBean.skillList} must not return null or > an empty list during the decode phase. Place a debug-breakpoint into > the getter method to see when it is called. You can also use > t:datatable and preserveDataModel="true". > > 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > > We're experiencing a problem using a commandLink (or commandButton) > > inside a dataTable. We're hoping that it's just something we're doing > > wrong. > > > > If we copy the commandLink outside the dataTable (just as a test), and > > then click on the commandLink outside the dataTable, then control goes > > to the desired page. > > > > However, if we click on the commandLink that is inside the table, the > > same page gets displayed (with an empty table). > > > > Here is the JSP code: > > > > > styleClass="commandLinkHomePage"> > > > > > > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > > cellpadding="2" cellspacing="2"> > > > > > > > > > > > styleClass="commandLinkHomePage" > > > > styleClass="link"/> > > > > > > > > > > Any clues about why clicking the first commandLink would correctly bring > > us to the home page, whereas clicking the second commandLink would just > > redisplay the current page? We have up top, and no error > > messages are getting displayed. > > > > - Brendan > > > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > > the same result. We also tried using both and > > , but still no luck. > > > > > -- > Mathias >
RE: DataTable Problem
That sounds like the problem I have with tiles...looking at the page source I noticed the action generate for the link leads to the same page where I'm already. Is it the same for you?may be there is a bug... Rosalba --- "CONNER, BRENDAN (SBCSI)" <[EMAIL PROTECTED]> wrote: > #{maintainSkillBean.skillList} returns at least one > row, because that provides the link that we click. > The problem is, when we click the link, the next > page does not get displayed. > > - Brendan > > -Original Message- > From: Mathias Brökelmann > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 26, 2005 3:05 AM > To: MyFaces Discussion > Subject: Re: DataTable Problem > > > The value for #{maintainSkillBean.skillList} must > not return null or > an empty list during the decode phase. Place a > debug-breakpoint into > the getter method to see when it is called. You can > also use > t:datatable and preserveDataModel="true". > > 2005/10/26, CONNER, BRENDAN (SBCSI) > <[EMAIL PROTECTED]>: > > We're experiencing a problem using a commandLink > (or commandButton) > > inside a dataTable. We're hoping that it's just > something we're doing > > wrong. > > > > If we copy the commandLink outside the dataTable > (just as a test), and > > then click on the commandLink outside the > dataTable, then control goes > > to the desired page. > > > > However, if we click on the commandLink that is > inside the table, the > > same page gets displayed (with an empty table). > > > > Here is the JSP code: > > > > > styleClass="commandLinkHomePage"> > > styleClass="link"/> > > > > > > value="#{maintainSkillBean.skillList}" var="element" > > headerClass="reportHeader" > columnClasses="reportDetailLeft" > > cellpadding="2" cellspacing="2"> > > > > > > > > > > action="displayHome" title="Skill Id" > > styleClass="commandLinkHomePage" > > > value="#{element.skillId}" > > styleClass="link"/> > > > > > > > > > > Any clues about why clicking the first commandLink > would correctly bring > > us to the home page, whereas clicking the second > commandLink would just > > redisplay the current page? We have > up top, and no error > > messages are getting displayed. > > > > - Brendan > > > > P.S. We tried this with both 1.1.1RC2 and > 1.1.1RC3, and we're getting > > the same result. We also tried using both > and > > , but still no luck. > > > > > -- > Mathias > __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
RE: DataTable Problem
#{maintainSkillBean.skillList} returns at least one row, because that provides the link that we click. The problem is, when we click the link, the next page does not get displayed. - Brendan -Original Message- From: Mathias Brökelmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 3:05 AM To: MyFaces Discussion Subject: Re: DataTable Problem The value for #{maintainSkillBean.skillList} must not return null or an empty list during the decode phase. Place a debug-breakpoint into the getter method to see when it is called. You can also use t:datatable and preserveDataModel="true". 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > We're experiencing a problem using a commandLink (or commandButton) > inside a dataTable. We're hoping that it's just something we're doing > wrong. > > If we copy the commandLink outside the dataTable (just as a test), and > then click on the commandLink outside the dataTable, then control goes > to the desired page. > > However, if we click on the commandLink that is inside the table, the > same page gets displayed (with an empty table). > > Here is the JSP code: > > styleClass="commandLinkHomePage"> > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > cellpadding="2" cellspacing="2"> > > > > > styleClass="commandLinkHomePage" > > styleClass="link"/> > > > > > Any clues about why clicking the first commandLink would correctly bring > us to the home page, whereas clicking the second commandLink would just > redisplay the current page? We have up top, and no error > messages are getting displayed. > > - Brendan > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > the same result. We also tried using both and > , but still no luck. > -- Mathias
Re: DataTable Problem
The value for #{maintainSkillBean.skillList} must not return null or an empty list during the decode phase. Place a debug-breakpoint into the getter method to see when it is called. You can also use t:datatable and preserveDataModel="true". 2005/10/26, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]>: > We're experiencing a problem using a commandLink (or commandButton) > inside a dataTable. We're hoping that it's just something we're doing > wrong. > > If we copy the commandLink outside the dataTable (just as a test), and > then click on the commandLink outside the dataTable, then control goes > to the desired page. > > However, if we click on the commandLink that is inside the table, the > same page gets displayed (with an empty table). > > Here is the JSP code: > > styleClass="commandLinkHomePage"> > > > > headerClass="reportHeader" columnClasses="reportDetailLeft" > cellpadding="2" cellspacing="2"> > > > > > styleClass="commandLinkHomePage" > > styleClass="link"/> > > > > > Any clues about why clicking the first commandLink would correctly bring > us to the home page, whereas clicking the second commandLink would just > redisplay the current page? We have up top, and no error > messages are getting displayed. > > - Brendan > > P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting > the same result. We also tried using both and > , but still no luck. > -- Mathias
DataTable Problem
We're experiencing a problem using a commandLink (or commandButton) inside a dataTable. We're hoping that it's just something we're doing wrong. If we copy the commandLink outside the dataTable (just as a test), and then click on the commandLink outside the dataTable, then control goes to the desired page. However, if we click on the commandLink that is inside the table, the same page gets displayed (with an empty table). Here is the JSP code: Any clues about why clicking the first commandLink would correctly bring us to the home page, whereas clicking the second commandLink would just redisplay the current page? We have up top, and no error messages are getting displayed. - Brendan P.S. We tried this with both 1.1.1RC2 and 1.1.1RC3, and we're getting the same result. We also tried using both and , but still no luck.
Re: dataTable Problem with Detail Link 1.0.9-1.1.0
the column footers are now rendered before the table body containing the rows (as it is recomended by html spec). Take a look into the rendered html code. The result is that your valuebinding in your footers are called before the value binding of your datamodel. -- Mathias > public String getSumme() { > > if (weeks.getWrappedData() == null ) { // before upgrading to > 1.1.0 this was > also not necessary, as always the getWeeks() function was called first. > this.getData(); > }
dataTable Problem with Detail Link 1.0.9-1.1.0
Hello, I have a overview page with a dataTable-Component and a commandButton for each row, to get to a detail page for the corresponding value. Since migration to myfaces-1.1.0 this is not working any longer. If I put the ManagedBean of my dataTable in session Scope, I have the values of the table available, but if I do a data.getRowData(); I always get the last row. If I put the ManagedBean in request Scope the List which holds the data is set to null, even if I use preserveDataModel = true. Here my faces-config NOT complete: http://java.sun.com/dtd/web-facesconfig_1_0.dtd";> weekoverviewForm trainingweb.forms.WeekOverview session * successOneWeek /showOneWeek.jsp org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl The code inside the managed Bean: /* * Created on 31.10.2004 * * Wird aufgerufen um alle Wochen eines Jahresplanes anzuzeigen */ package trainingweb.forms; import java.util.*; import javax.faces.application.Application; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; import javax.servlet.http.HttpServletRequest; import trainingweb.business.BusinessDelegateFactory; import trainingweb.business.IBusinessDelegate; import trainingextern.data.User; import trainingextern.data.WeeklyData; /** * @author stingray * * */ public class WeekOverview { private DataModel weeks = new ListDataModel(); private String summe = new String(); /** * */ public WeekOverview() { super(); } public DataModel getWeeks() { if (weeks.getWrappedData() == null) { this.getData(); } return weeks; } /** * Nach Klick auf "Show" in der Jahresplanübersicht wird diese Methode * aufgerufen Die Methode setzt den Parameter wochenID auf der OneWeek die * angezeigt werden soll! Anschliessend geht es über eine NavRule zur * OneWeek * * @return */ public String goOneWeek() { FacesContext fcontext = FacesContext.getCurrentInstance(); Application app = fcontext.getApplication(); if ( weeks.getWrappedData() == null ) { this.getData(); } WeeklyData weeky = (WeeklyData) weeks.getRowData(); int wochenID = Integer.parseInt(weeky.getNummer()); OneWeek binding = (OneWeek) app.createValueBinding("#{oneWeek}") .getValue(fcontext); binding.setWochenID(wochenID); return "successOneWeek"; } /** * @return Returns the summe. */ public String getSumme() { if (weeks.getWrappedData() == null ) { // before upgrading to 1.1.0 this was also not necessary, as always the getWeeks() function was called first. this.getData(); } float sum = 0; Vector erg = (Vector) weeks.getWrappedData(); Iterator i = erg.iterator(); while (i.hasNext()) { WeeklyData data = (WeeklyData) i.next(); sum += new Float(data.getKm()).floatValue(); } summe = Float.toString(sum); return summe; } private void getData() { FacesContext fcontext = FacesContext.getCurrentInstance(); ExternalContext ext = fcontext.getExternalContext(); HttpServletRequest request = (HttpServletRequest) ext.getRequest(); Application app = fcontext.getApplication(); User myUser = (User) app.createValueBinding("#{User}").getValue( fcontext); BusinessDelegateFactory fact = BusinessDelegateFactory .getInstance(request.getSession()); IBusinessDelegate delegate = fact.getBusinessDelegate(); Vector erg = delegate.getWeeklyPensum(myUser.getName(), myUser .getJahresplan()); weeks.setWrappedData(erg); } } And the jsp: <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="x"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %> -
Re: Datatable Problem/Bug second attempt
Carsten Fregin wrote: I would be interested *g* Sent it down the list yesterday... see thread Hibernate datamodel werner
Re: Datatable Problem/Bug second attempt
I would be interested *g* Werner Punz <[EMAIL PROTECTED]> wrote on 31.01.2005 17:05:43: > Ok I got it working... > the problem was on my side (some bugs in > the backend bean which interfered with the scope > of the Hibernate data model) > The whole thing now works as expected > except some unwanted behavior in the saveState controls > which I have to figure out. > > If anybody is interested in the final and working release > of my Hybernate data model I can repost it again (now in > a working condition which page caching working > as well) > > Kind Regards > > Werner Punz
Re: Datatable Problem/Bug second attempt
Ok I got it working... the problem was on my side (some bugs in the backend bean which interfered with the scope of the Hibernate data model) The whole thing now works as expected except some unwanted behavior in the saveState controls which I have to figure out. If anybody is interested in the final and working release of my Hybernate data model I can repost it again (now in a working condition which page caching working as well) Kind Regards Werner Punz
Re: Datatable Problem/Bug second attempt
Korhonen, Kalle wrote: Yeah, you are definitely doing something wrong. The problem in your case is that you are using two different beans with different scopes. The properties of the longer-than-request scoped bean are populated before the action in your request scoped bean is executed, but you are likely using the session scoped bean as a managed property of the request scoped bean, and those instances are set when your request scoped bean is created. Ok I think I got it, what you want me to say is, that the request scoped bean is not generated at the time the properties are set the first time, it is generated after the action is executed and hence the param pusihng does not work within the action? Hence the parameters correctly are passed into the next form display but the data table is rendered with the non existent first params. a pattern like myobject.delegate.val creates the delegate object only if possible and if not nothing and ignores anything myobject related, before the action call and after the call the delegate.val is populated at a second call to the object which now exists? sounds weird to me, because myobject should already be initialized at the first call and the delegate is assigned at construction time and a pattern of myobject.val creates myobject and populates it if possible before the action call, sounds weird to me, but given that you can do anything, it is possible. I am just wondering why the designers of the specs specified this? The whole thing causes it to look like the propery updates are coming in "late". One way to fix it is to move your search action to the same bean as where your search properties are, which is a better design anyway. Yes... due to the mixes scope I needed, and not knowing x:saveStage I ran into the conclusion I had to do the caching myself - hence the delegates within the backing bean (delegates are very convenient if you have to mix two objects with different scopes). We have a similar page, but our search backing bean is request scoped, and only the results are stored in the session scope with x:saveState. I will look into this, if this works it will simplify things tremendously, because then I can dump lots of cache related things, thanks for your help.
RE: Datatable Problem/Bug second attempt
> -Original Message- > From: Werner Punz [mailto:[EMAIL PROTECTED] > Subject: Re: Datatable Problem/Bug second attempt > Mhh no answer, guess I am alone with my problem... > Does anybody use the data table at all in combination with a > search area on the same page? > If yes... can any hints towards a best practice pattern, for > this case? Yeah, you are definitely doing something wrong. The problem in your case is that you are using two different beans with different scopes. The properties of the longer-than-request scoped bean are populated before the action in your request scoped bean is executed, but you are likely using the session scoped bean as a managed property of the request scoped bean, and those instances are set when your request scoped bean is created. The whole thing causes it to look like the propery updates are coming in "late". One way to fix it is to move your search action to the same bean as where your search properties are, which is a better design anyway. We have a similar page, but our search backing bean is request scoped, and only the results are stored in the session scope with x:saveState. Kalle > Werner Punz wrote: > > > Since I got no concrete answer on my problem I'll make a second > > attempt with more info I found out in the meanwhile. > > > > There seems to be a problem with the rendering order between a > > DataTable and the rest of the components. > > > > Here is my situation: > > I have a form which encloses several > > components which are needed for the search and a datatable > component > > with a custom data model. > > There is a command link which should trigger the query via a custom > > method in the backing bean something like this > > > > The scope of the bean connected to the input fields is longer than > > request (if you look into the attached fields it might look > weird, but > > I have handled them by a transparent query history cache which has > > session scope and a limited size) > > > > > value="#{mybeanwithasessionscoe.property}" /> > > > > > > > > > > > > The table which is below the search area within the same form is a > > standard datatable with a custom datamodel and a connected data > > scroller... (see the attached files) > > > > The problem I run into is, that the search is triggered, but at the > > moment the search method is called the first time the > values are not > > set in the bean which is connected to the input fields. > > Then the table is rendered, thus it uses the old values, then the > > method of the commandLink is called a second time, but this > time the > > values are transferred into the bean which keeps the search values. > > > > The problem with this is, that the table is rendered way before the > > values are transferred into the bean which is also used by > the table > > model to filter the datasets. Thus the rendering of the table is > > usually one click behind the input of the fields. > > Is this a bug, or do I miss something here? > > > > immediate true or false in the command link unfortunately does not > > make any difference, and my search field history works as > expected, i > > was able to check that in the debugger via the object ids, it was > > giving back. > > > > > >- > -- > >- > > > ><%@ page session="false" contentType="text/html;charset=utf-8"%> > ><%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> > <%@ taglib > >uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib > >uri="http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld"; > >prefix="x"%> > > > > > > > > value="#{testBean.dataModel}" var="bean" > > preserveDataModel="false" > > styleClass="scrollerTable" > > > > headerClass="standardTable_Header" > >footerClass="standardTable_Header" > > > rowClasses="standardTable_Row1,standardTable_Row2" > > > columnClasses="standardTable_Column,standardTable_ColumnCenter > ed,standardTable_Column,standardTable_Column,standardTable_Column" > >
Re: Datatable Problem/Bug second attempt
Mhh no answer, guess I am alone with my problem... Does anybody use the data table at all in combination with a search area on the same page? If yes... can any hints towards a best practice pattern, for this case? Werner Werner Punz wrote: Since I got no concrete answer on my problem I'll make a second attempt with more info I found out in the meanwhile. There seems to be a problem with the rendering order between a DataTable and the rest of the components. Here is my situation: I have a form which encloses several components which are needed for the search and a datatable component with a custom data model. There is a command link which should trigger the query via a custom method in the backing bean something like this The scope of the bean connected to the input fields is longer than request (if you look into the attached fields it might look weird, but I have handled them by a transparent query history cache which has session scope and a limited size) The table which is below the search area within the same form is a standard datatable with a custom datamodel and a connected data scroller... (see the attached files) The problem I run into is, that the search is triggered, but at the moment the search method is called the first time the values are not set in the bean which is connected to the input fields. Then the table is rendered, thus it uses the old values, then the method of the commandLink is called a second time, but this time the values are transferred into the bean which keeps the search values. The problem with this is, that the table is rendered way before the values are transferred into the bean which is also used by the table model to filter the datasets. Thus the rendering of the table is usually one click behind the input of the fields. Is this a bug, or do I miss something here? immediate true or false in the command link unfortunately does not make any difference, and my search field history works as expected, i was able to check that in the debugger via the object ids, it was giving back. <%@ page session="false" contentType="text/html;charset=utf-8"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib uri="http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld"; prefix="x"%> preserveDataModel="false" styleClass="scrollerTable" headerClass="standardTable_Header" footerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2" columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column,standardTable_Column,standardTable_Column" rows="10" > immediate="false"> <%@ page import="java.math.BigDecimal, java.util.Date, forms.TestClassDetail "%> <%@ page session="false" contentType="text/html;charset=utf-8"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib uri="http://myfaces.apache.org/extensions"; prefix="x"%> <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
Datatable Problem/Bug second attempt
Since I got no concrete answer on my problem I'll make a second attempt with more info I found out in the meanwhile. There seems to be a problem with the rendering order between a DataTable and the rest of the components. Here is my situation: I have a form which encloses several components which are needed for the search and a datatable component with a custom data model. There is a command link which should trigger the query via a custom method in the backing bean something like this The scope of the bean connected to the input fields is longer than request (if you look into the attached fields it might look weird, but I have handled them by a transparent query history cache which has session scope and a limited size) The table which is below the search area within the same form is a standard datatable with a custom datamodel and a connected data scroller... (see the attached files) The problem I run into is, that the search is triggered, but at the moment the search method is called the first time the values are not set in the bean which is connected to the input fields. Then the table is rendered, thus it uses the old values, then the method of the commandLink is called a second time, but this time the values are transferred into the bean which keeps the search values. The problem with this is, that the table is rendered way before the values are transferred into the bean which is also used by the table model to filter the datasets. Thus the rendering of the table is usually one click behind the input of the fields. Is this a bug, or do I miss something here? immediate true or false in the command link unfortunately does not make any difference, and my search field history works as expected, i was able to check that in the debugger via the object ids, it was giving back. <%@ page session="false" contentType="text/html;charset=utf-8"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib uri="http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld"; prefix="x"%> <%@ page import="java.math.BigDecimal, java.util.Date, forms.TestClassDetail "%> <%@ page session="false" contentType="text/html;charset=utf-8"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib uri="http://myfaces.apache.org/extensions"; prefix="x"%> <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
RE: Datatable Problem
Title: Re: Datatable Problem Thanks alot Werner! This looks very helpful. Rian From: Werner Punz [mailto:[EMAIL PROTECTED]Sent: Thu 1/27/2005 10:29 AMTo: MyFaces DiscussionSubject: Re: Datatable Problem Werner Punz wrote:> Rian Houston wrote:>>> Hi Werner,>> >> Sorry I can't help with your problem. But I would be very interested>> in hearing more about how you implemented your custom data model and>> how you use it with the dataTable component. I need to do a similar>> thing and am struggling with it...>> >>> Well what I intented to do, was to make a data model which feeds> directly hibernate objects into the table, and having a query object> passed down the data model which handles the query part.>> The model itself should have some kind of caching window to speedup> traversal and to reduce open connections.> The datasets should be displayed outside of the connection scope to> avoid the problem the current JDBC data model has within the faces> definition (not caring about the update problem yet...)>> What I basically did was to derive a class from the JSF Data model> class and add the needed functionality.> Attached you can see my code, use it as you wish (I would be happy if> it would be integrated in one way or the other in myfaces)>I forgot to mention, the main idea with the cache was good, butthe data table seems to ignore the parameter which should keep themodel in ram, so the whole caching idea was pointless (but I left it inin case it might work one day)But if you read the code I think you can get the clue on how toimplement the needed stuff, all you have to do is to override some ofthe basic data model methods and add your needed functionality in there.
Re: Datatable Problem
Yes immediate does not change anything regarding my problem. (true or false no big difference) Ok, I guess I found the problem, or sort of, I am still kindof stuck on why this happens. What happens is that the table is rendered before the query values are set into the query bean. What happens now is: I press the link, the table is rendered immediately, the values are passed down to the query bean, the values are rendered back into the search part of my form (which are rendered in the correct order) and the method is called in the end which should handle the forwarding. A workaround would be, and that seems to work, to set an event and get the values directly as parameters but that is not what I intended. The main problem I see is, that the table seems to be stuck at immediate true with its rendering and the rest of the components at immediate false, but the Data Table component does not accept any immediate params. Btw... the preserveDataModel value also seems to do nothing I implemented a caching in my data model with some kind of access cache window but every time the DataTable is rendered anew, the data model is generated newly, which renders the caching on model level useless Martin Marinschek wrote: have you put the "immediate" attribute on the link? regards, Martin On Thu, 27 Jan 2005 16:18:06 +0100, Werner Punz <[EMAIL PROTECTED]> wrote: Hi, I have a weird problem, where I dont know what the cause is. Following Situation, I am trying to do a search form with a result data table within one page. What I am doing, is that the search basically is performed via a custom Data model (which works quite nicely) The Query is done via a custom query bean which indirectly has a session scope (I have a history cache with session scope) What happens is following, the search form should pass the search parameters to the query bean, the data model of the table should call the bean and pass the filtered results back to the table view. Well that works sort of, the problem and I dont have any clue why this happens is, that I have to start everything twice until the parameters are passed down the query objects and the query is performed. It seems to me that the order is following: a enter the query params manually, trigger a submit, render the page, fill the form parameters into the query bean Which is kindof weird and does not make sense. The query bean accessors are standard setter and getters and the query is basically started by pressing a command link which itself triggers a method. I must be missing something here, it seems to me the method is called before the query params are passed into the bean and it definitely is called before the page is rerendered. Did anybody already encounter this weird problem?
Re: Datatable Problem
Werner Punz wrote: Rian Houston wrote: Hi Werner, Sorry I can't help with your problem. But I would be very interested in hearing more about how you implemented your custom data model and how you use it with the dataTable component. I need to do a similar thing and am struggling with it... Well what I intented to do, was to make a data model which feeds directly hibernate objects into the table, and having a query object passed down the data model which handles the query part. The model itself should have some kind of caching window to speedup traversal and to reduce open connections. The datasets should be displayed outside of the connection scope to avoid the problem the current JDBC data model has within the faces definition (not caring about the update problem yet...) What I basically did was to derive a class from the JSF Data model class and add the needed functionality. Attached you can see my code, use it as you wish (I would be happy if it would be integrated in one way or the other in myfaces) I forgot to mention, the main idea with the cache was good, but the data table seems to ignore the parameter which should keep the model in ram, so the whole caching idea was pointless (but I left it in in case it might work one day) But if you read the code I think you can get the clue on how to implement the needed stuff, all you have to do is to override some of the basic data model methods and add your needed functionality in there.
Re: Datatable Problem
Rian Houston wrote: Hi Werner, Sorry I can't help with your problem. But I would be very interested in hearing more about how you implemented your custom data model and how you use it with the dataTable component. I need to do a similar thing and am struggling with it... Well what I intented to do, was to make a data model which feeds directly hibernate objects into the table, and having a query object passed down the data model which handles the query part. The model itself should have some kind of caching window to speedup traversal and to reduce open connections. The datasets should be displayed outside of the connection scope to avoid the problem the current JDBC data model has within the faces definition (not caring about the update problem yet...) What I basically did was to derive a class from the JSF Data model class and add the needed functionality. Attached you can see my code, use it as you wish (I would be happy if it would be integrated in one way or the other in myfaces) /* * Created on 05.01.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package jsf.model; import framework.cache.ICacheObject; import misc.JSFUtil; import misc.NavigationBean; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.WeakHashMap; import javax.faces.model.DataModel; import jsf.common.Constants; /** * @author Werner Punz MediaData * A simple data model which marries * hibernate with JSF */ public class HibernateDataModel extends DataModel implements ICacheObject { //define a cachingWindow to keep the number of //connections/accessno at a sane level //from time to time an isolation level error //can occur since we seal the objects off //and then close the connection //so no real data integrity can be performed that way //but it should be good enough for the average webapp int _cacheWindowSize = 500; //array list due to the fact that this one has the fastes //absolute access which is necessary for paging List _cacheWindow = new ArrayList(_cacheWindowSize); //the cache window Position relative to the 0 absolute int _cacheWindowPos = 0; boolean _cacheInvalidated = false; //the standard variables which are defined by the system int _rowCount = -1; int _rowIndex = -1; //the associated query accessor IDataAccessor _queryDelegate = null; /** * */ public HibernateDataModel(IDataAccessor queryDelegate) { super(); setQueryDelegate(queryDelegate); refillCache(); } public HibernateDataModel() { super(); } /* (non-Javadoc) * @see javax.faces.model.DataModel#getRowCount() * * Return the number of rows of data objects * represented by this DataModel. If the number * of rows is unknown, or no wrappedData is available, return -1. * */ public int getRowCount() { if (_rowCount == 0) { return -1; } return _rowCount; } /** * setter accessed by the query object * @param rowCount */ public void setRowCount(int rowCount) { _rowCount = rowCount; } //returns true if the dataset is within boolean isCached() { return ((_cacheWindowPos <= getRowIndex()) && (getRowIndex() < (_cacheWindowPos + _cacheWindow.size(; } /** * refills the cache window upon the given * row index * this one in the long term will possible be called from outside also */ public void refillCache() { //calculate a decent new cache window pos, if possible with the current row index //in the middle _cacheWindowPos = Math.max(0, getRowIndex() - (_cacheWindowSize / 2)); //refill the cache with the query if (_cacheWindowSize > 0) { _cacheWindow = _queryDelegate.queryDatasets(_cacheWindowPos, _cacheWindowSize); //store the current displayed datasets in the navigatinal bean //to allow compound ops NavigationBean navBean = (NavigationBean) JSFUtil.getManagedBean(Constants.MBEAN_NAVBEAN); navBean.setCurrentNavSelection(_cacheWindow); } _cacheInvalidated = false; } /* * (non-Javadoc) * @see jsf.common.ICacheObject#invalidateCache() */ public void invalidateCache() { _cacheInvalidated = true; } /* (non-Javadoc) * @see javax.faces.model.DataModel#getRowData() * * Return an object representing the data for the * currenty selected row index. If no wrappedData * is available, return null. */ public Object getRowData() { //synchronize this just in case we implemnt //an internal cache dumping mechanism //for hit fault reduction synchro
RE: Datatable Problem
Title: Datatable Problem Hi Werner, Sorry I can't help with your problem. But I would be very interested in hearing more about how you implemented your custom data model and how you use it with the dataTable component. I need to do a similar thing and am struggling with it... TIA Rian From: Werner Punz [mailto:[EMAIL PROTECTED]Sent: Thu 1/27/2005 9:18 AMTo: MyFaces DiscussionSubject: Datatable Problem Hi, I have a weird problem, where I dont know what the cause is.Following Situation, I am trying to do a search form with a resultdata table within one page.What I am doing, is that the search basically is performed via a customData model (which works quite nicely)The Query is done via a custom query bean which indirectly has a sessionscope (I have a history cache with session scope)What happens is following, the search form should pass the searchparameters to the query bean, the data model of the table should callthe bean and pass the filtered results back to the table view.Well that works sort of, the problem and I dont have any clue why thishappens is, that I have to start everything twice until the parametersare passed down the query objects and the query is performed.It seems to me that the order is following:a enter the query params manually, trigger a submit, render the page,fill the form parameters into the query beanWhich is kindof weird and does not make sense.The query bean accessors are standard setter and getters andthe query is basically started by pressing a command link which itselftriggers a method.I must be missing something here, it seems to me the method is calledbefore the query params are passed into the bean and it definitely iscalled before the page is rerendered.Did anybody already encounter this weird problem?
Re: Datatable Problem
have you put the "immediate" attribute on the link? regards, Martin On Thu, 27 Jan 2005 16:18:06 +0100, Werner Punz <[EMAIL PROTECTED]> wrote: > Hi, I have a weird problem, where I dont know what the cause is. > Following Situation, I am trying to do a search form with a result > data table within one page. > > What I am doing, is that the search basically is performed via a custom > Data model (which works quite nicely) > The Query is done via a custom query bean which indirectly has a session > scope (I have a history cache with session scope) > > What happens is following, the search form should pass the search > parameters to the query bean, the data model of the table should call > the bean and pass the filtered results back to the table view. > > Well that works sort of, the problem and I dont have any clue why this > happens is, that I have to start everything twice until the parameters > are passed down the query objects and the query is performed. > > It seems to me that the order is following: > a enter the query params manually, trigger a submit, render the page, > fill the form parameters into the query bean > Which is kindof weird and does not make sense. > > The query bean accessors are standard setter and getters and > the query is basically started by pressing a command link which itself > triggers a method. > > I must be missing something here, it seems to me the method is called > before the query params are passed into the bean and it definitely is > called before the page is rerendered. > > Did anybody already encounter this weird problem? > >
Datatable Problem
Hi, I have a weird problem, where I dont know what the cause is. Following Situation, I am trying to do a search form with a result data table within one page. What I am doing, is that the search basically is performed via a custom Data model (which works quite nicely) The Query is done via a custom query bean which indirectly has a session scope (I have a history cache with session scope) What happens is following, the search form should pass the search parameters to the query bean, the data model of the table should call the bean and pass the filtered results back to the table view. Well that works sort of, the problem and I dont have any clue why this happens is, that I have to start everything twice until the parameters are passed down the query objects and the query is performed. It seems to me that the order is following: a enter the query params manually, trigger a submit, render the page, fill the form parameters into the query bean Which is kindof weird and does not make sense. The query bean accessors are standard setter and getters and the query is basically started by pressing a command link which itself triggers a method. I must be missing something here, it seems to me the method is called before the query params are passed into the bean and it definitely is called before the page is rerendered. Did anybody already encounter this weird problem?