ADF-BC/JSF How to display acustom error message from a backing bean

Hi all
Can anybody provide an example of how to manipulate the list of error messages from a JSF backing bean.
In my code I use a different navigation case and this directs the user to the page displaying the error message but I am sure that there must be a more elegant way.
Thanks in advance
Thanassis

Thanks Kris
I think you 've put me on the right track here, it's just that in my case what I really want to do is prevent my users from editing records not belonging to their own group. This is done via a selectOne table component and then the backing bean code tests if the value #{row.UserGroup} matches the #{bindings.LoggedOnUserGroup.inputValue}. If the values are equal then the beans returns the navigation case to the edit page. Otherwise it returns the navigation case for the "cannot edit" page.
So what I am thinking is to return null and somehow raise the right kind of exception in order to display the error in the af:messages tag.
Thanassis

Similar Messages

  • How to display an error message after validation in Formatted Search?

    Hi SBO experts,
    if an error is detected on validation in a Formatted Search, how to display an error message to the user entering the data?
    Thanks & Regards,
    Raghu Iyer

    i created a formatted search query & attached it to the field 'Quantity' at Line Item level in Sales Order screen. just for testing purpose, i eneterd the following code lines in the query validating 'Quantity'
    if $[$38.11.0] > 50
    begin
    select @error = 1
    select @error_message = 'Vendor code cannot begin to X sign.'
    end
    the system throws the error : Internal error (8180) occurred [Message 131-183]
    actually, i need to display an error message to the user if Quantity is not in multiples of the OITM.SalFactor2
    if $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0]) > 0
    begin
    select @error = 1
    select @error_message = 'Error in Quantity.'
    end
    but, this expression to get the remainder itself seems to have some error
    $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0])
    i guess, % operator is used for modulo (to find the remainder of one number divided by another.) ? am i right ?
    Regards,
    Raghu Iyer

  • How to display an error message on screen?

    Hi experts,
    In screen painter, how to display an error message in the message area just below the screen?
    Thanks!

    hi wuyia,.
    Write like this;
    Message 'Process completed Successfuly' TYPE 'S'.
    Message 'Want to Overwrite Value' TYPE 'W'.
    Message 'Press enter to continue' TYPE 'I'.
    Message 'Invalid Input' TYPE 'E'.
    S - Success
    W - Warning
    I - Information
    E - Error
    You can adjust your GUI option to display the message in a Popup or in the status bar.
    Regards
    Karthik D

  • ICI - How to display custom error messages in SAP CRM

    Hello,
    we are working on a custom Contact Center which interfaces with SAP CRM Version 7 with Enhancement Package over ICI.
    The basic call functions like accepting, hanging up, holding and retrieving are fully implemented and are working already.
    Our goal is to display error messages in the CRM so that clients know there is something wrong, for example why he can't be log in successfully (e.g. the telephony server isn't reachable).
    We already found the ICI Documentation file which provides us the CRM SOAP error codes and tried to send SOAP Fault messages, but never got
    them to screen.
    Please find an attached example screenshot what we mean exactly, reproduced by trying to make a call with CRM user while BCM CDT isn't
    running in the background.
    Regarding to this topic we've the following questions:
    - Is it possible to display custom error messages on the CRM or is this functionality limited to SAP?
    - Could you provide us some further information on how to use this feature exactly (implementation details?) and how the SOAP XML should look like to get it work?
    Thank you in advance!
    Best regards
    René Holy

    NewUser7 wrote:
    Please correct me if I am wrong
    I need to create an entity adapter and attach an error handler with the adapter? or can i handle that in the event handler itself. I coulnt find any api for handling errorsYou can do it both ways but since we are talking about event handler now, then in 9.x you need to extend com.thortech.xl.client.events.tcBaseEvent class for creating a event handler. In tcBaseEvent class there are various flavors of handleError method. So use that as per my note earlier and you should be good.
    HTH

  • How to display an error Message in Web Dynpro

    Hello,
    I want to display an error message in Web Dynpro. I'm using this,
    IWDMessageManager message = wdComponentAPI.getMessageManager();
    message.reportSuccess("<some relevant debug message>");
    However, the message is always shown at the bottom of the screen. It is possible to select the location in the screen for showing this object? Or what is the best way for doing this? I've tried to use a Label but I can't set the type (warning, error, info) it's only a message.
    Thanks
    Regards
    SU

    Hi,
    If you include the UI, it will display at the top of the screen..
    Please see below how to create a message in the message editor.
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    and this is how you access the error message in the application ti display it to the end user
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    Regards,
    Ganesh N

  • How to display an error message in maintenace view

    Hi,
    I have following requirement.
    I have a table. In the table, there is a field named REPORT which keeps an executable report name. When adding an entry i need to fill the field with an report name, which should exist in the system. The report name should not be include objects.
    Then I use search help HELP_TRDIR with import parameter SUBC = 1.  I also create a maintenance view for the table.
    Then my question is how to display a warning message if the report I input in REPORT field doesn't exist in the system. If I need to modify the generated objects of the maintenance view, how to do it.
    The reason i don't use foreign key is that it seems filter functionality is not availabe in the case with import parameter SUBC = 1.
    Thanks in advance,
    Best Regards, Johnney.

    Hi,
    You need to add your validation in the table maintenance events:
    Use the event : 01 - Before saving data to the databse table... for this purpose
    1) Go to Menu-> Utilities->Table mainatenace generator
    2) On the table maintenance screen->Menu->Enviroement-> Modifications->Events
    3) select an event 01 and give some subroutine/form name.
    4) Add your validation in the form(Note this form should be in the Func Group of the table maintanance genetaor)
    Regarrds
    Shiva

  • How to get the Error message from hr_contact_rel_api.create_contact

    Hello All,
    I am using this API for creating a contact for an employee in R12.
    But, some times i am not able to create the contact successfully, and Unable to figure out proper reason for record erroring out.
    I dont find any out msg data variables for this API in order to check it for the Error.
    So, can any body help me how to get the ERROR Message for such APIs.
    Thanks inAdvance,
    Amarnadh Js

    user12243334 wrote:
    solved the issue on myselfIt would be nice if you could share the solution with us.
    Thanks,
    Hussein

  • How to get the error message from a AWS code to display on the portal

    I implemented IAuthProvider, it works, within the code when authentication fails, I threw AccessDeniedException(customMessage) but when the login fails, the login screen always display the "You could not be logged in to the portal." error message, how can I get it to display the custom message? Am I throwing the wrong exception?
    TIA.

    Simpler? Uhm as far I know there doesn't exist any magic and you have just to write one or two lines of Javascript code yourself. Is that hard?

  • How to display the error message during the web dynpro application runtime

    hi,
        I'm a java developer,During i 'deploy and run ' a web dynpro application on server-1,if the application have some runtime errors. there are displayed many infomation about the runtime error,such as exception track,etc.
        But when i do the same on server-2,there just show something like:
                500   Internal Server Error
                                    SAP NetWeaver Application Server 7.00/Java AS 7.00
                Failed to process request. Please contact your system administrator.
    but the server-1 will stop the j2ee engine. 
    how can do i make server-2 show detail error message as server-1. when i debug web dynpro application need these infomation.
    Appreciate your inputs...
    (Note:server-1 and server-2 have same software version)
    Edited by: BingLin Zhong on Feb 18, 2008 2:13 AM

    The Sap-Notes 962319:
    1. Check in the Visual Administrator, "Licensing Adapter" -> "General" -> "SystemType" !
    If it is set to "DEVELOPMENT_MODE", verbose error messages are shown.
    If it is undefined, proceed with the next step.
    If it is set to something else, only exception IDs are shown. In this case the only chance is to search for this exception ID in the default traces.
    2. If the system type is undefined, then in the Config Tool "Configurations" -> "webdynpro" -> "sap.com" -> "tcwddispwda" -> "Propertysheet default" -> "DevelopmentMode" is evaluated. If it is "true", verbose error messages are shown.
    3. If verbose error messages are required but still the short version is shown, you probably face an error message that is not raised by Web Dynpro but by other components of the NetWeaver. In the Visual Administrator set "Properties" -> "HTTP Provider" -> "DetailedErrorResponse" to "true".
    4. In addition to the error page shown in the browser or client, important messages - including error messages and stack traces - are written to the log and trace files, e.g. to the default traces usr\sap\<SID>\<instance>\j2ee\cluster\server<number>\log\defaulttrace.trc.<number>.
    a) In some cases, when an exception ID is included in the error message, the detailed error message can easily be retrieved in the log file.
    b) When no exception ID is given, you have to search for the detailed error message in the log specifying time stamp and/or user ID.
    Always consider restarting the system after making changes on the settings.
    It is not recommended to switch the "SystemType" to an inappropriate value just for viewing verbose error messages. The system type potentially affects framework, applications and licensing in an perhaps unintended way.
    In the past there was no distinction between different system types regarding error messages. For security reasons this distiction has been introduced. It is not intended to show stack traces in non-development systems in the future. SAP does not provide workarounds or patches to enable such a behaviour again.

  • How to display long error message in ME21N

    Hi,
    How to display a long error text (in multiple lines) in ME21N / ME22N message popup we get while saving or checking the PO. My error message length is 100 chars. It is displaying only 40 chars in a single line. My requirement is to display that in multiple lines of message popup. Please let me know asap.
    Thnks in Advance.

    Hi,
    Messages have long texts.... Uncheck the self-explanatory box, change your long message to a short one, place your long message in the long text of your message. SAP should handle the rest.
    Reward if helpfull...
    Cheers,
    Ameen.

  • How to display the error message on screen in display mode

    Hi all,
    How to display error message as as status message on the screen(module pool).
    The requirement is if I call the screen, it should get with the error message in the status bar. If I write with error message 'E' error mesage information displays and when I click on exit, it lives the current transaction.
    Thank you!
    Prasad

    Hi,
    Try as below.
    MESSAGE IXXX DISPLAY LIKE 'E'.
    LEAVE TO SCREEN XXXX.
    After displaying the information message like E, leave to the screen you want to navigate or can also navigate to the transaction required.
    Regards,
    Nangunoori.

  • How to display an error message in Dynamic Actions

    Dear Team:
    Scenario as below:
    Whenever the user creates Contract Elements Record, the begin date should be checked with the hire date in 0041 - Date specifications infotype (Date type) and Date of hire. If this is not equal to, then record should be rejected with an error message. Please let me know how do I write the lines in table V_T588M for infotype 0016.
    HOW TO INSERT AN ERROR LINE TO BE DISPLAYED IN DYNAMIC ACTIONS.
    Regards
    Team Member.
    Edited by: Patlolla Mallikarjun on Jul 8, 2009 1:53 PM
    Edited by: Patlolla Mallikarjun on Jul 12, 2009 10:13 AM

    No replies.

  • How do I suppress error messages from displaying in GPIB calls?

    I use GPIB Read and GPIB Write to access instruments on the bus. Both vi's supply status on error out.
    I sometimes call these routines in situations where I do NOT want to reap error status, so I leave the error out terminal unconnected.
    Here's the problem: I get error popups that display the GPIB errors (when there are some)  even though I don't connect the error out terminals to simple error or general error.
    How can I suppress the error messages??? I do NOT want them to display...
    As always, thanks in advance for the assist!!!

    PROBLEM SOLVED.
    Thanks gentlemen. But... now I have to defend myself!
    1. I have both old non-488.2 and newer 488.2 instruments on the same bus. When I send *IDN? to the old instruments, they generate errors. When I send model-specific (non 488.2) commands to the newer stuff, they sometimes error. I have to 'search' the bus and identify specific instruments (by mfg/model) that I'm looking for; I don't know what address they're at. So I go thru a loop (the index is the GPIB address) and for each address I try the old-style probe; if it fails, the new style; if neither succeeds, no one is home at that address. The problem is that in cases where I try the wrong probe for the device first, it frequent gets 'trapped' in the input buffer of that device causing it to incorrectly respond to its correct probe when I finally get to it. So I have to clear the device before sending it the probe to make sure its listening. Can't use *CLR since many devices don't recognize it; and since I can't send a command (yet) because the device is screwed up. So.... I figured out what I have to do to get the devices listening. The NEAT-3xx controllers are happy *after* they receive a null command with a LF (EOS) character - but they generate errors while processing the digital enema just described. The HP spectrum analyzers I use work fine when they get *IDN?, but generate an error on the bus when they receive the probe designed to get the NEAT controller to respond. So what I do is always send an EOS character first to each address before each probe - and then issue a GPIB read. I ignore the errors generated, and the data returned. Then when I probe, I always get a good response (if the probe type matches the device!) instead of an artifact from the garbage the instrument had to listen to. It's like drinking a beer after your wife calls you and nags - it clears your head and makes you ready to move forward. So now you know why sometimes I wanna ignore errors, but thanks for asking.
    2. Why don't I use VISA? Well, find me a VISA driver for the NEAT-3xx family of controllers, and I will... I use raw GPIB reads/writes (and nothing else) in my 'scan the bus and probe each address' loop described above. I use raw GPIB commands for the NEAT controllers, and VISA for the HP. You guys designed this stuff, not me... What I don't know (and what you might help me with) is whether there's a 'raw' interface that allows you to talk to instruments using VISA calls when there is NOT a VISA driver for the device... kinda like "I wanna use the GPIB read/write, but use the VISA interface so all my code looks the same" deal...
    Thanks again!

  • How to display custom error message if the Required field is not entered?

    Hi,
    I have made one input field as required field in a view.
    I want to display one custom error message ,if the required input field is not entered.
    Please help me regarding this.
    Thanks,
    Deepika

    hi deepika....
    First go to message pool under webdynpro components.
    Create a new message there..of type error.
    Enter your text.
    Now to avoid null pointer exception , in wdDoInit(), initialise the value
    wdContext.currentDateTimeElement().setDate("");
    now create an action for submission of data. If field is empty, then within the button write:
      msg = wdComponentAPI.getComponent().getMessageManager();
        if(wdContext.currentDateTimeElement().getDate().equals(""))
        msg.raiseMessage(IMessageCompTodatDateTime.ERROR,new Object[]{""},true)     ;
    between begin others put:
    regards,
    pinki
      IWDMessageManager msg = null;

  • How to show execution error message from a Process

    hi
    i have a requirement like to display the error messsage returned by the proceure.
    I have a process with point After Submit and validations, where i am calling a procedure which returns the execution status with SUCCESS or FAILURE;
    and if it FAILURE, it will return the error_message also, how can i show this message to the user just like how we are showing the process success message/validation message.
    And i need to stop the process execution there itself once its got failed;
    how can i achieve these two? anyone can give some inputs....
    thanks in advance
    renjish

    paul and denes, thanks for the quick reply...
    i tried the both option the message is coming properly. but the thing is i want to stop the execution there itself where i got the error from the procedure and the page should be remained in the same page.
    currently i have a page 10(customer search screen), from there i called page 102 (customer edit screen) and in the page 102 i attached the process which includes the procedure to update the customer details;
    Normally if update is success, the procedure will return SUCCESS and its navigating to the page 10(customer search screen.). so here if FAILURE is returning by procedure, i need to be in the same page i.e 102(customer edit) by showing the error message..just like a validation message...
    currently whatever the procedure returns either SUCCESS or FAILURE, it goes to previous screen, but i need the method just like how the validation works if it fails.
    hope you got....
    regards
    renjish

