Forum Stats

  • 3,826,368 Users
  • 2,260,638 Discussions
  • 7,896,916 Comments

Discussions

Validation only on save (submit) button press

622758
622758 Member Posts: 17
edited Sep 15, 2008 11:07AM in JDeveloper and ADF
Hello everyone,

I have a simple question to ask. I have a create form with serveral required fields and some dependant drop downs. When I select a value in one drop down the form autosubmits and triggers the field validation which immediately displays an error. I do not want this to happen as the user has not attempted to save the record, is there a way to bypass the validation until the save button is pressed?

I tried to set immediate=true for the drop down but this does not work. (Works fine for buttons)

Cheers,

Peter
Tagged:

Best Answer

  • avrom
    avrom Member Posts: 370
    edited Sep 15, 2008 11:07AM Answer ✓
    Oh, if you've got required fields or faces-level validators, you need to [turn off client-side validation|http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_aclientsidevalidate~html/] as well.

    If this still doesn't work, try using showRequired instead of required, and instead use the "Mandatory" setting in your underlying entity object (or view object, if it can't be done at the entity level).

    Best,
    Avrom

    Edited by: Avrom Roy-Faderman on Sep 15, 2008 8:05 AM

    Dont'cha just love the forum software? That link, without spaces, should be

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps <pipe> adfcreate <pipe> af_clientsidevalidate~html

    where <pipe> is the vertical line/flat colon.

Answers

  • avrom
    avrom Member Posts: 370
    http://thepeninsulasedge.com/frank_nimphius/2008/05/07/adf-faces-suppress-validation-on-ppr-request/
    avrom
  • 622758
    622758 Member Posts: 17
    Thanks for the help!

    This looks like the solution but I cannot get it to work. How do I use the PPRPageController in my application?
    I have created the class and set it up in the faces config as a request scope bean but how do I get it to work
    on all pages that need it?

    Peter
  • avrom
    avrom Member Posts: 370
    edited Sep 15, 2008 9:28AM
    Look at EditDepartmentsPageDef.xml:
    &lt;pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="10.1.3.40.66" id="EditDepartmentsPageDef"
                    Package="adf.sample.view.pageDefs"
                    ControllerClass="#{PPRPageController}"&gt;{code}
    
    Hope this helps,
    Avrom
    
    Edited by: Avrom Roy-Faderman on Sep 15, 2008 6:27 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    avrom
  • 622758
    622758 Member Posts: 17
    Ok,

    I got it to work in a test page but it is not working correctly on the intended page. I think the check is happening before this phase because if I take required off it works - it shows the println statement.

    Peter
  • avrom
    avrom Member Posts: 370
    edited Sep 15, 2008 11:07AM Answer ✓
    Oh, if you've got required fields or faces-level validators, you need to [turn off client-side validation|http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_aclientsidevalidate~html/] as well.

    If this still doesn't work, try using showRequired instead of required, and instead use the "Mandatory" setting in your underlying entity object (or view object, if it can't be done at the entity level).

    Best,
    Avrom

    Edited by: Avrom Roy-Faderman on Sep 15, 2008 8:05 AM

    Dont'cha just love the forum software? That link, without spaces, should be

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps <pipe> adfcreate <pipe> af_clientsidevalidate~html

    where <pipe> is the vertical line/flat colon.
This discussion has been closed.