Bug: ViewObject programmatic and form Validation

Hello

I've set up a display object as described here: http://stackoverflow.com/a/14611815/59087

Assigned to the view object is a shown here validation rule: http://i.imgur.com/HXiwPUL.png

The StartDate attribute value must be a date equal to or earlier than the EndDate attribute.

The view object is not supported by an entity. With the help of an entity here is not logically necessary as these input parameters are intended to be transmitted directly to a report. The parameters are independent of an entity and rather arbitrary.

When a February 1, 2013 start date and an end date of February 28, 2013 are given, a validation rule error: http://i.imgur.com/8v4007w.png

You can see how the view object has been created here: http://imgur.com/HQLNh5U, uqtt5Fq, X8fldVt, HXiwPUL, 8v4007w #0

This was recorded as a SR with Oracle and received the following response, "I guess the question here is this place where you added the validation. If this is added to the attribute level, then he will be fired by updating the attributes and there is no guarantee of the order of the attributes updates. If this is not the right place for you to add validation dealing with several attributes of value. Ideally it should have been added as entity level validation in your OE. And if your VO is updatab; e, that he must have been supported by EO-it is British Colombia was designed.
If EO the introduction is not possible now, maybe, you can try to replicate the validation at the attribute level and trigger the validation of the attribute last updated"

I'm fairly certain that by selecting programmatic (http://i.imgur.com/HQLNh5U.png), this means that no entity is necessary for the view.

