Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

set value in a composite component  RSS feed

Elizabeth Tom
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:attribute name="ssnLabel"/>
<cc:attribute name="ssnValue" required="true"/>

<h:panelGrid columns="2" id="textPanel">
#{cc.attrs.ssnLabel} <h:outputText id="maskedSSN" value="#{ssn.mask(cc.attrs.ssnValue)}" />
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!