aspose file tools*
The moose likes JSF and the fly likes set value in a composite component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "set value in a composite component" Watch "set value in a composite component" New topic
Author

set value in a composite component

Elizabeth Tom
Greenhorn

Joined: Jan 25, 2011
Posts: 2
My scenario is that once a user types in a SSN and clicks on Search, I should display all matching SSN results in a masked pattern. And once the user has selected an SSN , I should disply the SSN all across the application in a masked pattern ( 123-XX-XXX). Since this is something that is quite repetetive I thought I would create a composite component.
This is xhtml code I created: ssn is a managed bean which has a method mask to format the ssn passed to it. My question is if I can pass the componenets attribute ssnValue to the bean as I am doing below? If not what is the right way to do it ? Thanks for any help in advance.

<cc:interface>
<cc:attribute name="ssnLabel"/>
<cc:attribute name="ssnValue" required="true"/>
</cc:interface>

<cc:implementation>
<h:form>
<h:panelGrid columns="2" id="textPanel">
#{cc.attrs.ssnLabel} <h:outputText id="maskedSSN" value="#{ssn.mask(cc.attrs.ssnValue)}" />
</h:panelGrid>
</h:form>
</cc:implementation>
 
Don't get me started about those stupid light bulbs.
 
subject: set value in a composite component