I'm trying to create a component to receive the photo from the user's profile. But for this I need to make the access component the methods within the CDI Bean of the page in question. I'm doing something like this:
Creating the component:
<composite:interface displayName="profilePhoto">
<composite:attribute name="mBean" type="br.com.fm.modelo.abstracts.ProfilePhoto" required="true"
shortDescription="Bean que gerencia esta página." />
</composite:interface>
<composite:implementation>
[...cut...]
<p:commandButton action="#{cc.attrs.mBean[fecharFotoDialog]}"/>
[...cut...]
</composite:implementation>
Creating the Bean:
@Named
@ViewScoped
public class CadastroUsuario extends ProfilePhoto implements Serializable {
public void fecharFotoDialog() {
System.out.println("Entrei nesse treco aqui...");
}
}
Calling the component in the firstfaces:
<t:profilePhoto mBean="#{cadastroUsuario}"/>
What do I expect to happen? That by clicking on the button that is in the component the fecharFotoDialog()
method is called.
Some direction on where I'm going wrong?
Thank you,