IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Text box && System date format

    Posted Tue November 16, 2010 06:06 PM

    Hi,

    From the API I receive the date in the format yyyy-mm-dd, however in the CAF I need it to show in the browser/system format.

    How can I do that? Use a converter? Using a converter how can I get the system/browser format

    Help is appreciated

    Thanks


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: Text box && System date format

    Posted Wed November 17, 2010 12:52 AM

    One way to convert a string from yyyy-mm-dd is to use the SimpleDateFormat java.util class like:

    SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd”);
    java.util.Date convertedDate = sdf.parse(“2010-11-16”);

    I’ve attached a sample portlet application that accepts a user input string, and then generates and displays the date. All date controls use the browser locale by default, unless configured differently.

    I could’ve used a converter instead of two properties but i didn’t. It’s your choice.

    Regards,
    –mark
    DateLocaleTestApp.zip (9.31 KB)


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 3.  RE: Text box && System date format

    Posted Wed November 17, 2010 09:58 AM

    Hi

    Thanks for your answer.

    I’m a newbie about this CAF so not sure about your answer.

    My IS service returns a string that contains a date (format yyyy-MM-dd). When I push the control to the screen with this field is only a text field, so the CAF can not automatically Localize since it does not know that a Date.

    Can you use any control/converter to say that the string is a Date in the format yyyy-MM-dd and that we and to change the format into the users system locale?

    It would be great to have a control to do this otherwise I will have to change my auto-generated MBs to put that code for the localization.

    Thanks in Advance


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 4.  RE: Text box && System date format

    Posted Wed November 17, 2010 08:34 PM

    In the example i posted, i’m using a Date-Input control set to read-only. All you need to do is use the Value-Pattern property and give it the format for your the string that you bound to the control: yyyy-MM-dd. (The Value-Pattern has a nice alt text that explains the purpose of that property as well).

    No converter is needed.

    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods