Hi Jimmy,

There is no mechanism to turn off the JavaScript in Trinidad through configuration file like an entry in web.xml. Currently, only in the case of few mobile browsers, Trinidad renders non-JavaScript code.
All desktop browsers need JavaScript to be turned on.

Thanks
Mamallan


djohnjimmy wrote:
Sorry for the double post. But I wasn't clear in the earlier post... Here is
the complete scenario.

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('testForm',1,{source:'select'});return false;"
class="genericBtn x7j">Select</button>
<script type="text/javascript">function _testFormValidator(f,s){return
true;}</script><script type="text/javascript">_submitFormCheck();</script>

How do I remove the javascript being generated? There is another hidden parameter that is set to false... <input type="hidden" name="_noJavaScript" value="false">

Is the javascript disabled if I set it to true? How can I set it to true? I
haven't found any parameter either in the web.xml or trinidad-config.xml.


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>
  <accessibility-mode>default</accessibility-mode>
    <client-validation>DISABLED</client-validation>
    <!--<client-validation-disabled>true</client-validation-disabled>-->
</trinidad-config>


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.testFormID}" >
.....

 <tr:commandButton id="select" styleClass="genericBtn"
textAndAccessKey="#{msg.selectButtonLabel}" action="select">
                                <tr:setActionListener
to="#{conversationScope.testInfo}" from="#{tDetails}"/>
<!-- This does not work either--> <!--<f:setPropertyActionListener target="#{conversationScope.testInfo}"
value="#{tDetails}"/>-->

                            </tr:commandButton>
......
</tr:form>
</ui:define>
</ui:composition>

My template i.e. "layouts/trinidad.xhtml" :

<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="test.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 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>

Reply via email to