[ 
https://issues.apache.org/jira/browse/TRINIDAD-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586596#action_12586596
 ] 

Cristi Toth commented on TRINIDAD-951:
--------------------------------------

btw, thanks to Harald Kuhn for most of the bits of code

> Printable output mode produces javascript errors
> ------------------------------------------------
>
>                 Key: TRINIDAD-951
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-951
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.2-core
>         Environment: Jdk 1.6, Jetty 6.1.5, Facelets 1.1.13, MyFaces JSF 
> 1.2.2, Trinidad 1.2.2
>            Reporter: Joe Rossi
>            Assignee: Cristi Toth
>            Priority: Minor
>             Fix For:  1.0.8-core,  1.2.8-core
>
>
> A page rendered with trinidad-config.xml output-mode set to printable 
> contains javascript errors. The example below (widgetList.xhtml) contains a 
> couple of command buttons and a table. When the command button 'Printable 
> Page' is clicked it sets the requestScope.outputMode to 'printable' and this 
> is used to drive the output-mode setting in trinidad-config.xml. Looking at 
> the generated html, it looks like there is no reference to the usual 
> javascript file required by Trinidad (DebugCommon1_2_2.js or Common1_2_2.js).
> trinidad-config.xml:
> ===============
> <?xml version="1.0"?>
> <trinidad-config xmlns="http://myfaces.apache.org/trinidad/config";>
>   <!--
>   Enable this setting to cause Trinidad to generate debug output.
>   <debug-output>true</debug-output>
>    -->
>   <skin-family>tn</skin-family>
>   <output-mode>#{requestScope.outputMode}</output-mode>
> </trinidad-config>
> Test file: widgetList.xhtml:
> ====================
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <tr:document id="testForm" title="test form"
>   xmlns:h="http://java.sun.com/jsf/html";
>   xmlns:f="http://java.sun.com/jsf/core";
>   xmlns:ui="http://java.sun.com/jsf/facelets";
>   xmlns:tr="http://myfaces.apache.org/trinidad";>
>   <tr:panelBorderLayout>
>     <tr:form id="widgetListForm">
>       <tr:panelGroupLayout layout="vertical">
>         <tr:commandButton text="Create New Widget"
>           action="dialog:widgetDialog"
>           useWindow="true" partialSubmit="true"
>           windowHeight="300" windowWidth="400"
>           id="createWidgetCommand">
>           <tr:setActionListener from="#{widgetListBean.newWidgetBean}"
>             to="#{pageFlowScope.widgetBean}" />
>           <tr:setActionListener from="#{'create'}"
>             to="#{pageFlowScope.widgetBean.operation}" />
>         </tr:commandButton>
>         <tr:commandButton text="Refresh Page" id="refreshCommand">
>         </tr:commandButton>
>         <tr:commandButton text="Printable Page" id="printablePageCommand">
>           <tr:setActionListener from="#{'printable'}"
>             to="#{requestScope.outputMode}" />
>         </tr:commandButton>
>         <tr:table id="widgetTable" var="widgetBean"
>           value="#{widgetListBean.widgetList}" rowBandingInterval="1"
>           partialTriggers="refreshCommand createWidgetCommand 
> widgetTable:editWidgetCommand widgetTable:deleteWidgetCommand">
>           <tr:column>
>             <f:facet name="header">
>               <tr:outputText value="Widget Name" />
>             </f:facet>
>             <tr:outputText value="#{widgetBean.name}" />
>           </tr:column>
>           <tr:column>
>             <f:facet name="header">
>               <tr:outputText value="Actions" />
>             </f:facet>
>             <tr:panelGroupLayout layout="horizontal">
>               <tr:commandLink action="dialog:widgetDialog"
>                 useWindow="true" partialSubmit="true"
>                 windowHeight="300" windowWidth="400"
>                 id="editWidgetCommand"
>                 shortDesc="Edit the widget.">
>                 <tr:image source="/skins/tn/images/ico_edit.gif" />
>                 <tr:setActionListener from="#{'edit'}"
>                   to="#{widgetBean.operation}" />
>                 <tr:setActionListener from="#{widgetBean}"
>                   to="#{pageFlowScope.widgetBean}" />
>               </tr:commandLink>
>               <tr:commandLink action="dialog:widgetDialog"
>                 useWindow="true" partialSubmit="true"
>                 windowHeight="300" windowWidth="400"
>                 id="deleteWidgetCommand"
>                 shortDesc="Delete the widget."
>                 returnListener="#{widgetListBean.processReturn}">
>                 <tr:image source="/skins/tn/images/ico_delete.gif" />
>                 <tr:setActionListener from="#{'delete'}"
>                   to="#{widgetBean.operation}" />
>                 <tr:setActionListener from="#{widgetBean}"
>                   to="#{pageFlowScope.widgetBean}" />
>               </tr:commandLink>
>             </tr:panelGroupLayout>
>           </tr:column>
>         </tr:table>
>       </tr:panelGroupLayout>
>     </tr:form>
>   </tr:panelBorderLayout>
> </tr:document>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to