In addition, given that the Rules of Validation tab appears (http://i.imgur.com/HXiwPUL.png), and a comparison rule can be defined, it leads me to believe that it is a bug.

As a workaround, I can define an 'empty' entity that is not accompanied by a database object and performs an entity-level validation. I don't like this because it is a little more work and requires the implementation of a transitional 'ID' fake to uniquely identify the row.

Other ideas (how can I enforce the order of updates of attributes so that StartDate is filled in the view before EndDate object, thereby ensuring that the validation is successful)?

Published by: Dave.Jarvis on February 7, 2013 11:31

Dave, support has a point here. Level of the attribute validation cannot cover the rules that have other attributes in the rule. In this case, you are detailed on the order of the attributes. The reason is that the validation of the attribute levels fires when the attribute changes its value. This is why the framework allows entity level validation (naturally only on an EO) where you can assume that all values are up to date and can be compared with each other.
However, on a view levels validation object only transient attributes attribute is permitted. As is the validation of the attribute levels the same ruling applies as for EO. You should not compare two attributes of a levels of attribute validation rule as you cannot predict the order attributes and so you cannot predict the outcome of the rule.
I do not see a bug here, such as validation to only at the level of the attribute.

OK, what can you do?
You can add an EO (as you said already) and add a level entity rule it. It will work, but needs some work more.
You can remove the date field validation rules. MinValue and validate them in for example a bean or you can even use a method that is exposed in the client interface of your VO for this. Then, you call the method when the user clicks the button before you start the report. When the rule is triggered, you do not start the report, but the message.

Timo

Tags: Java

Similar Questions

  • Date and form validation if java is disabled and obligation to hide the text areas to start

    Hi, currently my web page has a form on it where it select where there is a date entry and a speaker, and two text boxes where only is visible depending on the results of the verification of availability.

    Here is an example of the part of the shape of my page.

    Screen+shot+2011-04-06+at+5.32.32+PM.pngScreen shot 2011-04-06 at 5.32.54 PM.pngmy form with spry validation. no date or selected speaker.

    I have a few questions.

    First of all:

    When my page loads first the speaker's text non-reserved area is visible and the speaker is reserved textarea is hidden.  I guess that's because loading my page it refers to my database and nothing is so the speaker is non-reserved textarea is visible and the speaker is the placeholder text is hidden.

    How to get two text boxes to hide on start to the top of the page?  Here is my php code to the beginning of the model.

    ==============

    <? php require_once('.. / Connections/conEmjMarketing.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }


    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);


    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }



    @mysql_select_db ($database_conEmjMarketing, $conEmjMarketing);

    $query_rsCurrEvents = "SELECT speakerRequested, event, place, datebooked, startTime, endTime OF booking ORDER BY datebooked ASC";

    $rsCurrEvents = mysql_query ($query_rsCurrEvents, $conEmjMarketing) or die (mysql_error ());

    $row_rsCurrEvents = mysql_fetch_assoc ($rsCurrEvents);

    $totalRows_rsCurrEvents = mysql_num_rows ($rsCurrEvents);

    $query_rsCurrEvents = "SELECT speakerRequested, event, place, datebooked, startTime, endTime OF booking ORDER BY datebooked ASC";

    $rsCurrEvents = mysql_query ($query_rsCurrEvents, $conEmjMarketing) or die (mysql_error ());

    $row_rsCurrEvents = mysql_fetch_assoc ($rsCurrEvents);

    $totalRows_rsCurrEvents = mysql_num_rows ($rsCurrEvents);

    $query_rsCurrEvents = "SELECT speakerRequested, event, place, datebooked, startTime, endTime OF booking ORDER BY datebooked ASC";

    $rsCurrEvents = mysql_query ($query_rsCurrEvents, $conEmjMarketing) or die (mysql_error ());

    $row_rsCurrEvents = mysql_fetch_assoc ($rsCurrEvents);

    $totalRows_rsCurrEvents = mysql_num_rows ($rsCurrEvents);



    @mysql_select_db ($database_conEmjMarketing, $conEmjMarketing);

    $query_rsSpeakers = "SELECT speaker speaker speaker ORDER BY ASC";

    $rsSpeakers = mysql_query ($query_rsSpeakers, $conEmjMarketing) or die (mysql_error ());

    $row_rsSpeakers = mysql_fetch_assoc ($rsSpeakers);

    $totalRows_rsSpeakers = mysql_num_rows ($rsSpeakers);


    $colname_rsAvailability = "-1";

    If (isset($_POST['speakerRequested'])) {}

    $colname_rsAvailability = $_POST ['speakerRequested'];

    }

    $colname2_rsAvailability = "-1";

    If (isset($_POST['datebooked'])) {}

    $colname2_rsAvailability = $_POST ['datebooked'];

    }

    @mysql_select_db ($database_conEmjMarketing, $conEmjMarketing);

    $query_rsAvailability = sprintf ("" SELECT speakerRequested, datebooked FROM reservations WHERE speakerRequested as AND bookings.datebooked %s = %s ", GetSQLValueString ('%'.") $colname_rsAvailability. ('%', 'text'), GetSQLValueString ($colname2_rsAvailability, 'date'));

    $rsAvailability = mysql_query ($query_rsAvailability, $conEmjMarketing) or die (mysql_error ());

    $row_rsAvailability = mysql_fetch_assoc ($rsAvailability);

    $totalRows_rsAvailability = mysql_num_rows ($rsAvailability);

    ======================

    The second question:

    My form works very well with spry validation.  Validation of date format for the date text box work, validation for the speaker select jobs.  My question is how to validate that the date is a valid date and speaker selection box is not empty if java is disabled?

    Where do I put this code? How do I call? How can I show that the field is in error?

    Thank you winrol

    If you return to the solution I created for the date, you will see that the error messages are displayed by elseif clauses. You must do the same for the message of the speaker.

        Please select a Speaker.    Please select a Speaker.
    
        Please select a Speaker.
    
    
  • Form Validation failure: "value is not a date and time in the format"

    Hello world

    I am facing a weird problem in my custom OAF page. I'm displaying the records of a particular table through dynamic VO and dynamic array. All records appear correctly. But when I try to click on NEXT 10 records in a table, I get the error like "FAILED FORM VALIDATION: 1000 ORG CUST BO VERSION is not a date and time in the format. Just like in the screenshot below.

    DESKTOP.JPG

    Strange part of the question, if I select the columns to display not related to this day, so I only am not facing problems. If I select only dates to display and also am not facing this problem. If I use the mixture of this type varchar2 and data, I get this error.

    I tried to change the type of data but no use.

    If we close, look at the PARTY_ID error message trying to copy its data to ORG_CUST_BO_VERSION the last column. Why what's happening clue me less. Can anyone guide me on this please?

    The problem is that you use the same name for the creation of the MessageTextInputBean inside the Table.

    The name of MessageTextInputBean make it dynamic.

    ex: -.

    OAMessageTextInputBean oamessage = (OAMessageTextInputBean) createWebBean (pageContext,

    MESSAGE_TEXT_INPUT_BEAN,

    NULL,

    'text' + columnNo);

    See you soon

    AJ

  • PHP and Insert Records form validation

    Hello

    I've been scratching my head for 2 days and could not find a solution.

    Here's my problem:

    Go to http://ecopethandbags.com/contactTest.php and click on the "Send comments" button.

    You will see the validation works.

    Go in http://ecopethandbags.com/contactTestInsert.php , this time, I inserted the server behavior "Insert record".

    Click again on the send comments"" button.

    You will see the naughty message as "'firstname' column cannot be null" in a simple white page.

    My question is:

    How can I insert the form PHP records in my database and take advantage of validation of form as well in http://ecopethandbags.com/contactTest.php

    I enclose files.

    Thank you very much for your help!

    boloco wrote:

    My question is:

    How can I insert records in the form of PHP in my database and enjoy beautifully like form validation in http://ecopethandbags.com/contactTest.php

    Use a simple PHP logic to merge the scripts.

    Dreamweaver automatically updates the server behavior code insert a record into the upper part of the script. You have to adapt so that the validation is done first. If the validation is successful, use the server behavior insert record. If not, display the form again.

    if (array_key_exists('send', $_POST)) {
      // validate the form input
    
      if (!$suspect && empty($missing)) {
      // send the mail
    
        if ($mailSent) {
        unset($missing);
        // insert the Insert Record server behavior code here
        }
      }
    }
    
  • PHP form validation and Radio button group

    Hi David,

    I'm trying to set the initial state of a group of radio voice against zero.

    Please look at the file http://ecopethandbags.com/contact.php . The initial state is set to 'No'

    In Dreamweaver, I've set the initial state to 'off '.

    I don't understand the code for radio buttons in my folder (see attachment).

    What I'm trying to do is to have the radio initially disabled but necessary task.

    I have 2 questions:

    (1) - how can I control the initial state of the radio group when I use PHP form validation?

    (2) - how can I set the validation, when one of the radio buttons is not verified by the user, a warning flag like "Please make a selection" appears.

    Thank you very much!

    Just change the following section of code:

    
    

    Remove the! $_POST. Like this:

    
    

    Checked = "checked" will be inserted in the code if the form has been sent, but no radio button has been selected.

  • Spry form validation

    Given that Adobe no longer supports the Spry framework, what do you recommend that I use to validate a form of box?  Not really that in JavaScript or jQuery.  I use DW CC.

    If you use HTML5 forms, add the necessary attribute to your required fields.  It is pretty well supported by most modern browsers, but there is a variability of x-browser in how works.

    jQuery validation is a good method of form validation client-side little but it is dependent on browser and like Spry was, easily beaten by disabling JavaScript.

    The best and most reliable to validate forms is with code (PHP) server in your form-to-email processing script-side.

    Nancy O.

  • Form validation - best method?

    Hi all

    Just curious what people think is a good and simple method of form validation, we can use these days. BTW: I know some php if that helps...

    PHP validation is certainly the best way to do it, and using the native PHP filters makes it almost too easy. You know about them?

    http://NET.tutsplus.com/tutorials/PHP/sanitize-and-validate-data-with-PHP-filters/

  • Spry form validation Date with default value error

    The spry form validation below was created with DW CS6

    I created an HTML form and displayed with PHP to a MySQL database.  One of the lines of form is to enter a date.  This line uses a 'out of the box' sprytextfield data validation without changes to its CSS or JS:

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > Date beginning? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" >

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    < script type = "text/javascript" >

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    < /script >

    On request, the form value is captured via PHP and date format is converted to a format of MySQL before entering in the database.

    PHP

    $servComDate = date ("Y-m-d", strtotime($_POST['servComDate']));

    It all works perfectly.

    Now, I created another page with a HTML form to change information.  First, PHP takes the field in the database and converts it to MySQL format to the format used in the sprytextfield above, in which it was created.

    PHP

    $servComDate = strftime ("% m/%d/%Y", strtotime ($row ["servComDate"]));

    Then the HTML form is filled with existing value

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > if the Service is coming soon, do you know when the service will begin offered? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" value = "<?" PHP echo $servComDate;? > ">"

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    By filling in the form with existing value appears with the right in the box format, it shows these 'mistakes ':

    value is required. Format invalid.

    As I said above, I have not changed the CSS or JS that is loaded with the Spry textfield, so I don't get that here.

    I'm obviously something wrong with pre-filling a Spry textfield with a default value.

    What is the real need have a default value on a Textfield of Date Validation Spry?

    Thanks in advance!

    Make sure that, in the page change the constructor looks like

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    The following works fine for me

    ">

    A value is required. Format invalid.

    GRAMPS

  • Reminder of form Validation?

    I use a cfform and tags cfinput for form validation, and I wonder if it is possible to use jQuery to take action based on the results of the validation.

    Specifically, I want to disable the submit button when it is selected so that the user doesn't click on it more than once, but if there are errors on the form, I would like to re - activate the submit button.

    Is it possible to do using the built in validation of the CF8 form or what I need to use something like jquery validation plugin to achieve this?

    I know that I can use either jquery or coldfusion for the validation of the form, but I was trying to understand, what if I use coldfusion for form validation client side, these coldfusion functions return a value that I can acres that indicates if the validation of coldfusion you found errors?

    If you are uncomfortable with JQuery, I even recommend you not try to use the validation client-side form CF.  It is expected a little for people who are not comfortable with writing scripts on the side of client, but still need [something] on the client side.

    validation validation is client side, that is an SQL INSERT statement: designed for those who cannot do it themselves.  As such they are very simplistic and too pretty 'blackbox' because they are not intended to be part of a comprehensive solution.

    To avoid if one peut DIY.

    --

    Adam

  • Coldfusion form validation using with image onclick = "window.document.forms [0] .submit ();" »

    Hello world

    I would use Coldufusion cfform validation submit the form with a picture and onclick = "window.document.forms [0] .submit ();" "When I try the form is sent, but without validation cfform.js.

    When you are not using a < cfinput type = "submit" > it seems to bypass the coldfusion form validation.

    Is it possible to submit a form without using a < cfinput type = 'submit'... > with standard Coldfusion form validation? All return?

    CF 8

    Windows 2003

    IIS 6

    Thanks in advance for any help and sorry for my terrible English

    Jean-Jacques.

    jjdonate wrote:

    Hello world

    I would use Coldufusion cfform validation submit the form with a picture and onclick = "window.document.forms [0] .submit ();" "When I try the form is sent, but without validation cfform.js.

    When you do not use a seems to work around coldfusion form validation.

    Is it possible to submit a form without using a with standard Coldfusion form validation?

    This is the expected behavior. Validation of cfform.js is designed to be triggered by the form's onSubmit event. However, there is something that you could use.

    Include a submit button in the form. Open the cfm page in the browser. Use the button submit to check the validation works as required. Here's a simple example to illustrate.

    Look at the source code. You will see the validation script that ColdFusion automatically generated for the form's onSubmit event. Copy the script in your CFM page and call its function in the onClick event.

    The above example becomes now (with the help of an onClick)

    The Javascript line "if (_CF_checkf (f)) window.document.forms [0] .submit () to" ensure that the form is sent only when validation is successful. "

  • Simple form validation

    Hi, I'm doing a simple form validation, but I get this error:
    "Error #1010: a term is undefined and has no properties."

    By using this code:

    movNewsletter.btnEnviar.addEventListener (MouseEven t.MOUSE_DOWN, functCheckForm);

    function functCheckForm(event:MouseEvent):void {}
    If (movNewsletter.inputNome.text == "" |) movNewsletter.inputEMail.text == "") {}
    movNewsletter.msgSucesso.txtSucesso.text = 'O Nome e o preenchimento required sao email';
    } else {}
    trace ("Hello");
    }
    }


    If I don't write anything everything is good, but if I write just one of the fields, or the two of them, the error appears.

    Thank you!

    Go to your publication of Flash settings and select the option to enable debugging.  The error message should include the line number where the error occurs.  What you need to do, is to trace each object involved in this line to see where you might miss an instance name for something.

  • In head form validator script, error

    When I use the window/Behaveiors/to create a form validator, Dreamweaver CS5 puts the script in the page's head and seems to work ok. But when I validate with the W3c page, it says there are errors with the code and Dreamweaver has created what I have no idea what to do to put right, so could someone please help. It is code generated by Dreamweaver, all other pages have passed with flying colors!

    < script type = "text/javascript" >
    function MM_validateForm() {//v4.0
    If {(document.getElementById)
    var i, p, q, n, test, num, min, max, errors = ", args = MM_validateForm.arguments;
    for (i = 0; I <(args.length-2); I += 3) {test = args [i + 2]; val = document.getElementById (args [i]);
    If (val) {n = val.name; if ((val=val.value)! = "") {}}
    If (test.indexOf ('isEmail')! =-1) {p = val.indexOf (' @');}
    If (p < 1 | p ==(val.length-1)) errors +='-' + nm + "must contain an e-mail address. \n » ;
    } Else if (test! = 'R') {num = parseFloat (val);
    If (isNaN (val)) errors +='-' + nm + 'must contain a number. \n » ;
    If (test.indexOf ('inRange')! = - 1) {p = test.indexOf (': ');}
    min = test. Substring(8,p); Max = test. Substring (p + 1);
    If (num < min | max < num) errors +='-' + nm + must contain a number between "+ min +" and "+ max +".. " \n " ;
    }} ElseIf (test.charAt (0) == 'R') errors += '-' + nm + ' is required. \n " ; }
    } If (errors) alert ("the following error occurred: \n'+errors");
    document. MM_returnValue = (error == ");
    } }
    < /script >

    If the script works well in all browsers, you could put it in an external JS file and link to it, then the W3C validator will not find an error.

    If you do not already know, find out how to do it:

    http://www.Hypergurl.com/jsfiles.html

  • Form validation works on a page, but not the other...

    Hope someone can help with this.

    I have a page below with a load of contact forms that all work well:

    http://www.goodsafariguide.com/judges/judges.php

    I have corrected to re-create (it is true that for the most part by Save under...) same features here:

    http://www.goodsafariguide.com/AwardsSite/judges/

    They do not work when trampled in correctly, but there is a little problem with validation.

    Basically when you complete a form properly, the page reloads with accordion of the closed form. When you open it upwards, his watch the ugly error in the search at the top of the form.

    Any ideas what is causing to act like that, as opposed to the way it works in the first link?

    Thank you.

    Iain71 wrote:

    ....

    I have corrected to re-create (it is true that for the most part by Save under...) same features here:

    http://www.goodsafariguide.com/AwardsSite/judges/

    They do not work when trampled in correctly, but there is a little problem with validation.

    When you look at the source code, I emphasize that - unlike the first page - this a doesn´t contain all references to uninstall form validation libraries ("... / includes/tng/scripts/FormValidation.js"and"'... / includes/tng/scripts/FormValidation.js.php '), which means that the work of can´t of validation.

    See you soon,.

    Günter

  • DOCTYPE tag above CF form validation javascript

    Hello

    CF 8 looks back the form validation javascript at the top of the page, even before the HTML tag and the tag DOCTYPE validation.  This causes problems with my style sheet.  Do you know any way I can (at least), put my above the javscript DOCTYPE tag that renders the CF?

    Thank you

    David

    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    Include the tag head, to make ColdFusion to place script tags. Something like that

    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.DTD">
    http://www.w3.org/1999/xhtml">
    test page




  • Form validation - DWMX2004

    I tried on my MX2004 on two forms using the form Validation feature but find that when I test it by submitting a text box empty, which has been defined as 'Something' (onClick) demanding, I get the warning that something is needed. But he goes ahead and sends the form without the entrance when I click on the button 'OK' of the warning.

    The corresponding code is:

    < input name = "confirm" type = "submit" id = "validate" onClick = "MM_validateForm ('ck_firstname',", 'R'); " MM_validateForm ('ck_lastname', ", 'R'); MM_ validateForm ('ck_email3', ", 'R'); return document. MM_returnValue' value = "Confirm/update" / >

    How can I prevent deployed invalid entry?

    You used not always correctly the behaviour.  Rather than apply the behavior of three separate times, once for each field, you must apply it once so that it applies to all three fields.  Then, when you look at your code, you will see only a single instance of behaviour MM_validateForm() call.

Maybe you are looking for