My Stack :

Websphere 6.1
Myfaces 1.2.4
SWF 2.0.7
Trinidad 1.2.11
Facelets 1.1.14
Tomahawk 1.1.6


When I turn off the javascript in the browser (ie6, firefox) - the button
does not do anything. It just refreshes the page. 

On inspection, I found that the html generated has javascript :

                  <button .... type="button"
onclick="submitForm('homepageDemonstrationsForm',1,{source:'demonstrationsTable:0:selectDemonstration'});return
false;" class="genericBtn x7j">Select</button>
 
<script type="text/javascript">function
_homepageDemonstrationsFormValidator(f,s){return true;}</script><script
type="text/javascript">_submitFormCheck();</script>


Here is the facelet :
<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:t="http://myfaces.apache.org/tomahawk";
                xmlns:sf="http://www.springframework.org/tags/faces";
                xmlns:tr="http://myfaces.apache.org/trinidad";
                template="layouts/trinidad.xhtml">


    <ui:define name="title">
        <h:outputText value="#{msg.homePage_TITLE}"/>
    </ui:define>

    <ui:define name="content">
               <tr:form id="#{msg.homepageDemonstrationsFormID}" >
.....

 <tr:commandButton id="selectDemonstration" styleClass="genericBtn"
textAndAccessKey="#{msg.selectButtonLabel}" action="select">
                                <tr:setActionListener
to="#{conversationScope.demoInfo}" from="#{gDetails}"/>
                            </tr:commandButton>
......
</tr:form>
</ui:define>
</ui:composition>

My template :

<tr:document
        xmlns:tr="http://myfaces.apache.org/trinidad";
         xmlns:ui="http://java.sun.com/jsf/facelets";
      xmlns:f="http://java.sun.com/jsf/core";
      xmlns:h="http://java.sun.com/jsf/html";
      xmlns:sf="http://www.springframework.org/tags/faces";
      xmlns:t="http://myfaces.apache.org/tomahawk";>

<f:loadBundle basename="gov.hhs.cms.ebs.ehrds.app.messages" var="msg" />
    <f:view >
        <f:facet name="metaContainer">
        <!--<head>-->
            <title><ui:insert name="title">Test</ui:insert></title>
            <ui:include src="/WEB-INF/layouts/imports.xhtml"/>
        <!--</head>-->
        <!--<body>-->
        </f:facet>
            <!-- HEADER HERE            -->
            <ui:include src="/WEB-INF/layouts/header.xhtml"/>

            <!-- CONTENT HERE           -->
            <ui:insert name="content"/>

            <!-- FOOTER HERE            -->
            <ui:include src="/WEB-INF/layouts/footer.xhtml"/>

        <!--</body>-->
    </f:view>
</tr:document>


My trinidad-config.xml (I tried disabling the client-validation here but it
still generates the javascript)

<?xml version="1.0"?>
<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config";>
  <!-- Enable debug output -->
  <debug-output>true</debug-output>

  <!-- Pick accessibility options based on a per-user managed bean -->
  <accessibility-mode>default</accessibility-mode>
    <client-validation>DISABLED</client-validation>
    <!--<client-validation-disabled>true</client-validation-disabled>-->
</trinidad-config>


My web.xml  (snippet)

....
        <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>
        
        <!-- Just here so the JSF implementation can initialize -->
        <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.faces</url-pattern>
        </servlet-mapping>
   
 <context-param>
     
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>

    <filter>
      <filter-name>trinidad</filter-name>
     
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>trinidad</filter-name>
      <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    </filter-mapping>


    <!-- resource loader servlet -->
    <servlet>
      <servlet-name>resources</servlet-name>
     
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
    </servlet>


    <servlet-mapping>
      <servlet-name>resources</servlet-name>
      <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
-- 
View this message in context: 
http://www.nabble.com/Trinidad-buttons-donot-work-with-javascript-turned-off-tp24797567p24797567.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to