ADF BC - Date Picker closes Popup

Hi all,
I have a inputDate field inside of a form which is in a popup. When i choose a date from the date picker that comes up, (the one built in to the inputDate field) my popup closes. Is there a way to keep the popup open until a user clicks back on the main page, or clicks the commit button (commit button is inside the form, inside the popup)
Thanks,
Dan

Try to place a panelDialog or panelWindow inside your pop up and have the Form inside it.
http://jdevadf.oracle.com/adf-richclient-demo/faces/components/panelWindow.jspx

Similar Messages

  • Opening Date Picker in popup window

    Hi All,
    I'd like to be able to use a Date Picker in a custom popup window that I've developed. When I open the date picker however, because I'm already in a popup window the date picker fills the whole of the custom popup, rather than opening in its own window.
    Is there a way to force the date picker into using a new window?
    Thanks,
    Mike

    Hi Mike;
    Thanks for the responce. My Tabular (Popup) form is wizard generated. This is the code I use to call the Popup:
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    </script>
    <script language="JavaScript" type="text/javascript">
    function callACNEPopup (formItem1) {
    var formVal1 = document.getElementById(formItem1).value;
    var url;
    url = 'f?p=&APP_ID.:60:&FLOW_SESSION.::::P60_ACAC_UID:' + formVal1;
    wACNE = open(url,"winLov","Scrollbars=1,resizable=1,width=675,height=300");
    if (wACNE.opener == null)
    wACNE.opener = self;
    wACNE.focus();
    </script>
    The Calendar is simply a date picker.

  • How can I customize the date-picker inline popup

    Hi All,
    I have a customer who want to customize the <af:inputDate>. He want a additional button appear under the calendar box in the date-picker popup.
    Document http://docs.oracle.com/cd/E23549_01/apirefs.1111/e12419/tagdoc/af_inputDate.html mentions org.apache.myfaces.trinidad.convert.ClientConverter interface, is it a right way to do that ? If yes where can I get a sample ?
    Regards and Thanks.
    Jerry

    Hi,
    add the af:convertDateTime tag to see the exploded dialog. Note that this doesn't allow you to add custom buttons to the dialog. Its just extends the functionality
    http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12419/tagdoc/af_convertDateTime.html
    <af:inputDate label="Label 1" id="id1">
    <af:convertDateTime type="both"/>
    </af:inputDate>
    Frank

  • Date Picker ADF Faces

    I have a selectinputdate on my jsp page. When I run my app in OC4J Standalone 10.1.3 and select the calendar image for the date picker, a popup opens with the following error: 500 Internal Server Error
    java.lang.IllegalStateException: AdfFacesContext was already released or had never been attached.
    Any idea what is wrong with my application?

    I do not have the ability to post my jsp page. (If you really need it, I can type it in my next post). I am developing in Eclipse and JDev 10.1.3.0.4 that is why I am running the application using the Standalone OC4J server and not the embedded OC4J. Is there a specific library that I am missing to get the date picker to work?
    Thanks for any help.

  • JSF/ Javascript Date Picker

    Has anyone incorporated a javascript date picker with JSF? if so how did you handle the fact that the inputText for jsf doesn't have a name and is in the form of <h:inputText>? Any help would be appreciated, Thanks.

    Did you look at the ADF Faces Date picker as an option?
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/chooseDate.html
    or
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/selectInputDate.html

  • After upgrade to 3.1.2, date pickers and popup lovs mess up the form layout

    Now there are new table tags around every single date picker / popup LOV item and its' list icon which forces other items on the same line to the next one instead. Bad Oracle, bad!
    Any workarounds?

    Hello,
    >> Now there are new table tags around every single date picker / popup LOV item and its' list icon which forces other items on the same line to the next one instead.
    APEX 3.1 introduced the use of the &lt;fieldset> tag, for wrapping compound items, like the date picker or popup LOV items. In the following, you can learn more about it, including some workarounds:
    FIELDSET – new layout behavior in 3.1.1
    >> Bad Oracle, bad!
    For the very short term, and especially for upgraded applications, you might be correct; however, for the long run, this is a good move, because it creates uniformity in the ways we can handle all the APEX built-in item types.
    Regards,
    Arie.

  • Data Picker popup position

    How can I control the position where the date picker popup window appears? It would be nice if it could appear close to the calendar icon on the item which launches it.
    Thanks

    Vikas,
    The date picker popup has no attributes that would allow you to position the popup window on your screen.
    Regards,
    Marc

  • ADF Swing 11g - How to bind date picker

    Hello,
    My Swing application needs to use date picker control, and I decided to use JCalendar from www.toedter.com.
    Is there any example on binding such Swing component? Or are there other date picker control that can easily integrate into JDev and ADF for that matter?
    Thanks
    Regards,
    Rudi

    Mmm well i don't know if this can help you
    I am using a date picker too, this is the code where I use it
    <af:selectInputDate label="#{bundle[\'newPatient.birthday\']}"
                                          required="true"
                                          requiredMessageDetail="#{bundle[\'newPatient.validate.birthday\']}"
                                          binding="#{PatientCreateBean.birthday}"/>My binding property is PatientCreateBean.birthday
    and birthday is type CoreSelectInputDate
    I got info about the different elements to use in ADF from the following link
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/imageIndex.html
    I hope this can help you

  • Date picker in a popup window

    Hi all,
    There are 2 pages, page 1 contains a button, when user click on it, a new window will popup showing page 2 which is a entry form has a date picker item.
    The javascript behind the button in page 1 is like: (in target URL field.)
    javascript:popupURL('f?p=101:2:&SESSION.');
    It works fine except the date picker window wouldn't popup again in the second page. If I run the 2nd page individually it works well, it doesn't work only if I run it in a popup window.
    Is this a bug or something? How can we fix it.
    Many thanks!
    Pete

    Hello Pete,
    >> It works fine except the date picker window wouldn't popup again in the second page. If I run the 2nd page individually it works well, it doesn't work only if I run it in a popup window.
    You are using the ‘popupURL’ function, which uses a hard coded value – WinLov – for the ‘name’ parameter. That could be a problem in a recursive call.
    Patrick solution is of course valid, but if you want to use a popup window format, try using the ‘popUp2’ function. The function generates a “random” name, so the problem should be solved.
    Regards,
    Arie.

  • Adf uix, removing date picker

    I am working (with jdev 10.1.2) to an adf uix project. In some messagedatefield the date picker is not useful, and I don’t want the user to try to use it. How can I remove it?
    Thanks in advance, Mauro

    You can use the messageTextInput with a onSubmitValidator
    <onSubmitValidater>
    <date dateStyle="short"/>
    </onSubmitValidater>
    This will validate that the input is of the short date format.
    Jeanne

  • Close popup in adf

    Hi,
    I am using Jdeveloper 11.1.1.4 and ADF-BC in my project.
    In one of my modules,I open a taskflow as a popup.
    Popup has two buttons Ok and Cancel. On click of cancel,I want to show an adf message and then close the popup.
    On click of Ok,I directly close the task flow popup.
    But on cancel,I need to show a message and then only close.[Wait until user clicks on 'Ok' in adf message which is invoked on cancel]
    How to achieve this...
    Please advice..
    Regards,
    Praveen

    Hi
    set autoCancel to disabled for popup
    http://docs.oracle.com/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_popup.html

  • How to insert a date picker input text field in a JSF Jsp page

    Hi,
    I have to develop an application using generic facets, unfortunately I am not supposed to use ADF Faces components given by Oracle.
    Now my requirement is, on JSP page an input text field which holds a DATE value is required, it should also have a Date Picker Calendar adjacent to it.
    Could you pls shed some light on this issue and help me out.
    Thanks
    ~Siva(ji)

    <HTML>
    <script language="JavaScript" type="text/javascript">
    <!--
    var pUpWidthc = 300; //Change the pUpWidthc to your requirements.
    var scrAvailc = 400;     //Change to your available screen width. You see in
    //this eBooks' middle frame, the frame width is
                                                                //equal to 410 . So whether your using frames or
                                                                //or a full 800 pixel screen, you must calculate
                                                                //your available screen width.
    var PopUpC = document.getElementById("pUpc");
    document.write('<div id="pUpc" style="visibility:hidden;z-index:4;width:'+pUpWidthc+';position:absolute;"></div>');
    function cstmPup(objC,c){
    popUpC = document.getElementById("pUpc");
    popUpC.innerHTML = c.innerHTML
    popUpC.style.left = getPos(objC,"Left");
    var scrNeedc = getPos(objC,"Left") + pUpWidthc;
    if (scrNeedc > scrAvailc){
    //The number 10 below is an extra offset x value applied when the
    //definitional popup box positions beyond your screen width. You
    //can change this number to fine tune your "beyond screenwidth" positioning.
    var scrOffsetC = getPos(objC,"Left") + pUpWidthc - (scrAvailc);
    popUpC.style.left = getPos(objC,"Left") - (scrOffsetC - 0);
    popUpC.style.top = getPos(objC,"Top") + objC.offsetHeight;
    popUpC.style.visibility = 'visible';
    fill();
    function fill()
         var noOfRows=7,noOfCols=7,i=0,j=0,day=1,x;
    var d1=FirstDayOfWeek(7,2008);
    //40     
         for(i=1;i<noOfRows;i++)
              x=document.getElementById('myTable').insertRow(i);
              for(j=0;j<noOfCols;j++)
                   var y=x.insertCell(j);
                   if( ( i==1 && j<d1))
                   y.innerHTML="";
                   else if(day<=DaysInMonth(7,2008)){
                   y.innerHTML=day;
                   day++;
    //document.write(FirstDayOfWeek(7,2008));
    function FirstDayOfWeek(m,y)
    var i;
    var dow = 6;
    //document.write("Hello");
    for (i=1583; i<y; i++)
    dow += (LeapYear(i)) ? 2 : 1;
    for (i=1; i<m; i++)
    dow += DaysInMonth(i,y);
    return dow % 7;
    function DaysInMonth(m,y)
    // m is the month number (1,2,3,...12), y is the year number (four digits)
    switch (m)
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12: return 31;
    case 2: if (LeapYear(y))
    return 29;
    else
    return 28;
    default: return 30;
    function LeapYear(y)
    return (y % 4==0) && ((y % 100!=0) || (y % 400==0));
    function getPos(objC,sPos){
    var iPos = 0;
    while (objC != null) {
    iPos += objC["offset" + sPos];
    objC = objC.offsetParent;}
    return iPos;
    function hPopUpc(){
    popUpC = document.getElementById("pUpc");
    popUpC.style.visibility = 'hidden';
    //-->
    </script>
    <BODY
    <button id="c1" onclick="cstmPup(c1,pUpCstm)">Custom PopUp</button>
    <'div' id="pUpCstm" style="display:none;">
    <'div' id="myid" align="left" style=" width:100%; height:100%; background:#cccccb; border:1px solid black; border-top:1px solid white; border-left:1px solid white; padding:10px; font:normal 10pt tahoma; padding-left:18px "> <b>Rich Message Boxes</b>
    <hr size="1" style="border:1px solid black;">
         <div style="width:220px; font-family:tahoma; font-size:80%; line-height:1.5em"><br>
              <table border ="1" id="myTable">
                   <TR>
                        <TD> SUN </TD>
                        <TD> MON </TD>
                        <TD> TUE </TD>
                        <TD> WED </TD>
                        <TD> THU </TD>
                        <TD> FRI </TD>
                        <TD> SAT </TD>
                   </TR>
              </table>
         <br><br>
         </div>
         <br>
         <div>
    <button tabindex="-1" onclick="hPopUpc()" style="border:1px solid black; border-left:1px solid white; border-top:1px solid white; background:#cccccc ">Close Message</button>
    </div>
    <?BODY
    </HTML>
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri

  • Close Popup on clicking OK button of Information Message Dialog

    JDev 11.1.1.5.0 ADF BC
    I have a popup and a dialog inside it where user inputs some data and clicks Save button.
    I am showing an Information message on click of Save on successful insertion of data into the database.
    What I am looking to achieve is that I want to close the popup window on click of the OK button which is inside the information message dialog that is been shown on successful Saving of data.
    There is already a similar thread Close popup in adf but that doesn't have a correct answer.

    1) Bind the main popup to a bean variable:
    <af:popup id="mainPopup" binding="#{MyBean.myPopup}" ...>
    public class MyBean
      private RichPopup myPopup;
    }2) Add a DialogListener to the <af:dialog> of the information message:
    <af:popup id="infoPopup">
      <af:dialog dialogListener="#{MyBean.infoPopupDialogListener}">
        ... Info message here ...
      </af:dialog>
    </af:popup>3) Use this DialogListener to close the main popup programatically:
      public void infoPopupDialogListener(DialogEvent dialogEvent) {
        myPopup.hide();
    }Dimitar

  • 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

  • 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

Maybe you are looking for

  • Counter doesn't work on iPod Touch

    I have this issue with my iPod Touch (January 08 Upgrade): My iPod doesn't recognize and count when I listen to something. e.g. I have an audiobook, with 40 tracks. After I listened to each and everyone of them (up to the end), and connecting the iPo

  • Suppress Pages in Report 2.0

    Is there a way to suppress pages that have no data, in Reports 2.0.1Example, There is an HR department in New York but not one in Houston, yet reports prints out a blank page for Houston HR (when you page-break on department). The Outline is setup in

  • Linear Least-Squares Fit

    Im farely new to programming and I got stuck with a linear least-squares fit problem. I am supposed to develop a method that will calculate slope and intercept of the least-squares line that best fits an input data set. Ive been trying to figure out

  • Screen green on video

    I can't watch anything on my laptop. The screen is green i can hear it but can,t see it on netflix, you tube etc anyhing with video  

  • Is this the yellow tint people are talking about? What would you do?

    I searched the forums and saw a lot of posts, but no images of the iPhone 4 screen. I looked online and saw some photos, but mostly they were of splotches, spots, or lines. No "full screen" tinting. I recently (Sunday at noon) upgraded to an iPhone 4