开发者

facelet composition control (custom tag) with binding

开发者 https://www.devze.com 2023-01-16 01:05 出处:网络
I\'m having problems with creating a Facelet Composition Control (= custom tag). That\'s the component\'s template (numberinput.jspx). I declared thein my custom-taglib.xml.

I'm having problems with creating a Facelet Composition Control (= custom tag).

That's the component's template (numberinput.jspx). I declared the in my custom-taglib.xml.

So far the inclusion works using this code:

<ft:numberInput nullablenumber="true" cid="myId" 
                        bind="#{myBean.mySpecialComponent}"
                        value="#{myBean.license.myProperty }" 
                            label="My Label"/>

That's the template:

<div id="c_#{cid}"
    xmlns="http://www.w3.org/1999/xhtml"
    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:jsp="http://java.sun.com/JSP/Page"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:ft="http://www.mycomp.com/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core" style="overflow:auto" >
    <ui:composition>    
    <ice:message for="#{cid}"></ice:message>
    <ice:outputLabel for="#{cid}">#{label }</ice:outputLabel>

    <ice:inputText          
        id="#{cid}"
        value="#{value}"        
        style="#{style }"   
        required="false"
        disabled="#{disabled }"
        binding="#{ bind}"
        >       
        <f:validator validatorId="notnull"/>    
        <f:converter converterId="nullableNumber"/>

    </ice:inputText> 
    </ui:composition>


</div>

My problems arise when I have multiple of these tags on my page. I seems like Facelets gets confused and displays only a set of these, it's really very odd.

Is there anything wrong with my code or is Facelets just as buggy as it seems?

Thanks a lot.

From my current experience I only can discourage anyone to use Facelets custom tags (at least when component binding is used).

Environment info: I'm using ICEFaces 1.8.2 and Tomcat 6


Problem found! The reason for the problems were that I had a second ice:inputText control which was bound to the same backend bean proberty. it seems like this causes a lot of problems for JSF component tree generation.

My fault but it still would be nice if JSF gives any hints or error messages instead of just acting weird...

0

精彩评论

暂无评论...
验证码 换一张
取 消