Validating Dates in JSF using convertDateTime an overriding message format

Have seen a way to validate dates with this kind of code snippet:
         <h:inputText id="departDate"
            value="#{flight.departDate}">
           <f:convertDateTime pattern="dd/MM/yy"/>
         </h:inputText>
         <h:message for="departDate"/>-----
This results in an ugly default error message when things go wrong like so:
j_id_jsp_1447383442_1:departDate: 'a' could not be understood as a date. Example: 28/02/08
Is there a way I can override this by using some sort of message placeholder, so I get a message like:
*"Depart Date 's' is invalid"*
So placeholder message would be *"[0} {1} is invalid"*, where parm *0* would be *"Depart Date"* and parm *1* would be value *"#{flight.departDate}"*.
I know you can resort to a full blown custom converter class, but I was wondering if I could put a message formatted with placeholders directly into the code snippet.
Is this feasible?

After several more iterations of testing, I discovered the problem is actually due to using the trinidad rendering kit. Part of my migration to 1.2 involved experimenting with the use of the trinidad components. I thought I had removed all the trinidad stuff from my application during testing of this date problem, but I discovered that I had left the following in:
web-app library:    trinidad-1.2.10
faces-config.xml entry:
    <default-render-kit-id>
            org.apache.myfaces.trinidad.core
    </default-render-kit-id>once these items were removed, the application worked as expected. So it looks like the problem is with the trinidad rendering kit/library.
Edited by: emprice26 on Aug 11, 2009 6:02 PM

