myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <>
Subject Custom tag
Date Thu, 28 Jun 2012 21:28:54 GMT
Hi i have this:

Simple custom tag:

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


Then in my page i do:

<mytags:mybutton action="#{myBean.actionMethod}"/>

But i get a NullPointerException, this is because im not setting the
actionListener attribute, but the thing is that sometimes i need or
only action or actionlistener not both, but i have to provided both if
not i get the nullpointer.

I have to do this, but the listener method is empty in my managedbean,
i only do this for avoid the nullpointer.
<mytags:mybutton action="#{myBean.actionMethod}"

how can i avoid this?


SCJA. José Luis Cetina

View raw message