Cutom Error Messages - Subtituting values

Hi All,
Im new to JSF, and finding problems substituting values, when customizing the error messages.
My input text item is defined as
<h:outputText value="My Number:"/>
<h:inputText id="ucasNumber" value="#{start.myNumber}"
required="true"
validator="#{start.validatemyNumber}">
<f:validateLength maximum="9" minimum="9"/>
<f:attribute name="fieldRef" value="My Number" />
<f:attribute name="custMsg" value="Please enter My number " />
</h:inputText>
I have redefined the standard error for the minimum length within the .properties file as
javax.faces.validator.LengthValidator.MINIMUM_detail=VALUE_MIN_LENGTH
VALUE_MIN_LENGTH_MSG_detail = Minimum length for ''{0}'' is ''{1}''.
And this is from the Phase listner...
UIComponent c = root.findComponent(clientId);
String fieldRef = (String) c.getAttributes().get("fieldRef");
if (fieldRef != null) {
Iterator j = fc.getMessages(clientId);
while (j.hasNext()) {
else if ("VALUE_MIN_LENGTH".equalsIgnoreCase(detail)) {
String custMsgPattern = rb.getString("VALUE_MIN_LENGTH_MSG_detail");
Object[] params = new Object[2];
params[0] = fieldRef;
// params[1] = "7";
String custMsg =MessageFormat.format(custMsgPattern, params);
fm.setSummary(custMsg);
fm.setDetail(custMsg);
When I hard code a value (ie param[1]="7") it is fine...and the vvalue is substituted correctly and I obtain the correct message.
What I like to know, is how I would obtain the minimum value from the item that causes the error - in this case '9'.
Thank in advance
AB

That looks really similar to this tutorial:
http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk7.html
Try walking through it and see if you can catch your problem. Then again, maybe you already have and that's where you got the idea originally. If that's the case, I probably can't help you beyond that as I went a different root when customizing my error messages.
I also just posted this in another thread. Probably more useful to Bret, but you may want to look at it anyways.
http://forum.java.sun.com/thread.jspa?threadID=666143&tstart=0
CowKing

Similar Messages

  • I am trying to export the combained PDF based on BOOK opetion using below scripts. but i am getting following error message "Invalid value for parameter 'to' of method 'exportFile'. Expected File, but received 1952403524". anyone knows, please suggest me

    Dear ALL,
    i am trying to export the combained PDF based on BOOK opetion using below scripts. but i am getting following error message "Invalid value for parameter 'to' of method 'exportFile'. Expected File, but received 1952403524". anyone knows, please suggest me solutions.
    var myBookFileName ,myBookFileName_temp;
                    if ( myFolder != null )
                            var myFiles = [];
                            var myAllFilesList = myFolder.getFiles("*.indd");    
                            for (var f = 0; f < myAllFilesList.length; f++)
                                        var myFile = myAllFilesList[f]; 
                                        myFiles.push(myFile);
                            if ( myFiles.length > 0 )
                                        myBookFileName = myFolder + "/"+ myFolder.name + ".indb";
                                        myBookFileName_temp=myFolder.name ;
                                        myBookFile = new File( myBookFileName );
                                        myBook = app.books.add( myBookFile );  
                                       myBook.automaticPagination = false;
                                        for ( i=0; i < myFiles.length; i++ )
                                                   myBook.bookContents.add( myFiles[i] );             
                                        var pdfFile =File(File(myFolder).fsName + "\\"+myBookFileName_temp+"_WEB.pdf");
                                        var bookComps = myBook.bookContents;
                                        if (bookComps.length === 1)
                                                       bookComps = [bookComps];
                                         var myPDFExportPreset = app.pdfExportPresets.item("AER6");
                                        app.activeBook.exportFile(ExportFormat.PDF_TYPE,File("D:\\AER\\WEBPDF.pdf"),false,myPDFEx portPreset,bookComps);
                                      //myBook.exportFile (ExportFormat.pdfType, pdfFile, false);
                                      //myBook.exportFile(pdfFile, false, pdfPref, bookComps);
                                        myBook.close(SaveOptions.yes);      

    Change the below line:
    app.activeBook.exportFile(ExportFormat.PDF_TYPE,File("D:\\AER\\WEBPDF.pdf"),false,myPDFExp ortPreset,bookComps);
    to
    app.activeBook.exportFile(ExportFormat.PDF_TYPE,File("D:\\AER\\WEBPDF.pdf"),false,myPDFExp ortPreset);
    Vandy

  • Error Message : " No value could be determined for Customer Exit Variable "

    Hello BI Experts ,
    I have created a "ZYTD_PERIOD" Customer Exit Variable  Interval  Mandatory and ready for input check mark removed.
    The reference character is '0FISCPER' .
    I want to have YTD figures when the user enter single Fiscal Year Period for variable 0P_FPER.
    So I have written below code in SE37 : EXIT_SAPLRRS0_001 and include program : ZXRSRU01
    ==================================================================
      case i_vnam.
                  WHEN 'ZYTD_PERIOD'.
                  IF I_STEP = 2.
                  LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = '0P_FPER'.
                  CLEAR L_S_RANGE.
                  L_S_RANGE-LOW0(4) = LOC_VAR_RANGE-LOW0(4).
                  L_S_RANGE-LOW+4(3) = '001'.
                  L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
                  L_S_RANGE-SIGN = 'I'.
                  L_S_RANGE-OPT = 'BT'.
                  APPEND L_S_RANGE TO E_T_RANGE.
                  EXIT.
                  ENDLOOP.
                  ENDIF.
    ===================================================================
    After that I use this 'ZYTD_PERIOD' variable in the query .
    Also I have used the variable 0P_FPER in another structure.
    When I execute the query by entering the value of 0P_FPER as 010.2009 or any other value ,
    I am getting below error message ,
    *No value could be determined for variable ZYTDPERIOD*_
    Below is details of this Error message ,
    Note that I have proper Master and Text data for 0CO_AREA and 0COMP_CODE loaded into BI.
    =======================================================================
    Diagnosis
    This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
    Termination message BRAIN 632 appears:
    Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
    System Response
    1. Operation method of SAP-Exit-Variables 0P_FVAEX or 0P_CTPCA
    With queries from the CO application, both SAP-Exit-Variables look for an entry for 'controlling area'. With this controlling area from the selection screen, the SAP-Exit-Variables program reads the attributes for InfoObject 0CO_AREA (controlling area).
    With queries from the FI application, the SAP Exit Variable 0P_FVAEX looks for an entry for 'company code'. With this company code from the selection screen, the SAP Exit Variables program reads the attributes for InfoObject 0COMP_CODE (Company Code).
    0P_FVAEX determines the fiscal year variant (attribute 0FISCVARNT) from the attributes for 0CO_AREA (CO queries) or 0COMP_CODE (FI queries). 0P_CTPCA determines the currency type of the profit center local currency (attribute 0CURTP_PCA) from the attributes for 0CO_AREA.
    2. Cause of Error
    The attributes for the controlling area (InfoObject 0CO_AREA) or company code (InfoObject 0COMP_CODE) were not loaded into the BW system, or the attributes for the controlling area are not active in the BW system.
    Check whether this is the cause of the error in your BW system. Display the contents of table /bi0/mco_area or /bi0/mcomp_code using transaction se16.
    Application CO:
    Check whether the attributes 'fiscal year variant' (field FISCVARNT) and 'profit center local currency currency type' (field CURTP_PCA) are filled in the 'A' version (field OBJVERS) for the selected controlling area. If the fiscal year variant in the OBJVERS = 'A' is empty, then the error is with variable 0P_FVAEX. If the currency type of the profit center's local currency in OBJVERS = 'A' is empty, then the error is with variable 0P_CTPCA.
    Application FI:
    Check whether or not the attribute 'fiscal year variant' (field FISCVARNT) is filled in the 'A' version (field OBJVERS) for the selected controlling area. If the fiscal year variant is empty in OBJVERS= 'A', then the error is with variable 0P_FVAEX.
    Procedure
    Using InfoSource 0CO_AREA, load the attributes for the controlling area or company code into your BW system.
    Afterwards, activate the attribute changes in your BW system. To do this, use transaction rsa1, path 'Tools > Hierarchy/Attribute changes', functions button 'InfoObject list'. Choose InfoObject 0CO_AREA or 0COMP_CODE from this list, and activate the attribute changes.
    =====================================================================================
    Is there any special settings needed before writing BEx Customer Exit ?
    I have already created a project in CMOD and assinged a proper RSR00001
    and EXIT_SAPLRRS0_001 and project is active.
    Any help please ....
    Regards ,
    Amol

    My Code is as below ,
              case i_vnam.
                  WHEN 'ZYTD_PERIOD'.
                  IF I_STEP = 2.
                  LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = '0P_FPER'.
                  CLEAR L_S_RANGE.
                  L_S_RANGE-LOW0(4) = LOC_VAR_RANGE-LOW0(4).
                  L_S_RANGE-LOW+4(3) = '001'.
                  L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
                  L_S_RANGE-SIGN = 'I'.
                  L_S_RANGE-OPT = 'BT'.
                  APPEND L_S_RANGE TO E_T_RANGE.
                  EXIT.
                  ENDLOOP.
                  ENDIF.
                  ENDCASE.

  • Error Message F6804 Value Blank/Space invalid for account assignment elemen

    Dear Experts,
    We have a problem in Travel Management,
    I have created a trip for paid by company expenses only and entered cost distribution (fund, funds center and WBS) in the trip.
    When I transfer a trip to FI through transaction PRRW throughing error message "F6804 Value Blank/Space invalid for account assignment element for fund and FI313 No funds center entered/ derived in Item".
    The paid by com. expenses receipts of wage types credited with - positive amount in 2nd symbolic account offsetting entry and flagged W/CO also the symbolic code linked to linked  to Temprary clearing GL it is BS GL .
    I checked all the existing threads messages but I did not get solution.
    the problem comes up from our upgradation, 6 months back we upgraded to ECC 6.
    We don't have any problems in our old 4.7 system still it is working fine.
    I created OSS but still they did not solved and they are refering all passed notes.
    could any one give the solution to come out from this problem?
    Thanks and Regards,
    Satya

    Hi Satya,
    Basically the error is because of Funds Management which you have activated. Please check the note 1268001, 701291, 558295 & 936658 but i dont know will this be helpful or not.
    Regards,
    S.Srikanth
    Edited by: SrikanthS on Oct 26, 2010 11:17 AM

  • Custom Error Message in Value Help

    Hi,
    In my application i have a Inputfield called "CLASS", for which i have added a value help..it has these values
    B    Business
    E    Economy
    F    First Class
    When the user enters a value(say "X") other than B, E, and F, it displays a message
    <b>String "X" does not match the enumeration</b>
    I want to put my own message like " Please enter a valid value" instead of the above message.
    Please let me know how to do this ?
    Thanks
    Senthil

    Senthil,
    First, "looping through the list and checking the user entered value with values in the list" is possible only with non-validating actions. Using non-validating actions is a tricky task in real life.
    Second, workarounds are possible, but they involves calculated attributes (like here: /people/valery.silaev/blog/2005/11/29/800format-your-way). Solving this problem generically (45 attributes is a good number to start with a generic solution) will result in solution with complexity comparable to this: https://weblogs.sdn.sap.com/pub/wlg/3309. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] Do you need such thing just to alter error message?
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • How do you use user defined error messages in Value Help?

    Hi,
    I'm currently working on a Modifiable Value Help Selector in Web Dynpro Java, and I want to use a user defined error message when I validate the values entered by a user. Currently, it's returning its default error message ("Character <string> does not match...").
    Since the project requires a different error message, is there a way to override the default error message and use my defined error message instead?
    Thanks!

    Hi Angelo,
    I am not sure why message area is showing both Custom and inbuilt messages but you can try the following:
    i guess you must be using reportContextAttribute exception for showing Error messages on the input fields as well.in that case you can disable the message area so messages will appear only on the Context level ie; on input fields.
    For other messages apart from validation messages you can enable the message area before reporting the exception.
    make sure the boolean context variable which will be used for enabling and disabling the message area should have Readonly property set as true.
    I am not sure whether this is the only solution for this but you can try and see if it works.
    Siddharth

  • How to disply error messages if values not available fpr F4 help

    Hi,
    I have implemented F4 help for a selection screen field using function module.
    I want to throw a customized error message if no value is available.
    In my case if no value is available it gives standard message no value available.
    I have tried but it gives a dump.
    Please suggest.
    Thanks and Regards
    Shraddha

    for F4 help defenitely you will be having a select query to populate into internal table
    if it is so
    after the select query with sy-subrc check
    if yes
    then it will proceed with the function module
    if no then throw error message
    message
    use this code
    form f_f4help .
      data : begin of it_itab occurs 1,
               username type usr02-bname,
               end of it_itab.
      select bname from usr02 into table it_itab.
    if sy-subrc = 0
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield        = 'BNAME'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_USER'
          value_org       = 'S'
        tables
          value_tab       = it_itab[]
        exceptions
          parameter_error = 1
          no_values_found = 2
          others          = 3.
      if sy-subrc  ne 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    else.
    message with error.
    endif.
    endform.
       cheers
    s.janagar

  • MEMASSIN TCode, Error Message, Default values??

    Hello SAPients!
    I'm an ABAP Developer, I don't know much about MM configuration but I have to solve this problem: We are using MEMASSIN TCode to massively update the Purchasing Info Records the problem is that in the end the system shows this error message "Enter a min. order qty. that is less than the standard order qty." and the Info Record is not updated, if I use ME12 I can see that the Min. Order Qty is defaulted to 10000 and the Standard Order Qty. is defaulted to 1, so, apparently it is correct for the system to trigger that error.
    My question would be, Where are  ME12 and MEMASSIN TCodes taking the default values from? How can I change those default values to something that allows MEMASSIN to update the Info Records correctly?
    Thanks in advance for your kind help.

    MEMASSIN and ME12 are both change transactions, so the values are just the values that are already entered.
    You should be able to see them in table EINE.
    I dont know how you loaded/entered the info records...
    Maybe it was loaded with own programs and these fields were not validated at that time, or it was a warning message that was turned into an error message after that info record was created.
    The question is just: what do you want to do?
    do you want it leave this way, or do you want to correct the standard order quantity to be at lease equal to the minimum order quantity.
    If you want to leave it wrong  and just mass change other fields, then you have to make the error message a warning only.
    If yo want to correct the quantity, then you can do this directly in MEMASSIN.
    You said you are an ABAPer, so it should be easy for you to populate a new standard value with a small coding, which can be entered behind when you click  formula  icon

  • Custom Error message in portal

    HI Experts,
    I trying to implement cutom error messages in portal. By Following the below link.
    [https://cw.sdn.sap.com/cw/community/docupedia/nw70java/blog/2010/03/21/custom-error-messages-in-the-portal]
    As of now I trying to implement it for error code "500".
    <error-page>
                 <error-code>500</error-code>
                 <location>/Customerrors/500.html</location>
           </error-page>
    </web-app>
    The above code I pasted in web.xml. 500.html is there in customerrors folder. I have also restrated the system.
    when I log in to portal system still I could see standard message coming for "500" code error not the custom one from 500.html.
    Iam using EP7.0 EHP1 .
    Thanks
    Surender Singh Dahiya

    Surender,
    I guess it should work in the similar fashion.However, I do not have access to a portal system now. Will try testing the scenario soon and keep you posted.
    Cheers!
    Sandeep Tudumu

  • A short dump in the program with a certain error message...

    Hi all,
    I'd run a program to do an insertion into a customized table.
    During the run, it popped up a short dump error messages below :
              value larger than specified precision allows for this column#TC020                    %M
    I've search for that column #TCO20 .... and i couldn't find it in my custom table...
    Why SAP gave such a hard description on the error found? I can't determine which field/column in my table that is causing the error dump during INSERT event in my program.
    Is there any explanation on that message that could help me?
    Thanks
    William Wilstroth

    Hi,
    Better u seee again where u r getting error i the code . still if u r not getting see in dump analysys(ST22) and select
    no:8 -- which is source code extract where u can get correct error inf.
    Plz reply me.
    Regards
    Durgaprasad.

  • BW 510 and 026 error message

    Hi all,
    I have a question on executing BW query.
    I created a own view and want to execute this view,but I got error message
    510:value 6001552 for characteristic BCUSTOMER  unknown
    026:Error when executing the query in OLAP server
    the value is given to filter and the characteristic BCUSTOMER is type char10.I got a reply from this forum said I should give 0006001552,but I am not sure whether it is the cause.Since I also gave the same number(6001552) in BEx,and it worked there.
    Anybody can help me?
    Thanks in advance!
    B.R.
    Liying

    Hi guys!
    It seems they have already set up everything:-(
    Thanks anyway
    B.R.
    Liying

  • Custom error message for invalid date format

    Hi,
    I am using af:selectInputDate component for date. When i enter wrong date format it comes up follwoing pop up error message:
    The value "12/13/2009" is not a valid date. Valid example ""29/11/2005".
    However i dont want to show this standard message but a customised error message like "the value is not in correct format...".
    Can anyone help me how can i show customised message.

    Hi Kiran
    Try these options
    1) Change your <b>Internet Explorer</b> [The Browser which you are using] language
    2) In Application Level, ie in Webdynpro
    a)Go to <b><Your project name>>Webdynpro>Applications--><Your Application>
    Double click on your Application name</b>b) Go to Application Properties TAB, Add a New Application Property
    c) Click on "<b>Browse</b>" and Select <b>DefaultLocale</b> and mention the Value as
    <b>en_US</b> [If you didnt mention any thing here by default it will take browser's language]
    3)In your Portal check the language setting of particular user in identity management
    Warm Regards
    Chaitanya.A

  • XML Source error message hexadecimal invalid character

    Hi all
    I am developing a SSIS package to add data from thousands of XML files to an existing SQL Server table. 
    And I get the error message:
    The XML Source was unable to process the XML data. “”hexadecimal value 0x01 , is an invalid character.
    I know that these XML files are not well-formed (and hence not really an XML file).
    So, How to use the SSIS package to solve this problem without using the other editor?

    Thanks Visakh16
    I tried your method, but the xml task showed me an error
    [XML Task] Error: An error occurred with the following error message: 
    “”hexadecimal value 0x01 , is an invalid character.
    My xml file with an invalid
    character before ‘うce☆溪’
    <articles>
    <article>
    <message>ID:うce☆溪&lt;br /&gt;
    &lt;br /&gt</message>
    <message_id>1</message_id>
    </article>
    </articles>
    My xslt file
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:fn="http://www.w3.org/2005/xpath-functions">
    <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
    <xsl:template match="/">
    <xsl:text>message,message_id</xsl:text>
    <xsl:text>&#13;&#10;</xsl:text>
    <xsl:for-each select="articles/article">
    <xsl:text>"</xsl:text>
    <xsl:value-of select="message"/>
    <xsl:text>","</xsl:text>
    <xsl:value-of select="message_id"/>
    <xsl:text>"</xsl:text>
    <xsl:text>&#13;&#10;</xsl:text>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>

  • Confused by Error Message

    Hi Everyone,
    I'm new to SAP Business One and the SDK. My company are developing an integration system between SAP B1 and Lotus Notes and I'm attempting to use the DI SDK. I have set up SAP B1 on my local system but when running the OrderAndInvoice sample with the demo database (SBODemoUS) and adding an order I get the error message "The value of the attribute '' of the tax parameter 'State-CA' is missing". This has an error number of 10. I have to say this has me completely at a loss.
    I get the same message if I use straight VB and COM and try to run the add example in the DOcuments section of the SDK help file. I'm running SAP B1 2007.
    Can anyone help or provide some insight as to why this may be happening?
    Many thanks
    Adrian North

    Eddie,
    Many thanks for your reply. Actually I can't even get this far with the SAP Business One client. When I go in as manager and try to open, for instance, an A/R Invoice I get a red line at the bottom of the screen saying "You are not licensed to open form [133] Invoice".
    Unfortunately I am completely new to SAP and not a financial person (as my bank will confirm ) so I am, to say the least completely stumped. As far as I know we have a valid license so I don't know what we are doing wrong.
    Adrian

  • Error Message - Control Recipe

    Sir,
    While generating control recipe I am getting following error message.
    "Value cannot be assigned autom. to char. 0015 PPPI_UNIT_OF_MEASURE in proc.instr. 0000 phase 0110"
    Please let me know how to resolve this error.
    Regards,
    Prashant Salvi

    hi,
    Go to Phase 0020 and then Process Instruction 0010.I think somewhere in this process Instrucition you have used PPPI_UNIT_OF _MEASURE as a output characteristic which has created this problem.Change it to input characterstic and then try to create the control recipe.
    Regards,
    Muthamil

Maybe you are looking for