Tomahawk HTML editor - t:inputHtml

How to get married with Tomahawks t:inputHtml tag.

http://wiki.apache.org/myfaces-data/attachments/Tomahawk_HTML_Editor/attachments/tomahawk_inputHtml.JPG
This sample bases on:

Does not work with Firefox 3.6!
Patch available in trinidad 1.0.12ff

https://issues.apache.org/jira/browse/TRINIDAD-1695

your.jsp

    <tr:panelGroupLayout>
        <t:inputHtml id="compInputHtml" style="height:200px;" rendered="true" addKupuLogo="true"
            allowExternalLinks="true" allowEditSource="true" showAllToolBoxes="true"
            value="#{user.notice}" validator="#{user.validateNotice}" />
        <t:message for="compInputHtml" styleClass="error" />
    </tr:panelGroupLayout>
    <%-- MUST use tomahawk submit otherwise value gets lost --%>
    <t:commandButton value="Save"/>

web.xml

    <!-- Myfaces Tomahawk Extensions Filter -->
    <filter>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>10m</param-value>
            <description>
                Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB
                1g - 1 GB
            </description>
        </init-param>
        <init-param>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
            <description>
                Set the threshold size - files below this limit are stored in memory, files above this
                limit are stored on disk.
                Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
            </description>
        </init-param>
        <!-- <init-param>
            <description>Set the path where the intermediary files will be stored.
            </description>
            <param-name>uploadRepositoryPath</param-name>
            <param-value>/temp</param-value>
            </init-param>-->
    </filter>
    <!-- filter mapping for session Myfaces extension filter -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
    </filter-mapping>

pom.xml

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.5</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.5</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.tomahawk</groupId>
            <artifactId>tomahawk</artifactId>
            <version>1.1.6</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-api</artifactId>
            <version>1.0.10</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-impl</artifactId>
            <version>1.0.10</version>
            <scope>compile</scope>
        </dependency>

Tomahawk_HTML_Editor (last edited 2010-02-04 12:39:22 by Bruno Marti)