2 Replies Latest reply on Mar 3, 2008 9:54 AM by Florent Dupont

    Please help with jquery

    E Aish Novice

      Hi,

      I am trying to use jquery in my page.

      Here is my web page with the jquery:
      ====

      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <rich:dataTable id="dbq" value="#{TableDetail.displaytbl}" var="dbqueue"
      border="1" >
      <f:facet name="header">
      <h:outputText value="DB Table"/>
      </f:facet>
      <rich:column>
      <f:facet name="header">
      <h:outputText value="FileNameName"/>
      </f:facet>
      <h:outputText value="#{dbqueue.filename}"/>
      </rich:column>



      <rich:jQuery selector="#dbqtr:odd" query="addClass('odd-row')" />
      <rich:jQuery selector="#dbq tr:even" query="addClass('even-row')" />
      <rich:jQuery selector="#dbq tr"
      query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
      <rich:jQuery selector="#dbq tr"
      query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>

      ===

      The above page is called from a main navigation page which includes the <h:form> components and so, you would not see it in the above page. I included the following styles between on the main page which has the <h:form> components.


      .odd-row {
      background-color: #ECF3FE;
      }
      .even-row {
      background-color: #FCFFFE;
      }
      .active-row {
      background-color: #FFEBDA;
      }

      ====

      The jquery is not working. Can you please point me what I missing to get this jquery to work.

      Thanks a lot
      Aish