This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Button link and hyperlink columns in the table (webuijsf:table) don't execute action methods bound to them. I just created a table bound to an ObjectListDataProvider implentation...added an edit button column and bound it to a method in the page bean. When running, the button causes a page refresh, but doesn't activate the action method (confirmed using debug). I've reproduced this with hyperlinks and buttons. Others have also indicated a problem (see the mailing list unders subjects "VWP - Action of Hyperlink inside a table not working" and "Visual Web Pack + Table + Internal Link - won't submit!"). Am happy to send through a project that demonstrated the problem to investigator.
Passing to components.
Please attach a project.
Created attachment 43826 [details] project
I attached the project, I had to attach it clean (no libraries) due to size restriction. It uses a object list data provider that is located in com.curiousllama.osfp.rules in the web project. It has a web and an ejb project, just edit the persistence configuration in the server resources folder. There is one library you need which i have attached seperatedly (llamacommons.jar) all the rest are freely available: EJB Project: LlamaCommons (attached) commons-lang-2.1 http://jakarta.apache.org/commons/lang hibernate-annotations-32 http://www.hibernate.org commons-logging-1.1 http://jakarta.apache.org/commons/logging antlr-3.0-runtime http://www.antlr.org commons-beanutils-1.7.0 http://jakarta.apache.org/commons/beanutils Visual Web Project: JSF 1.2 support (from netbeans platform) WebUI and JDBC Design-Time (from vwp) dwr2.jar http://www.directwebremoting.org commons-lang-2.1 http://jakarta.apache.org/commons/lang If you have any problems at all just email me and we can set up a collaboration session. Cheers Adam
Created attachment 43827 [details] LlamaCommons.jar (required library)
Oh, and the offending file is in OSFP-web/Web Pages/rules/ViewBusinessRules.jsp after you add a business rule (clicking the add link and going to OSFP-web/Web Pages/rules/EditBusinessRule.jsp) it shows up in the table, but when you click 'edit' in the table it should call the method ViewBusinessRules.java$editRuleLink_action() Because it uses an ObjectListDataProvider, you'll have to make sure everything is built before trying to use the visual designer.
I have tried some simple cases, both on 5.5.1 & 6.0 and it seems to work - Add a table component - Bring up the Table Layout - Select Column1 and set its Component Type to Button - Select Coloumn2 and set its Component Type to Hyperlink - Click OK and dismiss the dialog - Drag and drop a message group component - Double click and create the button action method and put the code info ("Button Clicked") - Double click and create the button action method and put the code info ("Hyperlink Clicked") - Deploy the application and click on the button Message group displays the message "Button Clicked" message - Click on the hyperlink Message group displays the message "Hyperlink Clicked" message
I'm not able to make the attached project to work. I need some simple project which works OOB. Simple scenario works for me, so marking this as Works for me. This is my theory why it doesn't work for you. - There must be some kind of exception during "Apply Request Values" phase. - So the "Process Event" phase got skipped and went directly to render phase Put a MessageGroup component in the page and see if any exception is reported. Also look at the Server log and see if any exception is reported.
The project should get up and running pretty easily, you have to create the persistence information (the datasource, and the sun configuration). I've put a message box on the page and no errors are outputted -- there is also nothing in the server logs. A break point in the action method never gets called. I've done the simple example you discussed and you're right, they work fine...but this example is pretty simple also...but it has a few differences (like using ObjectDataProvider and having pages in sub directories -- so it could be something like that)...the unfortunate thing is this is about as close to an OOB project I can supply as the bug is not occuring in the simple examples, so something in the complexity of this project is obviously causing it. What problems are you having getting this project up and running? I may be able to do a collaboration session on it if you wish?
It seems that the problem lay with this project. I have started again from scratch with the latest nb6 build and a fresh project and I don't seem to be having any problems. You're right to close this ticket, I can't reproduce the bug. Thanks for your help.
Links and buttons withing tables seems to work fine for simple applications, however the second you try to do something complex like bind to EJBs and ObjectDataProviders they stop working (they stop calling the designated action on click). There is no output in any of the logs, and nothing in the jsf messages. After doing a simple example suggested on this ticket and getting hyperlinks within tables to work fine, I started my application again from scratch with Netbeans 6M10, did exactly the same things step by step and hit the exact same problem. If anyone is interested in looking at this then they're going to have to be willing to dive into the project that's actually causing the problem because simple examples seem to work fine -- it's something to do with introducing more complex artifacts. The data table is a very nice component, but if it's only functional within simple examples then it's pretty much useless. I'm happy to work with anyone that needs assistance to look at this.
Below is the page that has the table on it. This is really causing us some confusion and concerns. Can someone comment on whether there is anything obviously wrong with it? All it has on it is a simple, visually designed data table, and one hyperlink for adding new items. Two columns, one with an edit hyperlink and one with a delete hyperlink are configured to their respective actions on the backing bean. The addNew hyperlink works fine, and items that are added to the table show up fine. The two methods for edit and delete do pretty much nothing at the moment, but a break point in each of them (and logging code) shows that they are never called. The navigation is configured in each of them to take the user to another page...but whenever they're clicked, they just cycle straight back through to the page below...they go nowhere, do nothing and don't activate the backing bean methods. We've done nothing out of the ordinary, nothing above and beyond the example code (that works fine) other than internationalize all the items, add some EJB references to the backing beans and create and add some ObjectDataProviders to work with the objects. This has got us quite baffled, any assistance would be greatly appreciated as a working data table is on our projects critical path. <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> <f:view> <webuijsf:page binding="#{rules$ViewBusinessRules.page1}" id="page1"> <webuijsf:html binding="#{rules$ViewBusinessRules.html1}" id="html1"> <f:loadBundle basename="com.curiousllama.osfp.web.rules.Bundle" var="msg"/> <f:loadBundle basename="com.curiousllama.osfp.web.GlobalBundle" var="globals"/> <webuijsf:head binding="#{rules$ViewBusinessRules.head1}" id="head1" title=""> <webuijsf:link binding="#{rules$ViewBusinessRules.link1}" id="link1" url="/resources/stylesheet.css"/> </webuijsf:head> <webuijsf:body binding="#{rules$ViewBusinessRules.body1}" id="body1" style="-rave-layout: grid"> <webuijsf:form binding="#{rules$ViewBusinessRules.form1}" id="form1"> <h:panelGrid binding="#{rules$ViewBusinessRules.gridPanel1}" id="gridPanel1" style="height: 100%; left: 24px; top: 24px; position: absolute" width="504"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.addNewLink_action}" binding="#{rules$ViewBusinessRules.addNewLink}" id="addNewLink" text="#{globals['AddNewLabel']}"/> <webuijsf:table augmentTitle="false" binding="#{rules$ViewBusinessRules.businessRuleTable}" id="businessRuleTable" paginationControls="true" style="width: 480px" title="Business Rules" width="480"> <webuijsf:tableRowGroup binding="#{rules$ViewBusinessRules.tableRowGroup1}" id="tableRowGroup1" rows="10" sourceData="#{rules$ViewBusinessRules.ruleDataProvider}" sourceVar="currentRow"> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn1}" headerText="Id" id="tableColumn1" sort="id"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText1}" id="staticText1" text="#{currentRow.value['id']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn2}" headerText="#{globals['NameLabel']}" id="tableColumn2" sort="name"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText2}" id="staticText2" text="#{currentRow.value['name']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn3}" headerText="#{globals['DescriptionLabel']}" id="tableColumn3" sort="description"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText3}" id="staticText3" text="#{currentRow.value['description']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn7}" headerText="#{globals['LocaleLabel']}" id="tableColumn7" sort="locale"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText4}" id="staticText4" text="#{currentRow.value['locale']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn align="center" binding="#{rules$ViewBusinessRules.tableColumn8}" headerText="Edit" id="tableColumn8"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.editRuleLink_action}" binding="#{rules$ViewBusinessRules.editRuleLink}" id="editRuleLink" text="#{globals['EditLabel']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn align="center" binding="#{rules$ViewBusinessRules.tableColumn9}" headerText="Delete" id="tableColumn9"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.deleteRuleLink_action}" binding="#{rules$ViewBusinessRules.deleteRuleLink}" id="deleteRuleLink" text="#{globals['DeleteLabel']}"/> </webuijsf:tableColumn> </webuijsf:tableRowGroup> </webuijsf:table> </h:panelGrid> </webuijsf:form> </webuijsf:body> </webuijsf:html> </webuijsf:page> </f:view> </jsp:root>
Per bug priority guidlines, http://qa.netbeans.org/bugzilla/bug_priority_guidelines.html, I'll have to downgrade this to a P2. You mention that the "add" link works and the simple case works, debugging your application might give you some hints about why the other actions are not being executed. This is an open source project, everything you need to debug are available including the sources. If you need immediate help, you can always contact http://www.netbeans.org/kb/support.html thanks
Thanks, I deleted the page and started again, testing the application at each step (i.e. add a component/change a property, clean and build, re-run), and it works now!!! So something I was doing when I was moving things around on the page caused a problem, but for the life of me I can't figure out what it could be. I'll post the working page below, if anyone can notice a difference between them that might help -- I've run them through a diff but couldn't notice anything different. This is a head scratching one -- I'm marking as fixed, but I strongly believe there's something up with the visual designer -- at least I know a work around now :) <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> <f:view> <webuijsf:page binding="#{rules$ViewBusinessRules.page1}" id="page1"> <webuijsf:html binding="#{rules$ViewBusinessRules.html1}" id="html1"> <f:loadBundle basename="com.curiousllama.osfp.web.rules.Bundle" var="msg"/> <f:loadBundle basename="com.curiousllama.osfp.web.GlobalBundle" var="globals"/> <webuijsf:head binding="#{rules$ViewBusinessRules.head1}" id="head1"> <webuijsf:link binding="#{rules$ViewBusinessRules.link1}" id="link1" url="/resources/stylesheet.css"/> </webuijsf:head> <webuijsf:body binding="#{rules$ViewBusinessRules.body1}" id="body1" style="-rave-layout: grid"> <webuijsf:form binding="#{rules$ViewBusinessRules.form1}" id="form1"> <h:panelGrid binding="#{rules$ViewBusinessRules.gridPanel1}" id="gridPanel1" style="height: 96px; left: 24px; top: 24px; position: absolute; width: 96px"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.addNewLink_action}" binding="#{rules$ViewBusinessRules.addNewLink}" id="addNewLink" text="#{globals['AddNewLabel']}"/> <webuijsf:table augmentTitle="false" binding="#{rules$ViewBusinessRules.businessRuleTable}" id="businessRuleTable" paginationControls="true" style="width: 600px" title="#{msg['BusinessRuleTableTitle']}" width="480"> <webuijsf:tableRowGroup binding="#{rules$ViewBusinessRules.tableRowGroup1}" id="tableRowGroup1" rows="10" sourceData="#{rules$ViewBusinessRules.ruleDataProvider}" sourceVar="currentRow"> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn2}" headerText="#{globals['IdLabel']}" id="tableColumn2" sort="id"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText2}" id="staticText2" text="#{currentRow.value['id']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn4}" headerText="#{globals['NameLabel']}" id="tableColumn4" sort="name"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText4}" id="staticText4" text="#{currentRow.value['name']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn1}" headerText="#{globals['DescriptionLabel']}" id="tableColumn1" sort="description"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText1}" id="staticText1" text="#{currentRow.value['description']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn3}" headerText="#{globals['LocaleLabel']}" id="tableColumn3" sort="locale"> <webuijsf:staticText binding="#{rules$ViewBusinessRules.staticText3}" id="staticText3" text="#{currentRow.value['locale']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn6}" headerText="#{globals['EditLabel']}" id="tableColumn6"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.editRuleLink_action}" binding="#{rules$ViewBusinessRules.editRuleLink}" id="editRuleLink" text="#{globals['EditLabel']}"/> </webuijsf:tableColumn> <webuijsf:tableColumn binding="#{rules$ViewBusinessRules.tableColumn5}" headerText="#{globals['DeleteLabel']}" id="tableColumn5"> <webuijsf:hyperlink actionExpression="#{rules$ViewBusinessRules.deleteLink_action}" binding="#{rules$ViewBusinessRules.deleteLink}" id="deleteLink" text="#{globals['DeleteLabel']}"/> </webuijsf:tableColumn> </webuijsf:tableRowGroup> </webuijsf:table> </h:panelGrid> </webuijsf:form> </webuijsf:body> </webuijsf:html> </webuijsf:page> </f:view> </jsp:root>
This is an ongoing issue. Hyperlinks in tables do not work. Only in the simplest of examples do they actually activate the action method. I can reproduce this bug and there is no work around other than to delete the page and start again praying and hoping that it works this time -- which often it doesn't. The lack of an effective work around makes this a priority 1. As always, I am happy supplying a project with numerous examples of this...or you can just try building a table with real functionality that back onto a stateless session bean through a data provider. There are some serious issues with this component in real world development.
One of the steps to reproduce: (I say "one of", because I have a suspicion that this bug may be triggered multiple ways). Create an object list data provider (extend ObjectListDataProvider), and add a refresh() method that sets the objects in the list (with super.setList(newList)). Create a table, and bind it to your object list data provider. Configure the tables and put some hyperlink columns in. 1) in the init() method, call the refresh() method on your data provider -- in this case, everything should work fine and your links will activate. 2) move the call to your object list data provider's refresh method from the init method to the prerender method -- re run your project and your links within the table will now not activate their configured action method. 3) comment out the refresh() call from the prerender method and everything should work fine again I will continue investigating to see if I can figure out a work around or any other triggers for this bug. p.s. I have confirmed that no errors or exceptions are being thrown in the refresh() method. This is a very odd bug, but I have verified that this behavior is reproducible every time on one of my pages.
We have very tight deliverables at the moment and we won't be able debug your attached project at the moment. Could you please create a simple test case with the scenario that you described above that illustrates the problem? If you can give us test case, it will make debugging easier. Thanks Marking incomplete until the test case is attached.
I have the same problem, so i tried to make a simple example. This one uses LDAP and Netbeans 6.0M10. You will need the LDAP Dataprovider Library (http://www.netbeans.org/kb/60/web/ldap.html) and an LDAP-Server of course.
Created attachment 47051 [details] Simple Project that has the Link-Issue
removed incomplete keyword for dev evaluation of new info.
Matt,Winston is on vacation today, can you please evaluate the issue ? thanks
In my opinion, this doesn't qualify as a P1 (as per the guidelines) because one particular scenario doesn't work.But I will wait until Matt's evaluation before I downgrade.
Created attachment 47349 [details] working application
I've attached a working project following the steps explained by adam1jen on Thu Aug 9 01:48:36 +0000 2007. I've written a TestDataProvider class and a Bunny class. TestDataProvider has a refresh method that replaces the bunny held in its list with a new bunny. Page1.prerender calls the refresh method. I have a table that is hooked up to the testDataProvider instance in the session bean. The table contains a column with a hyperlink in it. When the hyperlink is clicked, the action method executes and calls info("hyperlink clicked"). I've also provided a column with a button for the same purpose. These steps do work; hopefully this helps. Marking works for me.
adam1jen, stinnux, In my opinion, this may not be related to whether you call refresh() in init() or prerender(). init() executes before JSF life cycle and prerender does much later. I suspect that makes the difference. Per JSF request processing lifecycle, whenever there is a validation/conversion error during ApplyRequest values or Validation phase, action method will not be executed and the same page will be redisplayed. If Matt's application works, it could mean there is some failure during the earlier phases of your application. Make sure that your application doesn't cause any conversion errors to be thrown while processing the items in the list especially if there are not of String type. For example, you may be using a data type that JSF framework doesn't know how to convert. You may also want to try this application outside of Visual web. That might give you clues whether it is a JSF framework issue.