1 Reply Latest reply: Oct 26, 2012 4:40 AM by RMishra RSS

    converter in atg

    959025
      I have found a piece of code while writing code for my checkout functionality. Would like to know what exactly it means:

      <dsp:valueof converter="creditcard" param="key"/>

      What does the converter part does?
        • 1. Re: converter in atg
          RMishra
          To enable more control over data conversions, the ATG platform provides tag converter classes. Tag converters let you specify how data in forms is interpreted and displayed, and to control when exceptions are thrown. You specify tag converters through special attributes that ATG provides.

          like you have some String value and want to format it as Data, so we have data converter.

          Same was <dsp:valueof converter="creditcard" param="key"/> will take value from key parameter and print as CreaditCard.
          More examples:
          <dsp:valueof bean="CreditCard.number"converter="CreditCard" groupingsize="4"/> will format creditcart with grouping into 4. if input is 7895487958 so will format 7878 9548 7958
          <dsp:valueof bean="CreditCard.num" converter="CreditCard" numcharsunmasked="4"/> will format like XXXXXXXXXXXX3456
          <dsp:valueof bean="CreditCard.num" converter="CreditCard" maskcharacter="*" numcharsunmasked="12"/> will format like ****567890123456
          <dsp:input bean="NewUser.birthDate" date="M/dd/yyyy"/> will format birthDate in M/dd/yyyy.

          All converters are :
          CreditCard
          currency
          Date
          map
          Nullable
          Number
          Required
          valueishtml

          All dsp tags where we can use converters are:
          dsp:a
          dsp:input
          dsp:param
          dsp:postfield
          dsp:select
          dsp:setvalue
          dsp:textarea
          dsp:valueof

          For details refers to http://docs.oracle.com/cd/E23095_01/Platform.93/PageDevGuide/html/s0208tagconverters01.html
          -RMishra

          Edited by: RMishra on Oct 26, 2012 3:09 PM