This content has been marked as final.
Show 3 replies
-
1. Re: Problem with rich:tabPanel component
nbelaevski Mar 20, 2009 6:15 AM (in response to vsirishreddy)"vsirishreddy" wrote:
but it doesn't go to my action class
What is your action class and how do you use it? -
2. Re: Problem with rich:tabPanel component
vsirishreddy Mar 20, 2009 12:19 PM (in response to vsirishreddy)This is how my code looks like:
My JSP:<f:subview id="billsearch"> <html> <body> <h:form id="billSearchForm" onkeypress ="if (event.keyCode == 13) {submitForm(); return false;}; return true;"> <t:messages layout="list" styleClass="errorStyle" /> <rich:tabPanel switchType="ajax" activeTabClass="activeTabRich" inactiveTabClass="inactiveTabRich" headerAlignment="left" contentClass="tabContentRich" headerSpacing="2px" styleClass="myClass"> <%-- simple search tab --%> <rich:tab id="simpleSearch" styleClass="myClass" label="Search" onkeypress="setSimpleFlag();" onclick="setSimpleFlag();"> <%-- some content goes here --%> </rich:tab> <%-- lucene text search taqb --%> <rich:tab id="advanceSearch" styleClass="myClass" label="Text Search" onkeypress="setSimpleTextFlag();" onclick="setSimpleTextFlag();"> <%-- some content goes here --%> </rich:tab> <%-- advance query search tab --%> <rich:tab id="completeAdvancedSearch" styleClass="myClass" label="Advanced Search"> <rich:tabPanel switchType="client" activeTabClass="activeSubTabRich" inactiveTabClass="inactiveSubTabRich" headerAlignment="left" contentClass="subTabContentRich" headerSpacing="2px"> <%-- HOME TAB --%> <rich:tab id="homeTab" label="#{bundle['lis.adv.search.tab.home']}"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabHome.jsp" /> </h:panelGroup> </rich:tab> <%-- AUTHOR TAB --%> <rich:tab id="authorsTab" label="#{bundle['lis.adv.search.tab.author']}" ontableave="executeOnSubmit('authorTab');"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabAuthor.jsp" /> </h:panelGroup> </rich:tab> <%-- FLAGS TAB --%> <rich:tab id="flagsTab" label="#{bundle['lis.adv.search.tab.flags']}"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabFlags.jsp" /> </h:panelGroup> </rich:tab> <%-- VOTES TAB --%> <rich:tab id="votesTab" label="#{bundle['lis.adv.search.tab.votes']}" ontableave="executeOnSubmit('voteTab');"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabVotes.jsp" /> </h:panelGroup> </rich:tab> <%-- CODES TAB --%> <rich:tab id="codesTab" label="#{bundle['lis.adv.search.tab.codes']}"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabCodes.jsp" /> </h:panelGroup> </rich:tab> //PROBLEM WITH THE BELOW ACTION BUTTONS. NOT GOING TO ACTION METHOD WHEN SUBMITTED <h:panelGrid width="100%" columns="1" style="text-align: center"> <h:panelGroup> <t:commandButton id="advSearch" value="#{bundle['submit_search']}" action="#{advanceSearchProcess.executeSearch}" styleClass="buttons"/> <h:outputText value=" "/> <t:commandButton value="#{bundle.clear}" onclick="clearAdvanceSearch();" action="#{advanceSearchProcess.clearAll}" styleClass="buttons"/> </h:panelGroup> </h:panelGrid> </rich:tabPanel> </rich:tab> </rich:tabPanel> </h:form> </body> </html> </f:subview>
My Action Method:public String executeSearch(){ Utility.Log(Level.INFO, this, "ENTER executeSearch"); String outCome = "showadvancebills"; StringBuffer query = null; try { query = prepareQuery(); if (query != null) { outCome = executeSearchQuery(query.toString()); } else { return null; } } catch (Exception ex) { ex.printStackTrace(); } Utility.Log(Level.INFO, this, "EXIT executeSearch"); return outCome; }
The buttons in the third tab are not directing me to the action class in my Invoke Application Phase. Any hint on possible code changes to solve this issue would be highly appreciated.
Thanks. -
3. Re: Problem with rich:tabPanel component
vsirishreddy Mar 20, 2009 2:16 PM (in response to vsirishreddy)If I make the following change in the code, then it seems to work. I have to move my command button into the tab from the tabPanel.
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... <%-- VOTES TAB --%> <rich:tab id="votesTab" label="#{bundle['lis.adv.search.tab.votes']}" ontableave="executeOnSubmit('voteTab');"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabVotes.jsp" /> </h:panelGroup> //Placing the buttons inside the tab works <h:panelGroup> <t:commandButton id="advSearch" value="#{bundle['submit_search']}" action="#{advanceSearchProcess.executeSearch}" styleClass="buttons"/> <h:outputText value=" "/> <t:commandButton value="#{bundle.clear}" onclick="clearAdvanceSearch();" action="#{advanceSearchProcess.clearAll}" styleClass="buttons"/> </h:panelGroup> </rich:tab> <%-- CODES TAB --%> <rich:tab id="codesTab" label="#{bundle['lis.adv.search.tab.codes']}"> <h:panelGroup> <jsp:include page="AdvanceSearch/tabCodes.jsp" /> </h:panelGroup> //Placing the buttons inside the tab works <h:panelGroup> <t:commandButton id="advSearch" value="#{bundle['submit_search']}" action="#{advanceSearchProcess.executeSearch}" styleClass="buttons"/> <h:outputText value=" "/> <t:commandButton value="#{bundle.clear}" onclick="clearAdvanceSearch();" action="#{advanceSearchProcess.clearAll}" styleClass="buttons"/> </h:panelGroup> </rich:tab> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
I don't want to define the same button multiple times inside each tab, might have to do if there is no other way.
Is this a bug or is this the way it is supposed to work? But as an end user I definitely expect my command button to work the way it has to, irrespective of where I place it. Any comments and alternate solutions are welcome.
Thanks.