[ 
https://issues.apache.org/jira/browse/TOBAGO-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547075
 ] 

Guido Dubois commented on TOBAGO-515:
-------------------------------------

I have tried to find an other solution. I found a way in the folowing article:

Facelets fits JSF like a glove
http://www-128.ibm.com/developerworks/java/library/j-facelets/

This way works but it is rather hard to extend such like in.xml composition 
definition for all attributes.

Then I remembered the suggestion from Tobias made in TOBAGO-513 concerning the 
the markup attribute and facelets. So I tried to define the component like this:

  xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension";

        <tx:in id="compPA6" value="#{modelController.product.norm1470.compPa6}" 
label="#{bundle.productCompositionPA6}" labelWidth="265px">
          <f:convertNumber type="number" maxFractionDigits="2" 
pattern="#,##0.00" />
          <f:validateDoubleRange minimum="0.0" maximum="100.0" />

          <tc:attribute name="binding" 
value="#{editproductController.compInput" />
          <tc:attribute name="validator" 
value="#{editproductController.overAllValidator}" />

          <f:facet name="change">
            <tc:command actionListener="#{editproductController.valueChanged}">
              <tc:attribute name="renderedPartially" 
value=":page:panelProductComposition" />
            </tc:command>
          </f:facet>
        </tx:in>

And it works like in tobago-jsp style!
In this way you can define all attributes (markup, binding, validator, 
converter, ...) which are not supported in the compostion like in.xml and the 
way is really more easier than the first solution (Facelets fits JSF like a 
glove)...

> <tx:in> in facelets with binding attribute
> ------------------------------------------
>
>                 Key: TOBAGO-515
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-515
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.12
>         Environment: Facelets 1.1.13, MyFaces 1.1.6 snap (11.09.2007), Tobago 
> 1.0.12 snap (11.10.2007)
>            Reporter: Guido Dubois
>         Attachments: tobago_faceletsexample.war
>
>
> ...
>   xmlns:tx="http://myfaces.apache.org/tobago/extension";
>   xmlns:fx="http://myfaces.apache.org/tobago/facelet-extension";
> ...
> If you have the following input field, the page rendering is broken. You get 
> only a short demaged part of page code. If you remove the binding attribute 
> all works fine...
> ...
>         <tx:in id="name" value="#{counter.text}"
>           binding="#{counter.textInput}" label="#{bundle.helloWorldName}"
>           labelWidth="180px" validator="#{counter.stringValidator}"
>           required="true" markup="bg_color" />
> ...
> With the following input field, the page is rendered correctly, but you get a 
> NullPointerException, if you want to use the UIInput field in a BackingBean
> ...
>         <fx:in id="name" value="#{counter.text}"
>           binding="#{counter.textInput}" label="#{bundle.helloWorldName}"
>           labelWidth="180px" validator="#{counter.stringValidator}"
>           required="true" markup="bg_color" />

-- 
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