HELP: ADF-Error in Entity Validation - Validation fires twice

Hi there,
I have problems with the entity validation in JClient when I have more then one UI-Element that references to the same Data Control / Model Attribute within one panel.
E.g. I have a table where I display all customers. Above the table I show detail information with editable JTextFields for the customer I've selected in the table. When I change the name of a customer and leave the textfield, the new Value appears also in the table. Thats all ok.
The problem:
The entity validation fires twice in that example. E.g. when I insert 30 characters in the name field, but the corresponding database column only stores 20 characters, the
displayed exception appears twice. When I remove the textfields from the panel
and edit the values direct in the table, the validation only fires one time.
How can I avoid that behaviour? I have a lot of screens where it is important to show the list of objects in a table and let edit specific data via text fields.
That behaviour is also reproducable with the ADFJClientComponentDemo
(Jtree binding demo). If you insert more characters than allowed in the firstname field,
the Exception Message is shown twice.
Thanks for your help,
Claus

Hi Fred,
It's nice to know that somebody out there uses the same technology in a similar way.
Our L & F is also JGoodies based (we didn't use JGoodies forms).Yes, nice to know. We also only use L&F and not the JGoodies Layout Manager
(but if JDev 10.1.3 provides that layout manager maybe we use it for new panels).
In our JClient View project, we used very few try/catch blocks, mostly in our custom
Navigation bar class (with freeze row function).
How would you translate the following in 3tiers?
in the client class:
try {
// call a method in the model
catch (JboException je)
this.getPanelBinding().reportException(je);
}We don't use any try/catch-blocks to check for model-exceptions.
In our application a typical bootstrap code snipplet looks like that:
=======================================
//As classmember we have our own ErrorHandler:
protected HTOErrorHandler errorHandler = new HTOErrorHandler(true);
//some bootstrap code
BindingContext ctx = new BindingContext();
ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());
ctx.setLocaleContext(new DefLocaleContext(null));
//Set Custom Error Handler
ctx.setErrorHandler(errorHandler);
=======================================
Our Custom Error Handler Looks like this:
=======================================
public class HTOErrorHandler extends DCErrorHandlerImpl
boolean inReportException = false;
public HotErrorHandler(boolean setToThrow){
super(setToThrow);
public void reportException(DCBindingContainer bc, Exception ex){
disableAppendCodes(ex);
showPopup(ex);
super.reportException(bc, ex);
private void disableAppendCodes(Exception ex){
JboException jboEx = (JboException) ex;
String baseMsg = jboEx.getBaseMessage();
String detailMsg = jboEx.getDetailMessage();
String errorCode = jboEx.getErrorCode();
Locale defaultLoc = Locale.getDefault();
Object[] detailExceptions = jboEx.getDetails();
if ((detailExceptions != null) && (detailExceptions.length > 0)){
for (int z = 0, numEx = detailExceptions.length; z > numEx; z++){
disableAppendCodes((Exception) detailExceptions[z]);
public void showPopup(Exception ex){
DialogMessage dialog = new DialogMessage((JboException)ex);
dialog.setVisible(true);
=======================================
The DialogMessage is our own ModalDialog to show the ErrorMessages with
a userfriendly dialog (e.g. we show some error/warning/info-icon...)
Each time we throw a exception in a EntityObject the framework ensures that
the Message is shown in our own ModalDialog without using try/catch-blocks
and the this.getPanelBinding().reportException(je)-method;
We wrote our own ModalDialog because of L&F-reasons. But you said that
you use the Standard-Dialog. IMHO you must neverlethess use the setErrorHandler-Method
in 3-tier mode, but you needn't to write your own ErrorHandler, you can use the
JUErrorHandlerDlg....
The following line of code is generated by the ide when creating a default form:
app.getApplicationModule().fetchAttributeProperties(new String[] {"Test2View1"}, new >String[][] {{"Id2", "Name2", "Id3", "AttrTest"}}, null);
I read somewhere that when opening a panel, one should call that method for all used >properties in 3tiers mode only.Sorry, but we don't currently optimize something like that. For what reason
do you want to call that method explicit? We don't have a custom method for that.
I add tests in the validateEntity method and throw a JboException.
I suppose for 3tiers I will have to replace throw new JboException by ???? No. You don't have to replace that. The framework notifies your client via the registered ErrorHandler.
So when a mandatory field is empty, the framework displays an error when a commit
or navigation event is triggered in the nav bar and the user has always access to that
field.We want to override the default framework message with our own message. So we have
to throw the exception manually at some point in the entity object. And for that reason
we implemented a custom validation via MethodValidator, but the framework-validation fires
an exception BEFORE our custom validation is processed. Maybe you don't have that problem
because you use the default error messages. Do you use deferred Exceptions? We do so.
Did you try JClient 3tiers deployments over the Internet?Yes, we tried it via VPN/DSL to validate that our framework interface-usage works both in 2-tier and 3-tier.
After several attempts we were successfull, but the performance was poor.
PS Are you connected to skype? Unfortunately no because of firewall restrictions. We only have access to ICQ.
Regards,
Claus

Similar Messages

  • Execution of entity validation multiple times (adf bc 10g)

    Implementing entity method validators sometimes causes the validation (e.g. validateEntity method) to execute multiple times. We have figured out that this case occurs when we call method setAttribute programmatically when we implement business rules on the entity level. For example in many cases that we want to enforce dml operation execution, we override the method prepareForDML so that the framework works as follows:
    •     calls validateEntity, validates entity for the first time
    •     calls prepareForDML –> setAttribute this method invalidates the entity row
    •     calls validateEntity, validates entity for a second time
    I can understand that sometimes multiple entity validation is necessary and important, there are cases though that this behaviour is not necessary and additionally it degrades performance especially when we utilize sql queries inside the validation (as it executes the queries multiple times).
    Is there any workaround to avoid multiple execution of entity validation or enforce the validation to occur only once, for example after the prepareForDML method and not before?
    Edited by: user647567 on 9 Σεπ 2010 6:58 πμ

    Hi there:
    I don't think JDeveloper provides a switch to bypass the Entity Validation. Too much meddling. MVC model has those layers and advocates reducing unnecessary dependencies between layers. Entities and Views are both in Model layer though. But you can build a view without an Entity and vise versa you can have an Entity that doesn't have default views. So my understanding is the Entity Validation is quite necessary.
    Though from View layer, on a jspx page, you can use command buttons and set their "immediate" property to "true" to bypass form validation temporarily and postpone it to form submission time.
    My understanding for Entity validator is they should be light weighted. You properly should avoid SQL queries directly in them. Instead you should use EntityImpl or ViewObjImpl/ViewRowImpl instead of SQL queries directly in validator.
    If you feel my answer helpful to you, please mark it so.
    Thanks,
    Alex
    Edited by: Alexbie on Sep 9, 2010 11:11 AM

  • Help please! error code:  a valid dvd drive could not be found  [-70012]

    Hi,
    Although I am able to play cds and bootable discs, I am unable to play dvds on my LaCie d2 DVD-RW Firewire Drive. I get an error code:
    a valid dvd drive could not be found -70012
    Is anyone able to help? I did see one other post listed with this error code, but that person's results seem to be no longer valid, with outdated links for patches.
    Thanks,
    George

    It's possible that you caused some damage by not "properly" doing the firmware update, but drives with bad firmware typically just don't work, period. Unfortunately, LaCie does not keep the older firmware posted on their site so that you could 'back-flash' the drive to an earlier firmware revision and then re-apply the updated firmware.
    If you have access to a PC that you could put the drive into (as in, removed from the LaCie external enclosure) and know the drive type (the NEC ND-35xx is the most common) you could find older firmware and flashing utilities for the PC, flash the drive to one of those and then drop it back into the LaCie enclosure and flash it back to the current LaCie firmware. No guarantees this will work, though, and you may end up with a totally dead drive.
    -Douggo

  • Hide '1 error has occurred' when validation fires

    Hi All,
    how to hide '1 error has occurred' message when validation fires?
    Mixing English and non-English messages looks a bit uncomfortable for users.
    So I would like to hide or translate it into Russian. How to do this?
    Thanks

    Edward,
    I'm almost sure this message can't be translated, but perhaps Joel can jump in and correct me. You can make sure it doesn't get shown by editing your page template and removing this susbstitution string:
    #NOTIFICATION_MESSAGE#
    Sergio

  • How to stop attribute level validation when entity validator fails?

    Hi,
    Can you suggest any way to achieve the desired behaviour on the following scenario.
    Table contains the following columns
    1. Grade
    2. Grade Rate
    3. Status
    Constraints:
    1. Grade and Grade Rate together must be unique.
    2. Grade and Grade Rate are mandatory fields.
    Implementation:
    1. Have Mandatory validator at attribute level for Grade and Grade Rate by default.
    2. Alternate key is defined based on Grade and Grade Rate and added the same as Entity validator.
    User operation scenario:
    User adds a row in a table, entered 'GradeOne' as Grade, tabbed out and then entered '5 %' as Grade Rate (Existing row of the VO has a row with similar data already). When user try to navigate to other row, both validation at attribute level and entity level fires and gives the following error messages.
    Error Msg 1. Grade and GradeRate should be unique.
    Error Msg 2. Attribute GradeRate is required.
    Expected behaviour:
    I can understand the reason why ADF throws both the errors (coz it didn't consider the invalid value of GradeRate posted into attribute), but the error messages confuses the user. It would be great if he get only one error message in this scenario (i.e. Unique validation alone)
    Question:
    How can I restrict in such a way that only one error validation happens in a request (i.e. either attribute level or entity level or in a particular order}
    Thanks in Advance.

    Hi,
    the reason ADF does this is for performance. What if you create a custom error handler in the DataBindings.cpx file and use this to suppress all other errors?
    See
    Decompiling ADF Binaries: Customizing Business Components Error Messages
    :http://www.adftutorials.com/adf-custom-error-handler-to-display-custom-message-to-user.html
    Frank

  • How to refresh View bind variables or is this a bug in Entity Validation?

    Maybe I am missing something. Here is the scenario:
    1. I got a create/edit form with a field (*tfA*) that is a af:selectInputText that launches a search form pop up.
    2. The form (which is tied to an Entity ADF object) has validations -both attribute specific and global (for lack of better term..) set up in the Entity Object Editor wizard.
    3. I noticed that when a global validation fails, when i launch the search form from tfA, it ignores whatever search criteria I enter (ie it retrieves all rows)
    Otherwise, the pop up search form works perfectly. I am wondering if I need to reset the bindVariable values somewhere or if it has something to do with a refreshCondition. What confuses me though is that it works just fine if the global (ADF Entity) validations don't fail.
    The pop up search form uses the default ExecuteWithParams action listener that calls a view with bindvariables. My JDev version is 10.1.3.4
    Any help is appreciated. Thank you.

    The issue turns out to be that the Global Entity Validation continues to fire even after you click on the find button on your selectInputText component. The Entity validation is interrupting the call to the View Object in my pop up search window because somehow clicking search on the pop up is submitting the originating form.
    I am still not sure if this is a bug that needs to be addressed or I was doing something odd but the solution is the following:
    in your *<af:selectInputText />,* add the following: *actionListener="#{bindings.Rollback.execute}"*
    This will prevent the validation from firing because it thinks that you are trying to submit the form when all you're doing is actually launching a search pop up.
    Hope that helps.
    Edited by: rrey on Aug 3, 2009 3:58 PM

  • Groovy expression for error message in validation

    hi...
    using groovy expression i want to display a dynamic error message...(ie.i have a date field the date cant be a past date..if i enter the past date like (02-04-2012 )the error message should display with this date)

    For a validation rule on an entity attribute, you can use a Groovy expression to decide whether
    an error or a warning message should be displayed using the following expression:
    adf.error.raise("THIS_IS_AN_ERROR_MESSAGE")
    adf.error.warn("THIS_IS_A_WARNING_MESSAGE")
    In your case, you can customize the message and access the date attribute in the message as source.HireDate(Assuming HireDate is the date attribute)
    Hope it helps.

  • Entity validation strange behaviour

    I have a number of method validators against an entity.
    The validators fire for incorrect data entered on the associated screen and once the data is fixed the user is presented with a second screen. All is fine so far ...
    Until the user hits the back button to go back to the first screen. For some reason even though the user enters invalid data the method validators don't fire !!!. Very confusing.
    Does anyone know of any reasons why this should occur ?
    Many Thanks,
    Richard

    Hi,
    I added a page-link to my second page as suggested. Using this method(instead of back button) causes the validation in the first screen to re-fire.
    The previously entered values in the first screen are gone as its a new request.
    I use code from your toystore to pre-create a record in the initializeModelForPage step. This fires when the link is clicked, and part of that code deletes the last entry from the entity cache. Therefore I'm not too surprised this works. As part of this project it has been stated that the users should be able to navigate through the browsers buttons, so I'm still abit stuck. Any suggestions ?
    What i've done for now is to remove my validation from BC4J to my struts actions.
    But because new values aren't recorded in the entity after a back button I also have to manually set the bindings for each screen field in my struts action.
    I'm not an expert in the adf / struts frame work so I could just be missing something.
    On a related point(assuming that i use entity validation) the following happens.
    On my first screen I enter valid data , and then move to my second. I leave the screen in an invalid date before pressing the browsers back button. I then can't get past the first screen as it is still validating the errors in the second screen. Shay mention that I should be using a cancel button in the second screen to navigate back to the first. This is a public user application and I know that the back button will be pressed(its not good web design to remove/disable it anyway).
    Any suggestions.
    It seems that I can't get the ADF framework to work well with wizards and perhaps its best to just use struts for the validation and at the end of the wizard just call a database package to do the DML ?
    Sorry but one last point - to do with the refresh button.
    All my wizards use page forwards to move between screens and I know this can cause oddities with a refresh. What I have noticed is that when even refreshing the first page of my wizard(after leaving it in an invalid state) the screen doesn't change the errors are still there. I would have though the refresh would request a new refreshed page without the struts action errors. I even noticed that a refresh can cause a struts action related to a submit button to re-fire ? Why does this happen as it can cause a big mess.
    Even re-entering the url in the same browser window doesn't cause the screen to properly refresh. The initializeModelForPage steps also do not fire when a refresh happens. I did notice that if I went to a different website and then re-entered the url that the page displayed more as expected and I think the initializeModelForPage step ran.
    I'm sure alot of this is due to the fact that I don't really understand the framework, and thus would be grateful if you could explain why all the above happens. Is it what you would expect to happen ?
    Many Thanks for your time and assistance.
    Richard

  • More Entity Validation problems

    I have 2 screens each based on different entities.
    I seem to get problems when i do the following:
    1) enter correct data in the first screen. Hit submit and correctly move to the second screen
    2) Enter invalid data in second screen, and press submit. At this point the entity validation kicks in and I display the problems.
    3) The user hits the back browser button.
    4) They change information in the first screen and hit submit.
    5) At this point the entiity from the second screen(which contains invalid data) validates again.
    6) Because there are errors in this second entity I can't get pass the first screen again.
    Is this standard functionality ?
    What am I doing wrong ?
    I'm using jdev 9.051 jsp/struts/adf.
    The only solution I have is to move the validation code from the entity to my struts action, but will only do this as a last resort !!

    Clicking the back button, doesn't clear the second entity and therefore it will still fail the validation.
    The user shouldn't click the back button, instead you should supply a "Cancel" button in the second page that will then clear the information that was entered in that screen and will navigate to the first form.

  • Entity validation across multiple pages

    Hi,
    I have an entity that spans multiple pages and are wondering how I can get the entity validation to work one page at a time. Currently if I have mandatory attributes that are not shown until the second page I receive errors from the first page stating that these muist be entered.
    My current thoughts on fixing this is either to change my model to on epage per entity, or to turn of entity validation (including mandatory attributes) and just do my validations in my struts actions.
    This is a Jsp/ Struts / ADF BC project.
    Many Thanks,
    Richard

    Leo,
    I'm not sure I would have done this with columns. Because of your desire to link from one piece of text to another, in all three columns, I would use linking text boxes. Each of the three boxes on a page will be independent of each other, but can be linked to the boxes on the following pages. Does that seem like what you're looking for?
    -Dennis

  • Can't save BISM file pointing to excel sheet (data source). ErrMsg: "There were errors found while validating the page: Cannot connect to the server or database."

    Hi,
    Me and a collegue is administrering our new enterprise BI portal in SharePoint 2013 (On Premise) and have a problem with using a specific Excel file including general ledger data as data source through a BISM file.
    This particular BISM file can't be saved without getting the error message "There were errors found while validating the page: Cannot connect to the server or database."
    BISM files against other Excel sheets and sources (for example SSAS tabular databases) works well.
    Can anyone help us pinpointing whats wrong here, this is a really important stakeholder in our organization requesting this reporting?
    Cheers!

    Hi E.SWARD ,
    My self created a Power pivot excel then i want to use this excel to create BI file . Still i am getting the same error . Pls help me to resolve this issue
    Cannot connect to the server or database.
    I am getting the similar error , if i use Tabular analysis server instance .
    Subhash

  • An unexpected error occurred during validation

    Hi Ramesh,
    This is Jaden I work with Shamik :)
    We had the following question we were hoping you could help us with.
    We are trying to recieve a 850 document in the b2b server. We get the following error - An unexpected error occurred during validation
    our document we recieve is below. We use the document analizer and the document validates against the .ecs file fine. We notice that the server is missing the b2b log any thoughts?
    ISA~00~ ~00~ ~ZZ~Allied ~ZZ~UPS ~070721~1459~U~00200~000001008~0~P~+'GS~PO~Allied~UPS~20070721~1459~1008~X~004010'ST~850~1008'BEG~00~SA~60009~86974~20070717'DTM~010~20070717'TD5~~2~000001_DHL_A_2DA'N1~ST~19427~92~7984'N3~500 Oracle Pkwy'N4~Redwood City~CA~96504~US'N1~BT~19427~92~7984'N3~500 Oracle Pkwy'N4~Redwood City~CA~96504~US'PO1~1.1~1~EA~~~VP~50934~~~DV~255154'PID~F~~~~3PL Test Item with Lot Control'PO1~2.1~2~EA~~~VP~50936~~~DV~255155'PID~F~~~~3PL Test Item with Serial Control'PO1~3.1~3~EA~~~VP~50935~~~DV~255156'PID~F~~~~3PL Test Item with Locator Control'PO1~4.1~4~EA~~~VP~50936~~~DV~255157'PID~F~~~~3PL Test Item with Serial Control'PO1~5.1~100~EA~~~VP~50936~~~DV~255158'PID~F~~~~3PL Test Item with Serial Control'SE~21~1008'GE~1~1008'IEA~1~000001008'

    Hello jaden,
    Please edit tip.properties as follows and restart b2b. The log file will be generated at OH/ip/log/b2b/b2b.log.
    oracle.tip.LogType=text
    b2b.oracle.tip.DiagnosticLevel.B2B=DEBUG
    Make sure the delimiter used as part of configuring the document, i.e Document Protocol parameters are appropriate. The document might have validated in the spec builder as the delimter which is defined there might be different.
    Please setup a quick call if you still face issues.
    Rgds,
    Ramesh

  • Error message - "Overlapping validity areas were found for country BR"

    Hi Experts,
    For a certain output type Y953 (e.g. for the shipment 2002355665 related to the DN 3087912658), an error message "Overlapping validity areas were found for country BR" is coming in as error.
    The error message is appearing during the idoc processing of the shipment.
    This is an incident of Dangerous Goods.
    I would like to know if it is technically / functionally possible to find out as to why exactly this mesage is coming and how can we rectify the problem.
    From technical point of view we checked that this message was not being called in the SAP system but was dynamically called.
    kindly let me know of any breakthrough as this issue is critical as dangerous goods are being transported without needed documents printed.
    Thanks in advance.
    RIttik

    Check whether note 836139 helps you.
    thanks
    G. Lakshmipathi

  • Automatic entity validation

    Hi
    We are building an application framework on top of Toplink. One thing we added are field validators that are called on every setXXX(). The validator throws a ValidationException if there is a problem. This is automatic, and the developer doesn't need to care about it. ValidationException are atomaticaly sent back to the form by the framework and displayed using a message pool system...
    Now, we want to add an automatic entity validation system. The idea is to call the validate() method on the entity during the commit of the unit of work. The validate() method performs entity wide validations and throws a ValidationException if the entity is not valid. Of course, the framework must rollback the transaction if needed.
    How can wee do that in Toplink? I thought that events could help us, but I don't think we can throw exceptions from there...
    Any idea?
    Thanks
    Regards
    Eric

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • Af:validator fires all validation in a view

    Hi,
    I have a transaction that span many pages using a process train and I also have defined entity validation rules. I want to validate input fields on my form using af:validator. However all validation rules in my entity are fired. How can I validate only the fields displayed on the current page?
    I'm using jdev 10.1.3

    You can override the error handler and throw a JboWarning and then process these using reportException method.
    public void reportException(DCBindingContainer bc, java.lang.Exception ex) {
            logger.info("entering reportException() method");
            BindingContext ctx = bc.getBindingContext();
            String err_code;
            err_code = null;
            if (ex instanceof JboWarning) {
                    FacesMessage facesMessage = new FacesMessage(ex.getMessage());
                    facesMessage.setSeverity(FacesMessage.SEVERITY_WARNING);
                    JSFUtil.addGlobalMessage(facesMessage);
    }

Maybe you are looking for