Thank you Mamallan very very much for the prompt repsonses.
I was wondering, if we cannot disable the javascript being generated then is
it possible to make the commandButton work anyways (with the javascript that
trinidad attaches) when the javascript is turned off. I tried
h:commandButton, sf:commandButton and t:commandButton but nothing seems to
work without javascript after I made it a trinidad document. Trinidad adds
the onclick event to these buttons automatically and hence when javascript
is turned off, it just does not work.
I just want to make these buttons work regardless of the javascript. Is
there anyway I can make these buttons work when javascript is turned off?
Thanks!
Mamallan Uthaman wrote:
>
> Please find my answers below.
> -Mamallan
>
> djohnjimmy wrote:
>> I'm surprised that Trinidad does not work without javascript. Trinidad is
>> not
>> fully 508 compliant then. I was soooooo looking forward to use it
>> everywhere. Can we put a hack somewhere to get it working without
>> javascript?
>>
> No, I don't think we have any hack. Trinidad render a simplified UI
> without any JavaScript dependency for some less-capable mobile-browsers.
>> The real problem I am facing right now is, we need to underline the
>> accesskeys in the left menu. We designed the left menu with
>> commandButtons
>> (disguised as a menu link) so that it works even with javascript turned
>> off.
>> For some reason, we could not get the commandLinks working
>> (sf:commandlinks
>> are the only commandlinks that work and those too donot display the text
>> on
>> them with javascript turned off) and that's why we had to do everthing
>> with
>> commandButtons.
>>
>> Anyways, the point being we have to make the application fully 508
>> complaint
>> and that involves underlining the accesskeys everywhere. Is there any
>> other
>> library out there that does this without requiring javascript?
> I am not aware.
>> Or can we get
>> trinidad going without javascript? I'd love to use trinidad!
>>
> No, Trinidad needs JavaScript to function properly except for some
> mobile-browsers.
>>
>> Mamallan Uthaman wrote:
>>
>>> 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>
>>>>
>>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Trinidad-buttons-do-not-work-with-javascript-turned-off-tp24798027p24810992.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.