myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Möller <thomas.moel...@continentale.de>
Subject composite components: optional method-expression-attributes
Date Wed, 27 Oct 2010 13:42:25 GMT

Hi,

what is the recommended way how to deal with optional attributes that refer
to a method expression?

For example imagine a simple component that uses a commandLink and has two
attributes: "action" and "actionListener":

<cc:interface>
  <cc:attribute name="action" method-signature="java.lang.String action()"
default="???" />
  <cc:attribute name="actionListener" method-signature="void
actionListener(javax.faces.event.ActionEvent)" default="???" />
</cc:interface>

<cc:implementation>
  <tr:commandLink action="#{cc.attrs.action}"
actionListener="#{cc.attrs.actionListener}" />
</cc:implementation>

My problems:
1) omitting the defaults results in NullPointerExceptions
2) the spec says that a default-attribute must evaluate to a
java.lang.String

What is the solution for this simple problem?

Thanks in advance.
-- 
View this message in context: http://old.nabble.com/composite-components%3A-optional-method-expression-attributes-tp30067392p30067392.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message