RichFaces connection problem to databases
maserati Jan 3, 2012 9:17 AMHello,
I have a page that contains a tab (Oracle, Teradata), each tab is the connection settings, but when I click connect, nothing is happening, while the methods of connections are good (I tested before moving to RichFaces)
Login.xhtml
<ui:composition 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <style> .rich-tab-inactive { cursor: pointer; } .rich-tabpanel-content { border-width: 1px 1px 1px 1px; background-color: transparent; } </style> <p> Here is an example of default tab panel with 3 tabs. <rich:tabPanel headerAlignment="right" switchType="client"> <rich:tab label="ORACLE"> <h:panelGrid columns="2"> <h:outputText value="Host"></h:outputText> <h:inputText value="#{ManagedBeanO.host}"></h:inputText> <h:outputText value="Port"></h:outputText> <h:inputText value="#{ManagedBeanO.port}"></h:inputText> <h:outputText value="User"></h:outputText> <h:inputText value="#{ManagedBeanO.user}"></h:inputText> <h:outputText value="Password"></h:outputText> <h:inputSecret value="#{ManagedBeanO.mdp}"></h:inputSecret> <h:outputText value="Base Name"></h:outputText> <h:inputText value="#{ManagedBeanO.baseName}"></h:inputText> </h:panelGrid> <h:commandButton value="Connect" action="Connect"></h:commandButton> </rich:tab> <rich:tab label="TERADATA"> <h:panelGrid columns="2"> <h:outputText value="Host"></h:outputText> <h:inputText value="#{ManagedBeanT.host}"></h:inputText> <h:outputText value="User"></h:outputText> <h:inputText value="#{ManagedBeanT.user}"></h:inputText> <h:outputText value="Password"></h:outputText> <h:inputSecret value="#{ManagedBeanT.mdp}"></h:inputSecret> </h:panelGrid> <h:commandButton value="Connect" action="Connect"></h:commandButton> </rich:tab> </rich:tabPanel> </p> </ui:composition>
Login.xhtml page is linked (in faces-config.xml) with welcome.xhtml page that contains a method called getConnection
welcome.xhtml
<ui:composition 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="/WEB-INF/templates/BasicTemplate.xhtml"> <ui:define name="content"> <h:outputLabel value="Welcome #{ManagedBeanO.connectedUser}"></h:outputLabel> </ui:define> </ui:composition>
For example, if the userchoose the ORACLE tab, and click connect, how am I going to call the getConnection located in ManagedBeanO (Oracle) and the same question if the user use Teradata tab.
Thank you in advance