You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/11/15 13:32:56 UTC

[Myfaces Wiki] Update of "SubForm" by Keywan Ghadami

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by Keywan Ghadami:
http://wiki.apache.org/myfaces/SubForm

The comment on the change is:
initial Descr

New page:
Use to validate just a part of your Page.
It's a nice solution for an common JSF Problem, hope it will be soon part of tomahawk.


To use it with Facelets u need to do folling:


1. Download the Version maching to your tomahawk version
ann add it to your other jar files 
http://people.apache.org/maven-snapshot-repository/org/apache/myfaces/tomahawk/tomahawk-sandbox/

2. Add the Tag lib to your web XML
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

 <context-param>
  <param-name>facelets.LIBRARIES</param-name>
  <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/sandbox.taglib.xml</param-value>
 </context-param>

<!-- Don't forget the other stuff this only will not work-->

</web-app>



3. Create or download a Taglib with a <tag> for subform

<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">

<facelet-taglib>
    <namespace>http://myfaces.apache.org/sandbox</namespace>

    <tag>
        <tag-name>subForm</tag-name>
        <component>
            <component-type>org.apache.myfaces.SubForm</component-type>
            <renderer-type>org.apache.myfaces.SubForm</renderer-type>
        </component>
    </tag>

</facelet-taglib>



4. At the s namespace to xhtml File (xmlns:s="http://myfaces.apache.org/sandbox")

<html 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:s="http://myfaces.apache.org/sandbox">


5. use like the exemples you will find on ....