Similar Messages

  • "Valid address necessary to use store credit" ERROR MESSAGE

    I have been unable to complete the rental process.
    I bought Apple TV and was able to connect to my WI-FI, ugrade the firmware, enter my personal settings. Ther problem is that when I select a movie and click to rent it, it connects to iTunes Store and comes back with an error message about "valid address needed to use store credit"
    I checked my .mac account personal and billing settings and everything seems OK. I am not even sure what "store credit" means. I am trying to execute a transaction with a credit card on file...
    Thanks.RS.

    I had the same problem. I tried logging in using my .mac address, thinking that that would work. Is it supposed to work? Doesn't work for me. Not only that, but I can't figure out how to go back and correct it and change it to something else.
    Why would Apple let me buy music and movies using my .mac account, and not rent movies? Or is this pilot error and I'm doing something stupid?
    Suggestions welcome.

  • F:convertDateTime - how to define two valid date formats?

    I have an input field that accepts a date. There are two valid date formats allowed: yyyyMMdd & yyyyMMM
    I am currently doing this ...
    <h:inputText ...>
    <f:convertDateTime pattern="yyyyMMdd" />
    <f:convertDateTime pattern="yyyyMMM" />
    </h:inputText>
    ... but only the second date format is being accepted as valid.
    How can I specify two valid date formats for the input?
    Thanks,
    rh
    Edited by: user13328234 on Oct 27, 2010 12:47 PM

    user13328234 wrote:
    Thanks for the suggestion. I was actually using it for validation, so I implemented a custom validator so I'm good now.
    But, for some reason I expected it to work with two converters specified, and I'm a little disappointed it didn't work.
    Thanks again,
    rhExpecting = assuming. Its getting old and annoying now, but it remains a very bad idea.
    The fact of the matter is that you have a very specific need. There is only one way to tailor to specific needs in a generic API: allow to override default behavior. The other option is to create a bloated API that tries to incorporate so many bells and whistles that it becomes unusable. So in my opinion, JSF is designed exactly the way it is supposed to be in this respect.

  • Changing validity date using BAPI_PROFITCENTER_CHANGE for a profit center.

    Hi Friends
    I need your help to know if we can use BAPI_PROFITCENTER_CHANGE to change the validity period of a profit center.I am using this BAPI in a LSMW program.
    The changes I want to make are something like changing the validity dates from
    1) 01/01/2006 - 12/12/9999 to 01/01/2007 - 12/12/9999
    2) 01/01/2006 - 12/12/9999 to 01/01/2005 - 12/12/9999
    3) 01/01/2006 - 12/12/9999 to 01/01/2006 - 12/12/2010
    or should I use BAPI_PROFITCENTER_CREATE?
    -Thanks
         Mitesh

    change document in profit center change
    Bapi - BAPI_ASSET_ACQUISITION_POST
    need a function module for profit center
    Please give me reward points...

  • SNP heuristics and optimiser using transport lane validity dates

    I am using APO SNP 5.1.
    In particular I am trying to use the SNP heuristics and optimiser for supply planning.
    Can anyone confirm whether transport lane validity dates are respected by (a) SNP heuristics and (b) SNP optimiser, ie no transport requisitions will be created during times when the transport lane is not 'open' in terms of validity dates.
    Thanks for any advice on this...

    Hi,
    Irrespective of the SNP planning engine you are using, a t-lane will only be considered if the t-lane is active as per the validity dates.
    Regards,
    Umesh

  • Regarding validating data using excel add-in

    hi
    i am new to essbase, please any help me regarding the steps to be followed for
    validating data that is loaded in to a cube using excel add-in

    There are no standard steps.
    If you wish to just cross check the data which has been loaded in cube ,then Identify the level 0 combination of members in data source from where cube is picking up data (Oracle,flat file ..etc) and retrieve the same combination through excel addin and compare the data.
    hope this will help !

  • Date Validation (yyyy/MM/dd) Using Regular Expression

    Hi Friends,
    I want to validate date entered by user in yyyy/MM/dd format and for this I want to use Regular Expressions only. Also is there any tool that can be used to generate Regular Expression (for Win2000, Win NT)?
    Regards,
    Himanshu Rathore

    try this
    public class Test
         public static void main(String [] args)
              String regex = "\\d{4}/[01]\\d/[0-3]\\d";
              System.out.println("2003/12/11".matches(regex));
              System.out.println("2djd/kj3".matches(regex));
              System.out.println("22/12/12".matches(regex));
              System.out.println("2003/23/05".matches(regex));
              System.out.println("1999/12/51".matches(regex));
              System.out.println("2007/05/07".matches(regex));
    }i'm not able to try on it because i only have jdk1.3.1 installed on my computer and these codes
    required j2sdk1.4

  • Struts: validating date failed

    Hello! I have a problem with validating dates:
    This is how the field is defined in the validation.xml :
    <field property="onhire" depends="required,date">
    <arg0 key="new.form.prompt.onhire"/>
    <var>
    <var-name>datePatternStrict</var-name>
    <var-value>yyyy-mm-dd HH:mm</var-value>
    </var>
    </field>
    It handles uncorrect days, f.ex if you try to write 2004-06-32...
    But it doesn't handle uncorrect months..., f.ex if you write 2004-13-01, it is accepted and
    changed to 2005-01-01... ?! Does anyone have any solution to this. I don't use javascript...
    Thanks!!

    This is a JSF forum, you'd better try a Struts mailing list
    http://jakarta.apache.org/site/mail2.html#Struts
    or check the archive here http://www.mail-archive.com/[email protected]/
    Frederic

  • Error messege- Please enter a valid date in Background Job

    Hi all,
    background job which is scheduled in sm37 is giving error for dated 01.01.2009 to 30.01.2009.
    But before 31.12.2008 it was working fine
    error messege-
    This is happening in Production and developement client.
    While running the report it showing the error messege- Please enter a valid date
    One function module is used in the report for geting fiscal year from date.
    it is showing the following error messege for perticular date range- 01.01.2009 to 30.01.2009.
    GM_GET_FISCAL_YEAR
    Error
    Fiscal year variant V3 not defined or maintained for date 01.01.2009
    Thanks
    Susanta

    Hi,
    Did you put the date fields to be dynamic in your variant? i.e if in your variant you specified date range of last year, this will not work for this year and eventually give you an error message that the date is not valid...
    Dev.

  • Error messege in Background Job(SM37) -  Please enter a valid date

    Hi all,
    background job which is scheduled in sm37 is giving error for dated 01.01.2009 to 30.01.2009.
    But before 31.12.2008 it was working fine
    error messege-
    This is happening in Production and developement  client.
    While running the report it showing the error messege- Please enter a valid date
    One function module is used in the report for geting fiscal year from date.
    it is showing the following error messege for perticular date range- 01.01.2009 to 30.01.2009.
    GM_GET_FISCAL_YEAR
    Error
    Fiscal year variant V3 not defined or maintained for date 01.01.2009
    Thanks
    Susanta

    Hi,Because this datein the past

  • BOM Valid Date

    Hi,
    While creating BOM due to some human error we took wrong valid date.Now i want to change it.
    Please suggest me the T-code or any customization to change the same.
    "I am online"

    Dear Pawar
    This are the basic IMG settings in order to used the engineering change management
    features.
    x refers to a tick.
    First setup the control data in OS54.
    Revision sections
    Fields :-
    Revision level active            x
    Ext. revision level              x
    Higher revision level            x
    Object Management Record sections
    Fields :-
    Object maintenance               x
    Assign alternative date          x
    Overide value/assignment date sections
    Fields :-
    Only with leading change mst.    x
    Setting the Revision level active is to activate the engineering change management for
    material master.  If you do not want the engineering change management for materials,
    remove the tick.
    With a tick in "Higher revision level", the new revision level has to be always higher
    than the old revision.
    Secondly, setup the external number range in OS53.
    If you use the internal number range, then remove the external number range.
    Third, define the status for the change master records in transaction SM30 - V_T419S.
    Change No.     Chg        Date Chg     Dist. Lock      Description
    Status         Poss
      1             x            x             ' '         Active
      2            ' '          ' '            ' '         Inactive
      3            ' '          ' '             x          Locked
    Fourth, define modification parameters for the BOM in OS27.
    Fields :-
    BOM Validty Maint.               x
    EC Management Active             x
    History Requirement             ' '
    Unit Piece                      PC
    The rest of the fields are blank.
    If the History Requirement is tick, every time during creation of the BOM, SAP will
    prompt your for an ECN number as is compulsory.
    Lastly, define fields selection for routing in OP5A.
    PP task lists: initial screen -> Change number -> Transaction code -> Tick Req.
    Setting the Transaction code fields Required indicate that you have make the ECN number ........
    Hope this will help you one of our friends gave me this
    Pavan

  • Error While Inserting Data into table using OAF

    Hi Experts,
    I am learning OAF; i am trying into insert the data into table using OAF. I followed the below procedure.
    My table(OLF_TEST_TBL) Columns:
    EmpID (Number), Ename(VARCHAR2 100), Sal Number, and who columns.
    1. created Application Module (AM).
    package: oracle.apps.mfg.simplepg.server
    name: oaf_test_tbl_am
    2. created simple page
    name:EmployeePG
    package:oracle.apps.mfg.simplepg.webui
    3. Assigned the Application Module to Page
    4. Created Entity Object(EO)
    name:oaf_test_tbl_eo
    package:oracle.apps.mfg.simplepg.schema.server
    schema:apps
    table:OLF_TEST_TBL
    note:
    1. EMPID column is selected as primary key
    2. selected create method, remove method and validation method.
    3.checked generate default view object
    VO:
    name:olf_test_tbl_vo
    note: Entity Object was assigned to VO
    Coming To page:
    page main region:EmployeeMainRN
    1.under main region i created one more region using wizard
    selected AM and VO, region style-default single column
    2. under main region i created one more region
    region style- pagebuttonbar, ID:pagebutoonsRN
    3. under pagebuttonRN, created two submit buttons(ID:SUBMIT, ID:CANCEL).
    In AM java page:
    created a method to insert row and for commit.
    Insert Method:
    public void insertrow(){
    OAViewObject vo=(OAViewObject)getoaf_test_tbl_vo1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    Row row=vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Commit Method:
    public void savaDataTooaftesttable(){
    getDBTransaction().commit();
    In EmployeeMainRN, created a controller.
    In this controller process request method, 'insertrow' method was called.
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("insertrow");
    To commit the transaction when SUBMIT button pressed, commit method was called in process form request method.
    import oracle.apps.fnd.framework.OAViewObject;
    public void processformRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("SUBMIT") != null)
    am.invokemethod("savaDataTooaftesttable");
    Error After clicking the submit button_
    I ran the page, page was opened successfully. Once i enter data and click submit button, it's giving the following error.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object oaf_test_tbl_am.oaf_test_tbl_vo1700_oaf_test_tbl_vo1_practice_test_prc1_oracle_apps_mfg_simplepg_server_oaf_test_tbl_am.oaf_test_tbl_vo1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Experts, Kindly help me why i am getting this error.
    Awating your replies.
    Thanks in advance.

    If you dont want to create message. You can throw exception like below as well
              throw new OAException("Emp Id is "+empId+" and employee name is "+empName, OAException.CONFIRMATION);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Regd : How to find Validity date for a user in central user system

    Hi Experts;
    I want to get the list of users with profile SAP_ALL  with following details like validity ,user type ,user name ,user id..
    I can get through SUIM for each individual systems.Its very difficult to login to each system ,generate the report.So I prefered to go for Central system
    But if I use central user system I have no option to find validity and user type for the system ( SUIM - > Cross system application )
    I have also tried to the table USRO2 ( which gives only the list of users in the central system )
    So is there any possible ways to find the Users with profile SAP _ALL with validity date in the central user system. So that I can easily generate it as one report instead of logging to each and every system
    Regards
    Sanjeev.S

    Hi Ruchit
    Thanks for your reply. I want to find the validity date of all users having SAP_ALL
    profile of all child system connected through central user system .So it is possible
    to do that in Centrals System by executing the report?
    If I execute that report in Central user system will it give the details of all child
    system connected to central system
    I think it will give only the result of Central system and not the child system connected to Central system.Please clarify me.
    I can execute the report by logging to each child system ,but it takes very long hours for me since there are many system in my landscape.
    Awaiting for your reply.'
    Thanks
    Sanjeev.S

  • IPhoto says it cannot import my photos b/c they may be an unrecognized file or the file may not contain valid data. The operation could not be completed. Error code is: ImageCaptureCoreError-9905.

    Unable to download photos from my camera. iPhoto returns an error message that states: The following files could not be imported (they may be an unrecognized file or the files may not contain valid data). FILE NAME: 100_0490.JPG      REASON: com.apple.ImageCaptureCoreError- 9905.  WHAT'S UP WITH THAT?  Did not have a problem importing photos under the LEOPARD OS, however, now that I have upgraded to Yosemite 10.10.3 the iPHOTO app is not performing the imports.

    Are you using Photos, or iPhoto? Maybe you've got a corrupt file on your camera. I would try using the image capture application to import the bad picture to my desktop. If it works and the picture looks ok,  then delete that pic from the camera, then try to import into iphoto again. You can then import the pic it was saying was bad from your desktop.
    Or, try downloading all the pics using image capture and then import from the download folder.

  • WebPart is raising the following error "Invalid data has been used to update the list item.The field you are trying to update may be read only"

    I have created a farm solution and then i deploy it to SharePoint server, the code looks as follow, and i use it to update a page info values (as the current page values represents old info):-
    [ToolboxItemAttribute(false)]
    public partial class VisualWebPart1 : WebPart
    // Uncomment the following SecurityPermission attribute only when doing Performance Profiling using
    // the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
    // for production. Because the SecurityPermission attribute bypasses the security check for callers of
    // your constructor, it's not recommended for production purposes.
    // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
    public VisualWebPart1()
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    InitializeControl();
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["Pages"];
    web.AllowUnsafeUpdates = true;
    foreach (SPListItem items in list.Items)
    items["Author"] = "SharePoint";
    items["Created"] = "01/08/2014 01:44 PM";
    items.Update();
    list.Update();
    web.AllowUnsafeUpdates = false;
    protected void Page_Load(object sender, EventArgs e)
    but when i try adding this web part to a page i got the following error:-
    Invalid data has been used to update the list item.The field you are trying to update may be read only
    so can anyone advice?

    i only changed lines bitween 
    web.AllowUnsafeUpdates = true;
    and
    web.AllowUnsafeUpdates = false;
    and other parts of code remains without change
    so it will updates all pages in current web
    yaşamak bir eylemdir

Maybe you are looking for

  • How can I switch my cloud membership to a different country?

    Hello, I started my cloud memebership in June 2012 in the UK (1 year contract) and moved now to Germany. Unfortunately I can't change the country infomation under "My Adobe". Is there any other solution than cancelling my membership (which means I ha

  • Ignore blank lines in text file using number format exception.

    hi.. does anyone know how to ignore a blank line and move on to the next line? the text file contains: 2 bla bla bla 112.4 222.5 ble ble vle 115.5 123.2

  • Only one website will not load.

    There is one specific website that will not load for me. It will not load on IE, Chrome or Firefox. But it works on any browser on my phone or on my families laptops. The website loads a blank white screen and when I view the source code there is not

  • Starting coherence server with a ProxyService - How to add multiple members

    Hi, I wonder how can we add multiple coherence instacnes to a same cluster when using the ProxyService. I have the following in the configuration file . If we want to start another member to the cluster it fails as the port is already bound. <proxy-s

  • Developer 6i Forms/Reports for AIX-Based 5L

    Hi, Where can I find the download link for Developer 6i Forms/Reports for AIX-Based 5L (64-bit) from Oracle website?? I can only find Developer 6i for Linux/Solaris/Windows.. Thanks, Kelvin