-
1. Re: commandLink and commandButton do not work in a tabPanel
nagypalg Sep 20, 2007 12:24 PM (in response to nagypalg)An addition: I also tried using the value attribute of tabPanel, with the same result: no commandLinks or commandButtons work.
-
2. Re: commandLink and commandButton do not work in a tabPanel
sergeysmirnov Sep 20, 2007 12:27 PM (in response to nagypalg)code snippet is required.
-
3. Re: commandLink and commandButton do not work in a tabPanel
ilya_shaikovsky Sep 20, 2007 1:05 PM (in response to nagypalg)Agree with Sergey. B.t.w. I have an example with selectedTab created for another thread and its works on GA.
-
4. Re: commandLink and commandButton do not work in a tabPanel
nagypalg Sep 21, 2007 4:00 AM (in response to nagypalg)Hi,
Sorry, it took a while to track down the problem. So, I use Seam 2 CR1 which ships with a fairly new Richfaces version: 3.1.1-SNAPSHOT. It seems that the problem has something to do with storing the tab state in conversational beans. Test code:
/tabTest.xhtml:<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:c="http://java.sun.com/jstl/core" xmlns:a="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich" contentType="text/html"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Tab Tester</title> </head> <body> <h:form> <h:commandLink action="#{tabTestAction.test}" value="Test!" /> </h:form> <!-- Tab panel test --> <rich:tabPanel switchType="server" value="#{tabTestAction.selectedTab}"> <rich:tab label="One" id="coreTab"> <h:outputText value="Action: #{tabTestAction}" /> <h:form> <h:commandLink action="#{tabTestAction.test}" value="Test!" /> </h:form> </rich:tab> <rich:tab label="Two" id="extTab"> <h:outputText value="Action: #{tabTestAction}" /> <h:form> <h:commandLink action="#{tabTestAction.test}" value="Test!" /> </h:form> </rich:tab> </rich:tabPanel> </body> </html> </f:view>
TabTestAction.java:@Name("tabTestAction") @Scope(ScopeType.CONVERSATION) public class TabTestAction { @Logger Log log; // @In FacesMessages facesMessages; public String test() { log.debug("Test!!!"); return null; } private String selectedTab = "coreTab"; public String getSelectedTab() { log.debug("Getting selected tab: #0", selectedTab); return selectedTab; } public void setSelectedTab(String selectedTab) { log.debug("Setting selected tab to: #0", selectedTab); this.selectedTab = selectedTab; } }
The link outside the tabPanel works, the links inside do not work, the action method is not invoked.
Now, if I put the tabTestAction in session scope, the example start working. However, when you have any Seam components injected into the component (uncomment @In facesMessages), it stops working again: you getorg.jboss.seam.RequiredException: In attribute requires non-null value: tabTestAction.facesMessages
I am not sure, whether it is a Seam bug, or a Richfaces bug... -
5. Re: commandLink and commandButton do not work in a tabPanel
nagypalg Sep 21, 2007 4:09 AM (in response to nagypalg)Some additional information: with the exact same installation, but replacing the richfaces JARs with
richfaces-3.0.1.jar
ajax4jsf-1.1.1.jar
the example works. Based on the log files, it seems that one big difference is that with the older richfaces the getter/setter of the tab state is not invoked when clicking on the commandLink. With the 3.1 version it is different, the getter/setter invoked each time you click on the link. -
6. Re: commandLink and commandButton do not work in a tabPanel
maksimkaszynski Sep 22, 2007 11:55 AM (in response to nagypalg)Correct.
Since 3.1 selectedTab is read-write, so one can get selected tab at once in his code. -
7. Re: commandLink and commandButton do not work in a tabPanel
nagypalg Sep 24, 2007 4:23 AM (in response to nagypalg)Yes, but in the example I use the value attribute and not the selectedTab attribute. And the value attribute was already read/write in the 3.0.1 version, at least the setter gets called properly, so you can read the current tab from code.
To me it seems that something was changed in the tabPanel implementation that makes it incompatible with Seam: it seams to me that the setter gets called before the Seam context is initialized, and therefore the JSF lifecycle does not run properly. I am not sure, however, whether it is a problem with Seam or with Richfaces. And of course I am not sure, whether someone else experiences the same problem. Should I file a bug report? -
8. Re: commandLink and commandButton do not work in a tabPanel
brooksl Sep 27, 2007 10:16 AM (in response to nagypalg)I was having the same problem. I added a t:saveState that kept the selectedTab value for the panel and everything works again.
-
9. Re: commandLink and commandButton do not work in a tabPanel
szaccaria Sep 28, 2007 12:26 PM (in response to nagypalg)So do I having the same problem... some news about?
-
10. Re: commandLink and commandButton do not work in a tabPanel
szaccaria Sep 28, 2007 12:29 PM (in response to nagypalg)Other person have the same problem
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=119558 -
11. Re: commandLink and commandButton do not work in a tabPanel
nagypalg Oct 8, 2007 4:07 AM (in response to nagypalg)And there is a workaround posted there. It works both for tabPanels using "selectedTab" and "value".