Maybe you are looking for

  • What are the solutions offered to handle length based or mill products?

    We are on 11.5.10. Current version treats beams as each, we have 30 feet beams, 20 feet beams etc. We do not want to set-up different items for each length of beam. We need ability to tell we have 10 pieces of 26 feet beams in inventory. Currently we

  • How to upload image from a folder thro JSP

    Hi, I am CBK Varma,and I am developing one application, where I have to display images in my webpage, from a specific folder that should keep on changing every 10 sec.. ... how to upload these image files to my page with timing..means afterr 10 sec ,

  • I have problem with iphone 5 camera

    I take a photo with flash or record video with flash photo or video quality it's very bad pic or video colors it's not brigth

  • UPDATE...sync issues..on my Bold, everything in the calender is showing up three times..

    it is only in the calender. Tasks and contacts are in there just once, but after syncing tonight before leaving the office, the calender info is listed three times..Thoughs? I TOOK OUT THE BATTERY AND ONE OF THE ENTRIES DISAPPEARED. THIS ALSO IS FOR

  • WLC8500 WLC - HA Failure Simulation

    Hi Just running some tests on the 8500 running 7.6.120.0, one of the test was to simulate the HA box failing, by removing the layer 2 connection and shutting down the interface. The test  bed APs were on the primary box and with test clients active,