Reputation: 109
Is there a way to send boolean f:attribute
value to the bean?
a tag usage:
<xyz:mytag isGreenColor="true" .../>
facelet:
<h:panelGroup binding="#{bean.field}">
<f:attribute name="isGreenColor" value="#{isGreen}"/>
</h:PanelGroup>
and if to send to bean how to read the attribute then - the boolean cast I mean?
Thanks
Upvotes: 0
Views: 770
Reputation: 81
You can send to bean like this: ()
<p:commandLink value="" action="#{bean.func}" process="@this">
<f:attribute name="isGreenColor" value="#{isGreen}"/>
</p:commandLink>
You can use anything instead of commandLink like: p:ajax
And you can read like this:
public void func(ActionEvent event) {
Boolean isGreenColor = (Boolean) event.getComponent().getAttributes().get("isGreenColor");
}
Upvotes: 1