2017-06-06 2 views
0

私はこのためカスタム属性を追加したいjsfでカスタムコンポーネントのカスタム属性を追加する方法は?

<h:body bgcolor="white"> 
<cs:CustomComponent></cs:CustomComponent>  
      </h:body> 

以下のように私はJSF

XHTMLでコンポーネントをレンダリング
 <tag-name>CustomComponent</tag-name> 
    <component> 
      <component-type>javax.faces.Input</component-type> 
    </component> 
     </tag> 

でtaglib.xmlのコード下記のようなカスタム・コンポーネントを作成していますコンポーネント。そして、指定された以外の引数があれば警告を投げたい。これはjsfで可能ですか? XHTMLで

答えて

1

ここを見て

<tag> 
<tag-name>training</tag-name> 
<attribute> 
    <name>style</name> 
</attribute> 
<attribute> 
    <name>action</name> 
    <method-signature>java.lang.String action()</method-signature> 
</attribute> 
<component> 
    <component-type>training</component-type> 
    <renderer-type>pl.spiid.app.spiidcharts.beans.training.Training</renderer-type> 
</component> 

私は<libtag:training style="blabla" />を使用することができると私はレンダラでそれを取得することができます。

Map<String, Object> attrMap = component.getAttributes(); // to 
    String style = (String) attrMap.get("style"); 
関連する問題