• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

set value in a composite component

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: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>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic