This discussion is archived
4 Replies Latest reply: Apr 12, 2013 10:20 AM by Stephen J. RSS

How to assign Custom Converters to specific attributes in jheadstart?

999387 Newbie
Currently Being Moderated
What is the best way to assign Custom Converters to specific attributes in Jheadstart?

For example, I have created a Custom Phone Number Converter. I want this converter to be applied to only specific attributes i.e., attributes that are phone numbers.

Is there a simple way of associating a Custom Converter to an attiribute before one runs the Jheadstart Application Definition file? Can this be done at the Entity Object level? For example, somehow you would associate the Custom Converter to an Attribute in an Entity. You would then create the View Object on top of the Entity. After that you would then run jheadstart, after which the JSF files are created with the Custom Converter associated with the attribute on the JSF page. Is this possible?

Now I know you can manually associate a Custom Converter with an attribute on a JSF page. After you run jheadstart Application Definition file, you can then go onto a page and add in the custom converter:

Example: <f:converter converterId="phoneNumberConverter"/>

But is there anyway to automate things without having to manually add in the above entry. Is there anyway to have jheadstart add in the converter when run the jheadstart application definition file.

ONE OTHER THING! If I enter it manually using <f:converter converterId="phoneNumberConverter"/> as above, I cannot do it for the attribute that is created in the Filter's quick search and advanced search features. For example when you use jheadstart in table format, it will generate a table for you. It will also generate a filter component that has both basic and advanced search options. The attributes are then added at runtime to the basic and advanced search options. There doesn't seem to be way to associate a Custom Converter with these search options. So at this point how can one associate a custom converter to the attributes in the quick and advanced search sections. Hence why I am asking the question: How to assign Custom Converters to specific attributes in jheadstart?

Thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points