Date picker in BSP htmlb

Hi friends,
How can i put a date picker(value help for date) in front of text field of my BSP page?
regards
Pranav
Edited by: Pranav Goswami on Aug 28, 2008 11:00 AM

Hi,
Refer to this class for the Date from Calender -
CL_RSDM_F4SERVICE_DATE
or
Refer to this Interface
CLG_HTMLB_DATENAVIGATOR
Regards
Lekha

Similar Messages

  • How to Resize the default date picker calendar

    Hello Experts,
    SAP CRM web UI shows a date picker as follows for populating fields of type date.
    We noticed a strange issue that for months like January 2015 , the width of the date picker is lesser than what is shown for November 2014.
    As you can see in the following snapshot , the dropdown icon of the second field is hidden when the month shown is November 2014.
    This an issue because of the different sizes shown for different months , users would have to move mouse pointer when they to move to next months by clicking on the next arrow icon.
    Any tricks to fix the width of the date picker will be really appreciated.

    Hi Praveen,
    You can try following tricks -
    1. Go to SE80, search for BSP Application = 'thtmlb_styles'
    2. under Pages with Flow Logic  - we have one CSS file called "thtmlb_core_stand.css"
    3. In this file try changing width of method call ' #thtmlb-calendar-container ' to 150px  like shown below.
    #thtmlb-calendar-container {
         display:                none;
         position:               absolute;
         width:                  150px;
    hope it helps.
    Best Regards,
    Sandeep Kumar B

  • Date Picker & File Upload components

    Hi all,
    I would like to have a Date Picker in a column in the table view (htmlb for java). Kindly let me know how I can do it.
    Similiarly can I make use of File Upload (htmlb for java )component inside the table view. I want to have a column which would allow a file to uploaded associated with that row.
    Rgds,
    Subu

    Of interest relating to file upload component to users : "Saving Uploaded Files Uploaded by the File Upload Component " Check the blog:
    http://blogs.sun.com/roller/page/divas

  • BSP HTMLB TABLE - BORDERS FOR EMPTY CELLS

    Hello Colleagues, I'm new to BSP HTMLB, maybe someone could help me.
    I’m taking data from a DB table through select and there are a lot empty cells.
    The layout looks like:
    <htmlb:tableViewColumn columnName="PK_Terms"
    <%--wrapping="true"--%>
    width="50"
    horizontalAlignment = "center"
    verticalAlignment = "middle"
    fixedColumn="true">
    </htmlb:tableViewColumn>
    THE BORDER does not APPEAR in empty cells (the table looks horrible), how can I make it appear?

    Hi,
    If the cell is initial pass the   then it will shows the border like when the data is not initial.
    i have got this in my requirement.
    if it is not shows the any cell pass <border=1>
    Regards,
    Sri..

  • Making date picker work in ITS environment

    Hello,
    I know this is the BSP forum, but I need help with this issue on ITS 6.20 SP12 and I don't know where else to post this on the SDN.
    I am trying to use a JS date picker app like this:
    <td>`OPEN_SCH_LINES.label`</td>
                    <td><input type="text" name="`ZSR_OPEN_SCH_LINES[1].name`" />
                        <a href="javascript:show_calendar('area1.`ZSR_OPEN_SCH_LINES[1].name`');">
                    <img id="calendar" src="`mimeurl(~name="calendar.gif", ~language="", ~theme="99")`" />
                        </a>
                    </td>
    this is what the ITS makes out of it:
    <td>Open Schedule lines</td>
                    <td><input type="text" name="zsr_open_sch_lines[1]" />
                        <a href="javascript:show_calendar('area1.zsr_open_sch_lines[1]');">
                    <img id="calendar" src="/sap/its/mimes/zwmm01/99/calendar.gif" />
                        </a>
                    </td>
    Problem is that when the JS is triggered using the button, I can pick a date from the calendar app, but receive an error saying that the
    "self.opener.document.area1.zsr_open_sch_lines.1" is null or not an object. It obviously seems to have problems with the "[1]" indexation the ITS adds. I have managed to get the date picker working by removing the "[1]" but how can I then get the field entry back into the context?
    Any advice re this is highly appreciated - also any hints to better or more suitable JS date picker apps.
    Many thanks,
    Michael

    Hi,
    which model r u using?
    WebRFC, WebGui or Flow file?
    Regards
    Raja

  • Data binding in bsp

    hi sdns,
    how data binding is done in BSPS?
    What is the diffference between DO_HANDLEDATA and DO_HANDLE EVENT?
    What is the process flow when using mvc in BSPs?
    Advance Thanks ,
    chandana

    Hi chandana,
    1) how data binding is done in BSPS?     
    A)  Databinding useful to have perfect interactions between view and model.
          Whenever user interacts with view, automatically the data which is entered by the user will be passed
         to the model using databinding.
         Declare reference variable for model class as page attribute in BSP.
         Sample code of BSP:
               <htmlb:inputField       id          = "f1" value = "//model/v1" />
               <htmlb:inputField     id          = "f2"  value = "//model/v2" />
         Here i declared model as reference variable ,v1 and v2 are model class attributes.
         so automatically values of both input fields are passed to the model class attributes (v1 and v2).
    2) What is the diffference between DO_HANDLEDATA and DO_HANDLE EVENT?
    A) DO_HANDLEDATA  is used to handle the data. As data binding is available, we don't need to use this
         method.
        DO_HANDLE EVENT is used to process the actions performed in the view.
    3) What is the process flow when using mvc in BSPs?
      A)  MVC flow doesn't change in bsp.As we know  in MVC , whenever user trigger action in the view,
           Controller process the action and determine what should be happened next such as calling model
           class and displays next view in the process flow.The same flow occurs in BSP .
    Hope it helps.
    xxxxxxxxxxxxxxxxxxxxx
    Thanks,
    Narendra.M
    Edited by: Armin Reichert on Apr 26, 2008 6:52 PM

  • Problem with Date Picker and wwv_flow_item.date_popup()

    I have a Report based on the HTMLDB How-To “Build Tabular Forms for Multi-Row Operations”
    This is my code:
    select
    X.RRIT_UID,
    X.DOS,
    X.CPT_CODE,
    X.MOD,
    X.DX_CODE,
    X.CHARGES,
    X.UNITS
    from
    (select
    htmldb_item.text(1,RRIT_UID) RRIT_UID,
    wwv_flow_item.date_popup(2,null,RRIT_DATE_OF_SERVICE) DOS,
    htmldb_item.text(4,RRIT_SUBMIT_SERVICE_CODE,6) CPT_CODE,
    htmldb_item.text(5,RRIT_SUBMIT_MODIFIER,3) MOD,
    htmldb_item.text(6,RRIT_ATT_DIAG_CODE,6) DX_CODE,
    htmldb_item.text(7,RRIT_BILLED_CHARGES,9) CHARGES,
    htmldb_item.text(8,RRIT_UNITS,3) UNITS
    from
    RRIT_REPRICE_ITEM
    where
    RRRR_UID = :P5_RRRR_UID
    union all
    select
    htmldb_item.text(1,null) RRIT_UID,
    wwv_flow_item.date_popup(2,null,null) DOS,
    htmldb_item.text(4,null,6) CPT_CODE,
    htmldb_item.text(5,null,3) MOD,
    htmldb_item.text(6,null,6) DX_CODE,
    htmldb_item.text(7,null,9) CHARGES,
    htmldb_item.text(8,null,3) UNITS
    from
    dual)
    X
    My problem is when I run the page and select a date from the Pop-Up calendar I get this error:
    Line 10
    Error: ‘opener.document.forms.0.f02.0’ is null or not an object
    I know it is something to do with data formats and the fact that I do not fully understand the use of wwv_flow_item.date_popup().

    Hi DK,
    It is a WD Java application, Backend is ABAP (MM module).
    The UI is input field, where the context attribute type is Date, So its been changed to Date Picker.
    The problem is when the user runs the WD application in Portal, The calendar format is being changed for some users. That is for few users the Week starts with Monday and for few users the week starts with Sunday.
    I need all the users to have Monday as the First day of the week.
    Please let me know, what will be solution for this.
    Since I haven't done anything in regard to date, it is a simple Date format.
    Thanks & Regards,
    Palani

  • Problem with Date Picker Item

    Hello,
    I'm using APEX 4.2.2.00.11 and I have a problem with the Date Picker. I can't select any day of the second week of the month (it happens for all months).
    Someone know if there are any reason (and how can I solve it) or is an APEX bug?
    Thank you!

    Hi Chimanzee,
    try for : source value
    to_char(sysdate-7,'DD/MM/RRRR')
    hope this helps.
    Leo

  • Date picker not working correctly.

    Hi all,
    I have a strange prob in webdynpro.
    I am using Date picker. But once i read it, the value is one day less than that i give.
    For eg, i give <b>06/25/2006</b>.. but it reads as <b>06/24/2006</b>.
    Please help.
    Thanks in advance
    gEorgE

    Open an OSS message (BC-WD-JAV-RUN).
    Armin

  • Date Picker Doesn't Like Retrieved or Typed In Date Values

    I have more than one Region on a page, so I retrieve the column values for a region this way:
    (On LOad, Before Header, Once per Page Visit)
    BEGIN
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_FORMAT='''||:pick_date_format_mask||'''';
    FOR request_rec IN (SELECT dev_requested_ind,
    dev_requested_dttm,
    dev_analyst_seq,
    dev_completed_ind,
    dev_completed_dttm,
    dev_dba_seq,
    sit_requested_ind,
    sit_requested_dttm,
    sit_analyst_seq,
    sit_completed_ind,
    sit_completed_dttm,
    sit_dba_seq,
    uat_requested_ind,
    uat_requested_dttm,
    uat_analyst_seq,
    uat_completed_ind,
    uat_completed_dttm,
    uat_dba_seq,
    prd_requested_ind,
    prd_requested_dttm,
    prd_analyst_seq,
    prd_completed_ind,
    prd_completed_dttm
    FROM request_tbl
    WHERE request_seq = :p16_request_seq)
    LOOP
    :p16_dev_requested_ind := request_rec.dev_requested_ind;
    :p16_dev_requested_dttm := request_rec.dev_requested_dttm;
    :p16_dev_analyst_seq := request_rec.dev_analyst_seq;
    :p16_dev_completed_ind := request_rec.dev_completed_ind;
    :p16_dev_completed_dttm := request_rec.dev_completed_dttm;
    :p16_dev_dba_seq := request_rec.dev_dba_seq;
    :p16_sit_requested_ind := request_rec.sit_requested_ind;
    :p16_sit_requested_dttm := request_rec.sit_requested_dttm;
    :p16_sit_analyst_seq := request_rec.sit_analyst_seq;
    :p16_sit_completed_ind := request_rec.sit_completed_ind;
    :p16_sit_completed_dttm := request_rec.sit_completed_dttm;
    :p16_sit_dba_seq := request_rec.sit_dba_seq;
    :p16_uat_requested_ind := request_rec.uat_requested_ind;
    :p16_uat_requested_dttm := request_rec.uat_requested_dttm;
    :p16_uat_analyst_seq := request_rec.uat_analyst_seq;
    :p16_uat_completed_ind := request_rec.uat_completed_ind;
    :p16_uat_completed_dttm := request_rec.uat_completed_dttm;
    :p16_uat_dba_seq := request_rec.uat_dba_seq;
    :p16_prd_requested_ind := request_rec.prd_requested_ind;
    :p16_prd_requested_dttm := request_rec.prd_requested_dttm;
    :p16_prd_analyst_seq := request_rec.prd_analyst_seq;
    :p16_prd_completed_ind := request_rec.prd_completed_ind;
    :p16_prd_completed_dttm := request_rec.prd_completed_dttm;
    END LOOP;
    END;
    p16_dev_requested_dttm is defined as a Date Picker (use application format mask)
    The data source is a Date column called dev_requested_dttm. I haven't defined a format mask for it. (I have tried using &PICK_DATE_FORMAT_MASK..)
    The Application Format Mask is defined as a Subsitution String called
    PICK_DATE_FORMAT_MASK
    with a value of
    MM/DD/YYYY HH:MI AM
    The retrieved column value for p16_dev_requested_dttm looks fine, but when I click the date picker pushbutton, I get this message:
    Not Found
    The requested URL /pls/htmldb/wwv_flow_utilities.show_as_popup_calendar was not found on this server.
    Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server Server at edwdev.dhhs.state.nh.us Port 7779
    I also get a line in my log file,
    /vg02lvol1/app/oracle/product/htmldb/Apache/Apache/logs/error_log.1133956800:
    [Wed Dec  7 16:23:43 2005] [error] [client 172.16.252.76] [ecid: 1133990623:172.17.96.35:1802:0:9870,0] mod_plsql: /pls/htmldb/wwv_flow_util
    ities.show_as_popup_calendar HTTP-404 ORA-01849: hour must be between 1 and 12\nORA-06512: at "FLOWS_020000.WWV_FLOW_UTILITIES", line 1801\n
    ORA-06512: at line 22\n
    This happens with both FireFox and Internet Explorer.
    Any ideas what's causing this?
    -F
    Message was edited by:
    Fred C Willingham

    Fred,
    Unfortunately, the answer is no to both of your questions.
    There is no way for you as a developer to control which date is highlighted in the popup calendar. It will always highlight the current day (if you're displaying a month that contains the current day). This is an interesting and prudent suggestion, and one which we'll consider for an upcoming release of HTML DB.
    With regards to your second point, that also is something we should consider for an upcoming release of HTML DB. This isn't impossible for us to do, it was just designed to work in the current fashion. If you look at the generated HTML for the Date Picker item on the page (not the popup calendar itself, but the page on which the item is rendered), we break out each element of the date value into discrete components. When we instead rely upon the user entered value, garbage or date values not conforming to the date format mask are easily entered. And the question is - what to do then? Raise an error immediately, still popup the calendar and show the current month, etc. So we've tried to be fairly strict about the date values and format masks for the popup calendar, hence the implementation you see.
    Thanks again for your comments.
    Joel

  • Two questions: Event on a Date Picker and Read Only on a full page?

    Hello,
    I make use of this very informative board to develop an application but i have been unable to find info on these two topics. Sorry if it has been already discussed extensively.
    Using HTMLDB 2.2 for now.
    =>First question:
    I have a date picker item with an event
    onChange="resaStatusChange();"
    in the HTML Form Element Attribute field.
    The event is triggerring if i put a new data in the field but does not trigger if i use the picker.
    Is it a standart behaviour? Is there a way to trigger the event when new data is provided through the date picker?
    => Second question:
    One page in my application has to be used either to only display information or as a mixed displaying/entering data sheet.
    When the context is appropriate to use the page as a simple display (testing both global authorization and data to be displayed), is there a way to put a read only attribute on the full page instead of putting the read only conditions through each and every item of the page?
    Sorry if the questions are not clear and apologize for what should be newbie questions.
    Any link or info will be appreciated.
    Regards,
    Daniel Gureghian

    Hi Daniel,
    I'm not sure about your first question, but I can hopefully give you a helpfull answer for your second one.
    I'm handling it this way:
    var elInput = document.getElementsByTagName('input');
    var elTextArea = document.getElementsByTagName('textarea');
    var elSelect = document.getElementsByTagName('select');
    for (i = 0; i < elInput.length; i++)
      setReadOnly(elInput, true);
    for (i = 0; i < elTextArea.length; i++)
    setReadOnly(elTextArea[i], true);
    for (i = 0; i < elSelect.length; i++)
    setReadOnly(elSelect[i], true);
    function setReadOnly(pThis, pRead)
         if (pThis && pRead)
              pThis.disabled = pRead;
              pThis.style.emptyCells = "show";
              pThis.style.color = "black";
              pThis.style.backgroundColor = "#DDDDDD";
         else if (pThis && !pRead)
              pThis.disabled = pRead;
              pThis.style.emptyCells = "show";
              pThis.style.color = "black";
              pThis.style.backgroundColor = "#FFFFFF";
    I never used it on a whole page, only for regions. So maybe you have to make some changes.
    chrissy

  • Date Picker error

    Hi,
    We have an application that cannot use the date picker, after a date is selected, the error we get is:
    A runtime error has occurred
    Line:10
    Error: 'opener.document.forms.0.p_t03' is null or not an object
    After a lot of searching around, the developer has narrowed it down to something on the template for some reason, but we are not sure what. If we remove the template, it works fine - but in this case the business wants the standard look and feel - so we are stuck with having to use it.
    Below is the header, body and footer sections of the offending template - anyone have any idea of what could cause the problem with the date picker?
    Header:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>#TITLE#</title>
    #HEAD#
    <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="Monash University Research Output Reporting Tool" />
    <meta name="keywords" content="research, RORT, reporting" />
    <link rel="stylesheet" href="http://assets.monash.edu.au/styles/monash.css" type="text/css" />
    <link rel="stylesheet" href="http://assets.monash.edu.au/styles/print.css" media="print" type="text/css" />
    <link rel="shortcut icon" href="http://www.monash.edu.au/favicon.ico" />
    <link rel="stylesheet" href="#IMAGE_PREFIX#css/einstein.css" type="text/css" />
    <script src="#IMAGE_PREFIX#javascript/functions.js" type="text/javascript"></script>
    </head>
    <div id="accessibility">
    Skip to content | Change text size
    </div>
    <div class="spacer"></div>
    <!-- S I T E I D E N T I F I C A T I O N -->
    <div id="global-header">
    <div id="global-images">
    <img id="logo" src="http://assets.monash.edu.au/images/logo.gif" width="343" height="79" alt="Monash University" /><img id="banner-image" src="http://assets.monash.edu.au/images/banner-research.jpg" width="288" height="79"
    alt=" " title="" />
    </div>
    <div class="spacer"></div>
    <!-- G L O B A L N A V I G A T I O N -->
    <table id="global-nav" summary="Layout for site-wide navigation">
    <tr><td>
    Monash home | About Monash | Faculties | Campuses | <a
    href="http://www.monash.edu.au/contact/">Contact Monash</a>
    </td></tr>
    </table>
    <!-- U T I L I T Y N A V I G A T I O N -->
    <table id="global-utils" summary="Layout for utility navigation">
    <tr>
    <td>
    Staff directory | A-Z index | Site map  
    </td>
    <td id="global-utils-form">
    <form action="http://ultraseek.its.monash.edu.au/query.html" method="get" name="seek1" id="seek1">
    <input type="hidden" name="rq" value="0" />
    <input type="hidden" name="col" value="m0" />
    <input type="hidden" name="qs" value="-monash.access:intranet -monash.access:emailarchive" />
    <label class="search" for="qt">SEARCH </label>
    <input type="text" id="qt" name="qt" size="20" maxlength="1024" />
    <input type="hidden" name="qp" value="" />
    <input name="submit" type="submit" accesskey="1" value="Go" />
    </form>
    </td>
    </tr>
    </table>
    <body #ONLOAD#>#FORM_OPEN#
    <H1><CENTER>MRGS EXAMINATIONS</CENTER></H1>
    Body:
    <!-- S K I P L I N K A N C H O R -->
    <a name="content" id="skiplink"></a>
    <div align="right">
    <table class="std">
    <tr><td align="left" width="10%" valign="bottom" nowrap="nowrap"><span class="PortletHeading2">&USER.</span></td><td style="padding-left:30px;">#NOTIFICATION_MESSAGE# #SUCCESS_MESSAGE#</td></tr></table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="TabForegroundColor">
    <tr><td class="TabForegroundColor"><img src="#IMAGE_PREFIX#f_spacer.gif" border="0" height="3" alt="" /></td></tr>
    </table></div>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="3">
    <div class="th_content_body">
    #REGION_POSITION_01#
    <tr>
    <td style="padding-right:10px;padding-left:10px;" valign="top">#REGION_POSITION_02#
    </td>
    </tr>
    <table width="100%">
    <tr><br>
    <td width="25%" style="border-right:2px #000099 solid;padding-left:10px;" valign="top">#REGION_POSITION_03#
    </td>
    <td style="padding-right:10px;padding-left:10px;" valign="top">#REGION_POSITION_04#
    </td>
    <td valign="top" width="100%" style="padding-left:20px;padding-left:20px;">
    #BOX_BODY#</td>
    </tr>
    <tr>
    <td></td>
    <td style="border-style:solid;border-width:thin;border-color:black;padding-right:10px;padding-left:10px;" valign="top">#REGION_POSITION_07#
    </td>
    </tr>
    </table>
    </div>
    #REGION_POSITION_09#
    </td>
    </tr>
    <tr>
    </table>
    Footer:
    #FORM_CLOSE#
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="TabForegroundColor"><tr>
    <td class="TabForegroundColor"><img src="#IMAGE_PREFIX#f_spacer.gif" border="0" height="3" alt="" /></td></tr>
    </table>
    <table width="100%"><tr><td align="right" class="tiny"> #CUSTOMIZE# </td></tr></table>
    Copyright &copy; 2003 <FONT COLOR=#606060><U>Monash University</U></FONT> ABN 12 377 614 012 - <FONT COLOR=#606060><U>Caution</U></FONT> - <FONT COLOR=#606060><U>Privacy</U></FONT> - <FONT COLOR=#606060><U>CRICOS
    Provider Number: 00008C</U></FONT>
    Last updated: 10 August 2004 - Maintained by <FONT COLOR=#606060><U>[email protected]</U></FONT> - <FONT COLOR=#606060><U>Accessibility information</U></FONT>
    </body>
    </html>

    i think the calendar runs through a specific dll file. you may want to search to make sure all the dlls are installed. or re-install the software

  • Date Picker not allowing to capture time

    Hello Friends,
    I am trying to create a tabular form on a table[create SQL as below].
    CREATE TABLE  "JOB_RUN_DETAILS"
       (     "JOB_NAME" VARCHAR2(100),
         "SCH_RUN_DATE" DATE,
         "START_DATE" DATE,
         "END_DATE" DATE,
         "STATUS" VARCHAR2(100),
         "ID" NUMBER NOT NULL ENABLE
    /My idea of the tabular form is to allow entry of time both hours and minutes from the date picker along with date for <b>"START_DATE", "END_DATE" </b> items.
    But I dont see a possibility to do that for hours and minutes. But I remember having seen this in Apex 3.2, not sure if I missed some thing while page making or this feature of Date Picker is left intentionally in the new release.
    Please share any ideas you have.
    Thanks,
    Chaitu.

    My understanding is you are trying to create a Tabular form using the Table which you specified, you are expecting time part to be displayed in the Date Picker column ?.
    The Time part of hours and Minutes will be displayed based on the format mask used for the Application or the item. if the format mask is DD-MM-YYYY HH24:MI then you will see the hour and minute part with the Date Picker.

  • Date picker for af:inputDate   is not picking up the correct input date

    view source:
    <af:inputDate value="#{bindings.DateField.attributeValue}" label="#{bindings.DateField.hints.label}"
    required="#{bindings.DateField.hints.mandatory}"
    valueChangeListener="#{pageFlowScope.CollectApplicantInformation.datesItemChanged}"
    columns="#{bindings.DateField.hints.displayWidth}" shortDesc="#{CustomTooltip[DateField]}"
    autoSubmit="true" helpTopicId="AppDt" id="DateField" simple="true">
    <f:validator binding="#{bindings.DateField.validator}"/>
    *<f:converter converterId="CustomConverter"/>*
    </af:inputDate>
    Here I am not using <af:ConvertDateTime> insted using customConverter, so what code changes do I need to make sure the date picker always picks the already existind date in the inputDate rather picking the current date?
    Here is my CustomConverter.java
    CustomConverter.java
    public class CustomConverter extends DateTimeConverter implements ClientConverter, Converter
    public Object getAsObject(FacesContext context, UIComponent component, String value)
    String dataType = (String) resolveExpression("#{bindings." + component.getId() + ".attributeDef.javaType.name}");
    if (dataType != null && !dataType.equalsIgnoreCase("oracle.jbo.domain.Date") && !dataType.equalsIgnoreCase("oracle.jbo.domain.Timestamp"))
    String test = null;
    if (context == null || component == null)
    throw new NullPointerException();
    if (value != null)
    // To solve DB transaction dirty issue, Check isEmpty and return null.
    if (value.isEmpty())
    return null;
    // the "value" is stored on the value property of the component.
    // The Unified EL allows us to check the type
    ValueExpression expression = component.getValueExpression("value");
    if (expression != null)
    Class<?> expectedType = expression.getType(context.getELContext());
    if (expectedType != null)
    System.out.println("expectedType Value:::" + expectedType.getName());
    // try to convert the value (Object) to the TYPE of the "value" property
    // of the underlying JSF component
    try
    return TypeFactory.getInstance(expectedType, value);
    catch (DataCreationException e)
    String errorMessage;
    if (expectedType.equals(CustomNumber.class))
    errorMessage = "You can enter only Numbers in this field";
    else
    errorMessage = e.getMessage();
    if (errorMessage != null)
    FacesContext ctx = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid Format" , errorMessage);
    ctx.addMessage(component.getClientId(), fm);
    catch (CustomDomainException e)
    int errorCode = e.getErrorMessageCode();
    String[] errorMessage = e.getErrorMessageParams();
    if (errorCode == 7 && errorMessage != null)
    String msg = "Invalid " + errorMessage[0];
    FacesContext ctx = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Application Error: ", msg);
    ctx.addMessage(component.getClientId(), fm);
    catch (JboException e)
    Throwable cause = e.getCause();
    if (cause == null)
    cause = e;
    test = "not good format";
    throw e;
    return null;
    else
    return value != null? value: null;
    public String getAsString(FacesContext context, UIComponent component, Object value)
    return value != null? value.toString(): null;
    public String getClientLibrarySource(FacesContext context)
    return null;
    @Override
    public Collection<String> getClientImportNames()
    return Collections.emptySet();
    @Override
    public String getClientScript(FacesContext context, UIComponent component)
    String formatMask = (String) resolveExpression("#{bindings." + component.getId() + ".format}");
    if (formatMask != null)
    String dataType = (String) resolveExpression("#{bindings." + component.getId() + ".attributeDef.javaType.name}");
    if (dataType.equalsIgnoreCase("oracle.jbo.domain.Date") || dataType.equalsIgnoreCase("oracle.jbo.domain.Timestamp"))
    if (component == null)
    _LOG.severe("The component is null, but it is needed for the client id, so no script written");
    return null;
    // Add a JavaScript Object to store the datefield formats
    // on the client-side. We currently store the format string
    // for each and every field. It'd be more efficient to have
    // an array of formats, then store for each field the
    // index of the format, especially if we could delay outputting
    // these objects to when the <form> closes.
    String clientId = component.getClientId(context);
    if (clientId != null)
    // =-=AEW Only if Javascript...
    Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
    // this fetch could be at the place where we append, but has been
    // moved ahead to optimize use of StringBuilder
    String jsPattern = getJSPattern(context, component);
    String loc = _getLocaleString(context);
    // FIX - figure out size!!!
    // 127 chars for javascript + length of jspattern + locale + 12 chars for
    // tranforming to name in the worst case.
    StringBuilder buff = new StringBuilder(139 + jsPattern.length() + loc.length());
    if (requestMap.get(_PATTERN_WRITTEN_KEY) == null)
    requestMap.put(_PATTERN_WRITTEN_KEY, Boolean.TRUE);
    // only create the _dfs object if it doesn't exist, so we don't
    // wipe out _dfs[xxx] values if we ppr the first date field on a
    // page with multiple date fields.
    buff.append("if(window['_dfs'] == undefined){var _dfs=new Object();}if(window['_dl'] == undefined){var _dl=new Object();}");
    buff.append("_dfs[\"");
    buff.append(clientId);
    buff.append("\"]=");
    buff.append(jsPattern);
    buff.append(";");
    buff.append("_dl[\"");
    buff.append(clientId);
    buff.append("\"]=");
    buff.append(loc);
    buff.append(";");
    return buff.toString();
    else
    LOG.severe("NULLCLINET_ID_NO_SCRIPT_RENDERED");
    return null;
    else
    return null;
    else
    return null;
    private String _getLocaleString(FacesContext context)
    Locale dateTimeConverterLocale = getLocale();
    if (dateTimeConverterLocale != null)
    Locale defaultLocale = RenderingContext.getCurrentInstance().getLocaleContext().getFormattingLocale();
    if (!(dateTimeConverterLocale.equals(defaultLocale)))
    String loc = dateTimeConverterLocale.toString();
    StringBuffer sb = new StringBuffer(2 + loc.length());
    sb.append("'");
    sb.append(loc);
    sb.append("'");
    return (sb.toString());
    return "null";
    @Override
    @Deprecated
    public String getClientConversion(FacesContext context, UIComponent component)
    String formatMask = (String) resolveExpression("#{bindings." + component.getId() + ".format}");
    if (formatMask != null)
    String dataType = (String) resolveExpression("#{bindings." + component.getId() + ".attributeDef.javaType.name}");
    if (dataType.equalsIgnoreCase("oracle.jbo.domain.Date") || dataType.equalsIgnoreCase("oracle.jbo.domain.Timestamp"))
    String jsPattern = getJSPattern(context, component);
    Map<String, String> messages = new HashMap<String, String>();
    if (jsPattern != null)
    Class<?> formatclass = formatMask.getClass();
    System.out.println("FormatClass::" + formatclass);
    System.out.println(" Format Mask : " + formatMask);
    // SimpleDateFormat sdfDestination = new SimpleDateFormat(formatMask);
    String pattern = formatMask; //getPattern();
    if (pattern == null)
    pattern = getSecondaryPattern();
    String key = getViolationMessageKey(pattern);
    Object[] params = new Object[]
    { "{0}", "{1}", "{2}" };
    Object msgPattern = getMessagePattern(context, key, params, component);
    //if hintFormat is null, no custom hint for date, time or both has been specified
    String hintFormat = _getHint();
    FacesMessage msg = null;
    String detailMessage = null;
    if (msgPattern != null)
    msg = MessageFactory.getMessage(context, key, msgPattern, params, component);
    detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
    Locale loc = context.getViewRoot().getLocale();
    SimpleDateFormat formatter = new SimpleDateFormat(pattern, loc);
    java.lang.Object obj = resolveExpression("#{bindings." + component.getId() + ".attributeValue}");
    String databaseDate=null;
    if(obj!=null)
    databaseDate = obj.toString();
    DateFormat df = new SimpleDateFormat(pattern,loc);
    System.out.println("DateComponent input value :::::::::::::::::::::::::"+databaseDate);
    Date today;
    try {
    // System.out.println("Before Conversion::::::::::::"+df.parse(databaseDate).toString());
    if(databaseDate!=null)
    today = df.parse(databaseDate);
    else
    today = new Date();
    System.out.println("After Conversion Date :::::::::::::::::::::::::::::"+today.toString());
    //Date today = new Date();
    String dt = formatter.format(today);
    String exampleString = dt;
    String escapedType = XhtmlLafUtils.escapeJS(getType().toUpperCase());
    StringBuilder outBuffer = new StringBuilder();
    outBuffer.append("new TrDateTimeConverter(");
    outBuffer.append(jsPattern);
    // loc = getLocale();
    if (loc != null)
    outBuffer.append(",'");
    outBuffer.append(loc.toString());
    outBuffer.append("','");
    else
    outBuffer.append(",null,'");
    outBuffer.append(exampleString);
    outBuffer.append("','");
    outBuffer.append(escapedType);
    outBuffer.append("'");
    if (msgPattern != null || hintFormat != null)
    messages.put("detail", detailMessage);
    messages.put("hint", hintFormat);
    outBuffer.append(',');
    // try
    // JsonUtils.writeMap(outBuffer, messages, false);
    // catch (IOException e)
    // outBuffer.append("null");
    outBuffer.append(')'); // 2
    return outBuffer.toString();
    catch(ParseException e)
    System.out.println("Parse Exception :::::::::::::::::::::"+e);
    return null;
    else
    // no pattern-matchable date
    return null;
    else
    return null;
    else
    return null;
    protected String getJSPattern(FacesContext context, UIComponent component)
    String jsPattern = null;
    String datePattern = (String) resolveExpression("#{bindings." + component.getId() + ".format}");
    if (datePattern != null)
    String secondaryPattern = getSecondaryPattern();
    if (datePattern != _NO_JS_PATTERN)
    int length = datePattern.length() * 2 + 2;
    if (secondaryPattern != null)
    length = length + 3 + secondaryPattern.length() * 2;
    StringBuilder outBuffer = new StringBuilder(length);
    jsPattern = _getEscapedPattern(outBuffer, datePattern, secondaryPattern);
    else
    jsPattern = datePattern;
    return jsPattern;
    private static void _escapePattern(StringBuilder buffer, String pattern)
    buffer.append('\'');
    XhtmlUtils.escapeJS(buffer, pattern);
    buffer.append('\'');
    private static String _getEscapedPattern(StringBuilder buffer, String pattern, String secondaryPattern)
    if (secondaryPattern != null)
    buffer.append('[');
    _escapePattern(buffer, pattern);
    if (secondaryPattern != null)
    buffer.append(",'");
    XhtmlUtils.escapeJS(buffer, secondaryPattern);
    buffer.append("']");
    return buffer.toString();
    private String _getHint()
    String type = getType();
    if (type.equals("date"))
    return getHintDate();
    else if (type.equals("both"))
    return getHintBoth();
    else
    return getHintTime();
    public static Object resolveExpression(String pExpression)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = null;
    valueExp = elFactory.createValueExpression(elContext, pExpression, Object.class);
    return valueExp.getValue(elContext);
    private static final String _NO_JS_PATTERN = new String();
    private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(DateTimeConverter.class);
    // RenderingContext key indicating the _dateFormat object
    // has been created
    private static final String _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.DateTimeConverter._PATTERN_WRITTEN";
    *Problem is if any input date componet is displaying other than current date then the date picker is always picking the current date rather existing date*
    Please suggest me where to make changes?
    Edited by: 858782 on Oct 3, 2011 7:43 AM
    Edited by: 858782 on Oct 3, 2011 11:44 PM

    I need custom date foramts to be applied for different inputDates which are not defined in <af:convertDateTime>
    Thanks
    Edited by: 858782 on Oct 13, 2011 4:59 PM

  • How can I get a date picker or wheel to show up in the form to make filling in a form with a lot of

    how can I get a date picker or wheel to show up in the form to make filling in a form with a lot of dates more easy?

    There is no built-in date picker available for forms created in Acrobat. There are some third-party solutions involving JavaScript (either a large collection of fields or a custom dialog) though. Also, text fields with date formatting will use a wheel type date picker on Android/iOS devices with Adobe Reader.

Maybe you are looking for