Adding message to FacesContext when validation fails...

Hi
I am trying to add a validation message whenever a <af:inputText> value fails validation.
This error message should be displayed beside the inputText component.
The inputText is set to autoSubmit which will trigger the validator.
The following is what I have:
JSF page:
<af:inputText id="textUI"
label="my label"
maximumLength="200"
value=" .... "
required="true"
validator="#{backing_text.validateText}"
autoSubmit="true"/>
Backing bean:
public void validateText(FacesContext facesContext,
UIComponent uiComponent, Object value) {
FacesMessage message = new FacesMessage();
message.setSummary("error summary");
message.setSeverity(FacesMessage.SEVERITY_ERROR);
FacesContext.getCurrentInstance().addMessage(uiComponent.getId(), message);
throw new ValidatorException(message);
With the above code, when validation fails, no message is displayed beside the errorenous inputText component.
Does anyone have any idea where I could have gone wrong?
Thanks
Eric

try removing the autoSubmit="true" from the jsp.

Similar Messages

  • Adobe changes my numeric field to include commas when validation fails

    Adobe changes my numeric field to include commas when validation fails. My numeric validation setting is num{zzzzzzz9.99}. I want my numeric field to display as 99999999.00, no commas and only to have 2 decimals places. I added this validation to the Display, Edit, Validation and Data tabs under the validation pattern dialog box.
    When validation fails, adobe changes the display of the field to include commas and drops the decimal places:
    999,999,999
    How can I prevent this from happening? Any feedback is greatly appreciated.
    I've also added a change event to the field as well:
    \\only allows numbers and period.
    if (xfa.event.newText.match(/[^0-9.]/))
    xfa.event.change = "";
    \\only allows 11 characters to be entered.
    var maxLength = 11;
    if(xfa.event.newText.length >maxLength)xfa.event.change = "";

    I want it to display only numbers followed by 2 decimal places.
    999999999.00
    If I type all numbers in my field like 999999999999 and I go over the character limit of 11. My validation fails and then my numeric field is displayed with commas, 999,999,999 without the 2 decimal places. Is there a way to prevent adobe from automatically changing my fields?

  • Report shows "No data found" when validation fails

    Hi folks,
    I'm new to the OTN and have a short question regarding validations/report pagination.
    We are using Apex 4.0.2.00.07.
    I have a page containing a report with three columns.
    First column is a checkbox (f30), the second one a date picker and the third one is a value field (f34).
    I'm trying to build a validation for the value field (should only allow numeric values, but is varchar2) and used a validation with "Function Returning Boolean".
    The PL/SQL code is:
    DECLARE
    vrow BINARY_INTEGER;
    v_number FLOAT:=0;
    BEGIN
    FOR i IN 1 .. APEX_APPLICATION.g_f30.COUNT
    LOOP
    BEGIN
    vrow := APEX_APPLICATION.g_f30 (i);
    v_number := to_number(APEX_APPLICATION.g_f34(vrow));
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN FALSE;
    END;
    END LOOP;
    END;
    The validation works fine, but every time I enter a non numeric value and the validation fails (error message is displayed correctly as notification) I get a "report error: ORA-01403: no data found" in the pagination area of the report.
    Tried to disable pagination completely, but the error still displays when the validation fails.
    Any help would be appreciated.
    Thanks in advance and regards
    Sandro

    Content of the checkboxes is ok, debugging showed
    1:7     
    2:8
    (records 7 and 8 where ticked)
    Debugging console also shows:
         0.10900     0.00000     Processing point: Before Box Body          
         0.10900     0.00000     Region: Shareclassinformation          
         0.10900     0.00000     Item: P59_IS     
         0.10900     0.00000     Item: P59_NA
         0.10900     0.00000     Item: P59_CO
         0.10900     0.00000     Region: Attribute Selection
         0.10900     0.00000     Item: P59_LO
         0.10900     0.00000     Item: P59_ID
         0.10900     0.00000     Item: P59_IDAH
         0.10900     0.00000     Item: P59_IDAT
         0.10900     0.00000     Item: P59_SHO
         0.10900     0.00000     Item: P59_UTD
         0.10900     0.00000     Item: P59_X NA
         0.12500     0.00000     Region: Attributes
         0.12500     0.23400     Item: P59_NOT
         0.12500     0.00000     show report
         0.12500     0.00000     determine column headings
         0.12500     0.00000     parse query as: DB
         0.35900     0.14100     binding: ":P59_LOV_AT"="P59_LOV_AT" value="64"
         0.35900     0.00000     binding: ":P59_IDT"="P59_IDT" value="51"
         0.50000     0.01500     print column headings
         0.50000     0.00000     rows loop: 20 row(s)
         *0.51500     0.01600     report error: ORA-01403: no data found*
         0.51500     0.00000     Computation point: After Box Body
    ...

  • Error message:  .Mac account credentials validation failed for account...

    I have published via iWeb for some time, but after I created a new webpage, I have been unable to publish again. This is the latest error message...
    ".Mac account credentials validation failed for account “account name."
    I have tried publishing via wireless internet and direct connect to router, with the same results. The apple support site recommendation is to upgrade to iWeb 1.1.1 or higher, but I'm already running 1.1.2.
    Thanks!
    Craig

    I have this same problem SUDDENLY. I never have had issues before.I have not tried to publish since 10/04 so I don't know when this started...? what is the answer. My .mac account is fine and working.

  • Will B2B Adapter in SOA Composite receives fault when validation fails ?

    Hi Guys,
    Can any one clarify the following questions on B2B ?
    1. Can B2B Adapter receive exception whenever validation fails on b2b console after data sent from SOA Composite? if not how can we implement fault to soa composite in case of fault in b2b console?
    2. How can SOA Composite having b2b adapter configured with send operation know about fault happened in b2b console due agreement fail or validation fails or configuration fails?
    3. How can we handle faults in case of inbound scenario?

    Exception is handled in oracle b2b.
    All the execeptions are sent to IP_IN_QUEUE( in case of AQ) and B2B_IN_QUEUE( in case of JMS) with the consumer as "b2berror".
    You can configure your B2B adapter to pull out the exception messages in your soa composite.

  • Why are inputText values within a dataTable tag lost when validation fails?

    Hi, As a test, I have three fields outside of a dataTable tag and three fields inside a dataTable tag.
    I enter data into field1, field3 and all of the fields within the dataTable. Field2 is left empty and is required. I press the 'go' button which gets to the validation phase and immediately redraws the web page and says 'value is required' which is what it should do.
    What shocks me at this point is that the field values inside the datatable are lost. They are back to their original blank values.
    It like even though validation fails(the model is not updated), the datatable is redrawn using the model data which is still blank. The renderer forgets that those fields within the datatable had data typed into them.
    Is this a bug? and how do I get around it? I don't want to lose what was typed in.
    here is my example:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <body>
    <f:view>
    <h:form>
    <h:panelGrid columns="2">
    <h:outputText value="field1"/><h:inputText value="#{example.field1}"/>
    <h:outputText value="field2 required"/><h:inputText required="true" value="#{example.field2}"/>
    <h:outputText value="field3"/><h:inputText value="#{example.field3}"/>
    </h:panelGrid>
    <h:panelGrid columns="1">
    <h:outputText value="dataTable"/>
    <h:outputText value="---------"/>
    <h:dataTable value="#{example.lines}" var="line">
    <h:column>
    <h:inputText value="#{line.text}"/>
    <f:facet name="header">
    <h:outputText value="column1"/>
    </f:facet>
    </h:column>
    </h:dataTable>
    <h:commandButton value="go"/>
    <h:outputText value="errors"/>
    <h:outputText value="---------"/>
    <h:messages showDetail="true"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    package test;
    import java.util.ArrayList;
    public class Example {
         private String field1;
         private String field2;
         private String field3;
         private ArrayList lines = new ArrayList();
         public Example() {
              lines.add(new Line());
              lines.add(new Line());
              lines.add(new Line());
         public String getField1() {
              return field1;
         public void setField1(String field1) {
              this.field1 = field1;
         public String getField2() {
              return field2;
         public void setField2(String field2) {
              this.field2 = field2;
         public String getField3() {
              return field3;
         public void setField3(String field3) {
              this.field3 = field3;
         public ArrayList getLines() {
              return lines;
         public void setLines(ArrayList lines) {
              this.lines = lines;
    package test;
    public class Line {
         private String text;
         public String getText() {
              return text;
         public void setText(String text) {
              this.text = text;
    <managed-bean>
    <managed-bean-name>example</managed-bean-name>
    <managed-bean-class>test.Example</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>

    I posted about this bug a month ago and then again twice more (as recently as last week) and got zero responses. I piddled away so much time thinking I was crazy to believe this framework could have such a gaping hole in the fuselage that it was crazy. The more unsettling part too was the fact that the logging in the jsf code is so pathetic that you have no clue even with it on full that it's throwing your data away, they have unit tests in their code, including in-container tests, and they didn't have a test that turned this up? Hello? A project that has been going for this long should not have torture traps like this in it. Sorry for my negative post. To end on a positive note, I am looking forward to finding out about oracle's stuff. And Sun wonders why no one uses their stuff.
    Does the Oracle JSF implementation require OAS?

  • How to avoid ModelLayer Update when validation fails in ValueChangeListener

    Hi,
    One of the requirement in my application is to avoid model layer update when a value is changed in a field and it is not a valid value according to business functionality. Scenario is explained below.
    1. Screen has one field SSN no.
    2. User enters 889787873 (According to functionality, SSN no. should not start with 8 or 9)
    3. The moment user enters and does Tab out, Value change listener gets fired (AutoSubmit is set to true and value change listener is mapped to it)
    4. I have a util method isValidSSN(int ssnNo) that gets the SSN no as input argument, validates it, returns true if it is valid otherwise false.
    There can be many ways to achieve the above said functiontlity including the best way of keeping the validation at entity attribute level. But that is not what i am looking for. I am doing migration of desktop application and want to mimic the code as how as it is (According to client requirement).
    Requirement behavior:
    In value change listener, I should get the newly entered value (Not from ValueChangeEvent.getNewValue()), validate it. If it is valid, I should update the model. If not, I should not do model layer update call at all as i want to keep my transaction undirty, but show invalid SSN message to the user.
    Requirement:
    1. Get the new value inside valueChange listener. I don't want to use valueChangeEvent.getNewValue() because what i said as SSN is just an example but in our app, we use many data types including custom domain data types. So i cannot expect valuechangeEvent.getNewValue() always gives me the new value with proper data type. I also know i cannot use UiComponent.processUpdate(facesContext) to get the new value from VO attribute. Because calling processUpdate issues setAttribute call at model layer, which in turn makes the transaction dirty. So i need to access the newly entered value with proper data type in some other way.
    2. If any itemChange logic fails, I should not update the model layer but directly comes to render response. I hope this is doable by calling FacesContext.renderResponse() API but need confirmation or any other way if i am wrong.
    Thanks in Advance.
    Raghu

    Thanks to all for your responses. Regarding accessing of new value inside value change listener, I am sure ValueChangeEvent.getNewValue() is not going to give me the value with proper data type. I am not using immediate attribute anywhere but use custom domain data type with masking (i.e. Formatter Format). Also I use InputDate field. Always valueChangeEvent.getNewValue() gives me the string representation of the value but not with actual data type.
    Question:
    1. Is there any API, that gets the valueChangeEvent.getNewValue() and the UI components as parameters and return the data with proper data type?
    2. I need to get the newly value with proper data type inside valueChangeListener. Is it achievable? If so, how?
    Need your help.

  • Edit error message as displayed when browsers fail to display dynamic pdfs

    I'm sure many people here are aware of the problems that arise when many browsers attempt to open a dynamic writable pdf. The built in plugin that ships with most browsers is unable to display the content, and as a result the following message is shown.
    "If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document. You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by visiting http://www.adobe.com/go/reader_download.
    For more assistance with Adobe Reader visit http://www.adobe.com/go/acrreader."
    (I trimmed a bit because the message is quite long)
    My question is, is there some way to modify the message above by editing the pdf using a program like Adobe Livecycle or Acrobat Pro? The message that displays is basically useless, because the problem is actually due to the browser's inability to display the pdf. If it is possible to replace this message with something more meaningful, such as instructions on downloading the form with right click, that would be fantastic for the users.
    Does anyone know where this information is stored? It doesn't seem to be browser specific (as the browsers I've tested seem to display the same message).

    I got the error messages to work from properties file and some helper class, but not through just defining in faces-config or web.xml.
    I am sure there is a better way to do but hopefully this will help you.
    FacesContext context = FacesContext.getCurrentInstance();
    In my validation method - I have the following code, which will associate
    the appropriate message
    String failureMsg = ErrorMessages.getString("SignUpData.NO_USER_NAME");
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,          failureMsg, failureMsg);
    context.addMessage("login_form:username", message);     
    My properties file - errormessage.properties - have the following info
    SignUpData.NO_USER_NAME =Please Enter User Name
    SignUpData.NO_PASSWORD =Please Enter Password
    Helper class - ErrorMessages.java
    import java.util.MissingResourceException;
    import java.util.ResourceBundle;
    public class ErrorMessages {
    private static final String BUNDLE_NAME = "com.path1.path2.resources.error_messages";
    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
    private ErrorMessages() {
    public static String getString(String key) {
    try {
    return RESOURCE_BUNDLE.getString(key);
    } catch (MissingResourceException e) {               return '!' + key + '!';
    I am also looking for a way to avoid all this extra helper classes if there is a better alternative.
    thanks
    ponni

  • How do I return to the top of a form when input validation fails?

    I have a form that I am using spry input validation that I
    would like the user to be returned to the top of the page when
    validation fails. If that can't be done somewhat easily, can I have
    a message appear next to the submit button that says "Errors found.
    The field(s) marked in red need to be corrected" when there are any
    errors that prevent the form from submitting.

    The break statement in Java is similar to last in Perl.
    The continue statement in Java is similar to next in Perl.

  • Problem loading metadata with ODI : "Single sign on validation failed"

    Hi,
    When I load metadata in Planning using ODI, the load fails at the step "Prepare for loading" with this error message : "Single sign on validation failed".
    Can you help me please ?
    Thanks.
    Virgile.

    "com.hyperion.odi.planning.ODIPlanningException: Single sign on validation failed."
    Means you have put the incorrect account details in the topology manager, update the username/password
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Catalog object schema validation failed(AGFIXBO2:EIRWWH9E)

    Hi,
    After copying my catalog from OBIEE 11.1.1.6.*0* (Build 120104.0800 64-bit) to 11.1.1.6.*7* (Build 121219.1257 64-bit).
    Many of my report (particularly those with graphs) was not valid.
    I have this message :
    Catalog object schema validation failed: /shared/...
    Error Details
    Error Codes: AGFIXBO2:EIRWWH9E
    Location: saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    The current xml is invalid with the following errors: Bad xml instance! <?xml version="1.0"?> <saw:report xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .... Message:Value 'actual' is not in enumeration .
    Please someone has any ideas to solve this issues.

    Hello,
    Check is post : Catalog object schema validation failed:  11.1.1.6.7 Patchset
    Also check this note : OBIEE 11g: Error: "Catalog object schema validation failed...Error Codes: AGFIXBO2:EIRWWH9E" After Upgrade [ID 1247125.1]
    Hope this helps. Pls mark if it does.
    Thanks,
    SVS

  • .mac account credentials validation failed for account "myusername"

    just tried to upload a blog to one of my sites and i got this message
    .mac account credentials validation failed for account "myusername"
    any help on what to do?
    thanks, b

    just to let you all know for future reference..
    i shut down my computer, stared at the sunset out my window for a minute or 2, restarted the machine, tried to publish, and yippy!! now i have a new blog on my site, these computers are tricky sometimes!!
    b

  • Anchor tag on validation fail.

    Hi,
    I have an application that i need to set the anchor destination when validation fails. I tried an unconditional branch to URL as
    f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.::::#&P2_ANCHOR_POS.
    I set the P2_ANCHOR_POS hidden iten within the validation. However branch points dont run unless the validations pass so how can i instruct the screen to move to the desired position?
    Thank you
    Graham.

    Hello Graham,
    Page processing stops if a validation fails. You'll need to create your own validation process. What you'll need to do is:
    1. Delete the Validation
    2. Create a Page Process that does your validation and sets the value of P2_ANCHOR_POS if the validation fails. If the validation passes, set the value of P2_ANCHOR_POS to NULL.
    3. Set the condition of your branch to be P2_ANCHOR_POS is NOT NULL
    Good luck,
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • Using ADF BC I wnat to customize error message when entity validation fails

    Hi,
    I am using ADF BC for model.JSF for view-controller
    I want that when entity level validation fails during update of record the error massage should be generate accourding to the values inputed by the user.
    how can i add programatically generated error message.
    Please if possible provide some example.
    Thanks
    ajit

    Try this:
    http://download-west.oracle.com/docs/pdf/B25947_01.pdf
    9.3.3 How to Create an Entity-Level Method Validator

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

Maybe you are looking for