jsf 2 - How to pass the node value as the attribute in Composite Component in JSF 2.0 -


i developing jsf 2.0 composite component. trying create box component required html set attribute.

some thing like..

<composite:interface>     <composite:attribute name="value" /> </composite:interface> <composite:implementation>     <table cellpadding="0" cellspacing="0" border="1" width="100%">         <tr>             <td></td>             <td>#{cc.attrs.value}</td>             <td></td>         </tr>     </table> </composite:implementation> 

when want use component , pass required html attribute "value", so:

<somedir:boxcomp>hello</somedir:boxcomp> 

the "hello" not taken attribute value. how can make node value attribute value.?

you aren't passing tag attribute. passing child in tag body. in case need use <composite:insertchildren /> insert it. so, instead of

<td>#{cc.attrs.value}</td> 

you should doing

<td><composite:insertchildren /></td> 

or if actually want use #{cc.attrs.value}, should defining real tag attribute beginning on instead of tag body:

<somedir:boxcomp value="hello" /> 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -