ADF |  Duplicate validation in the field.

Hello

Jdev: 11.1.1.1.6.0

I have a requirement to allow the user to edit the data in an editable table. My question is, for one of the column, I should not allow the user to enter the duplicate on the JSF page levelvalue.

It is not a primary key field. How to validate the duplicate column during the click on the button Save.

Validation should work only on the page, not DB or OS level.

Where is the duplicate, it should show an error message.

I'm looking for the JAVA Bean code, instead of using the unique key validator in business-> validator entity rules.

Please help me with the java code if any knows

Thank you

Hello

Finally I got the answer, thank you for helping me.

I used the code is:

private void ItemIdValidator() {}

P2PWebAMImpl am = (P2PWebAMImpl) resolvElDC ("P2PWebAMDataControl");

PoShipmentLinesVOImpl shipmentlineView2 = (PoShipmentLinesVOImpl) am.getPoShipmentLines2 ();

DCIteratorBinding dciter = (DCIteratorBinding) bindings.get ("PoShipmentLines2Iterator");

Line r = dciter.getCurrentRow ();

Number of itemidValue = (Number) r.getAttribute ("ItemId");

Row [] filteredRowsInRange = shipmentlineView2.getFilteredRows ("ItemId", itemidValue);

int i = filteredRowsInRange.length;

String msg = "ItemId with the same number found. Please select another ItemId. « ;

JSFUtils.addFacesErrorMessage (regClientIDPrefix + msg);

{if(i>1)}

throw new ValidatorException (new FacesMessage (FacesMessage.SEVERITY_ERROR, msg, null));

}

}

Private Object resolvElDC (String data) {}
      FacesContext fc = FacesContext.getCurrentInstance ();
      Application app = fc.getApplication ();
      ExpressionFactory elFactory = app.getExpressionFactory ();
      ELContext elContext = fc.getELContext ();
      ValueExpression valueExp =
          elFactory.createValueExpression (elContext, "#{data." + data + ".dataProvider}", Object.class);
      Return valueExp.getValue (elContext);
  }

Sainaba...

Tags: Java

Similar Questions

  • How to make a request for Validation on the field of comments in BPM Worklist task details Page

    Hello
    I am newbie to SOA 11 g.

    I use SOA 11 g and Jdev 11.1.1.3 for development. I created a human with two results (APPROVE, REJECT) and task able to display the page the task details in the BPM list. I have the comments of default section that comes by 'Auto generation of ADF Taskflow' in the Task Details page. This comments section will display the comments of several users who have access to the task. I want to add validation for the field of comments as below-

    (1) to DISMISS the action, we must check whether or not the APPROVER had provided the reason for REJECTION in the comments field. If this isn't the case, we need to display a popup asking him to provide observations of REJECTION.
    (2) on the action to APPROVE, no need to check for comments, so no validation is necessary.

    Can someone give me some ideas how it is possible.

    Thank you
    Udaya Neeliahgari

    Hello
    Try the following...
    In the composite open y'r process bpel... and then to expand the human task... you will notice a task entitled just before the initiateTask run the following two copy operation in the task of AssignTaskAttributes within the scope of the human task.

    IMP Note: The variable is the variable initiateTaskInput of the human task field. Don't assign not on on the global variable

    1 assign a string value "REJECT" in the expression (assuming that you do so that the result of REJECTION) and assign it to the variable

    /TaskService:initiateTask / task: task / mission: systemAttributes / task: preActionUserSteps / task: preActionUserStep / task: results

    2 assign the string value "PROVIDE_COMMENTS" in the expression and assign it to the variable

    /TaskService:initiateTask / task: task / mission: systemAttributes / task: preActionUserSteps / task: preActionUserStep / task: userStep

    view the .bpel file source y'r and make sure that you see something like the following:




    Query = "" / taskservice:initiateTask / task: task / task: systemAttributes / task: preActionUserSteps / task: preActionUserStep / task: result "/ >"




    Query = "" / taskservice:initiateTask / task: task / task: systemAttributes / task: preActionUserSteps / task: preActionUserStep / task: userStep "/ >"

    Just deploy the app... and when you try to dismiss... it should appear the message.

    concerning
    Raja

  • How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

    How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

    If it's an array you want to deduplicate then here is a script [for use in the Script Processor] I prepared earlier:

    var result = new Array();

    var added = new Object();

    If (input1 [0]! = null)

    {

    for (var i = 0; i)< input1[0].length;="">

    {

    var point = input1 [0] [i];

    If (! added [item])

    {

    added [item] = 1;

    result [result. Length] = item;

    }

    }

    }

    Output 1 = result;

    Kind regards

    Nick

  • problem with validation in the field with the radio button type in create profile jsp page

    Hello

    Kindly help me with the validation of a field with the type option button in the createProfile jsp page. Its actually not to validate the sex with radio button field.

    The code is as follows...

    < % @ page language = "java" contentType = text/html"; charset = ISO-8859-1"

    pageEncoding = "ISO-8859-1" % >

    <! – this taglib used to access dsp tags - >

    < %@taglib uri = "" / dspTaglib "prefix ="dsp"% >"

    < dsp:page >

    < dsp:importbean bean = "/ atg/userprofiling/ProfileFormHandler" / >

    < dsp:importbean bean = "/ atg/dynamo/drop/ErrorMessageForEach" / >

      <! DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    < html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > < /title > user registration Page

    < / head >

    < body >

    < dsp:form id = "registerForm" method = "post" action = "registration.jsp" >

    < div >

    < div > if please fill in all fields below and click Save

    button. < / div >

    < br / >

    < table >

    < tbody >

    < b >

    < td width = "150" > name < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.firstName"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    Last name < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.lastName"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    < td > username < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.login"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    password < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.password"

    MaxLength = "30" size = "25" type = "password" required = "true" / > < table >

    < /tr >

    < b >

    < td > confirm password < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.password"

    MaxLength = "30" size = "25" type = "password" required = "true" / > < table >

    < /tr >

    < b >

    Identification of Email < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.email"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    Sex < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.gender"

    Type = "radio" required = "true" > male < / dsp:input > < dsp:input

    Bean = "ProfileFormHandler.Value.Gender" type = "radio" "

    required = "true" > female < / dsp:input > < table >

    < /tr >

    < b >

    < td colspan = "2" > < dsp:input bean = "ProfileFormHandler.create"

    Type = "submit" value = "Save" / > < dsp:input

    Bean = "ProfileFormHandler.createSuccessURL" type = "hidden"

    value = "index.jsp" / > < table > "

    < /tr >

    < b >

    < td colspan = "2" >

    < ul >

    < dsp:droplet name = "ErrorMessageForEach" >

    < dsp:param bean = "ProfileFormHandler.formExceptions"

    name = 'exceptions' / >

    < name dsp:oparam = "output" >

    < li > < dsp:valueof param = "message" / > < /li >

    < / dsp:oparam >

    < / dsp:droplet >

    < /ul >

    < table >

    < /tr >

    < / tbody >

    < /table >

    < / div >

    < / dsp:form >

    < / dsp:page >

    < / body >

    < / html >

    Use code next, may be you do not value attribute set and causing a problem (data inconsistency problem) or case mismatch while storing data in the repository.

    <%Boolean checked = true;%>

    Sex:

    Male

    Female

    I do not know what will radio back button if the value is specified: a boolean value or the value aim to display (in your male cases),.

    If the problem is fixed, undo the change and please let me know what value he sent in your case.

    Please

    Thank you

    Nitin.

  • Strange behavior of validation with the fields 'user entered - required '.

    I have a situation where I have a form with several 'user entered - required"text fields  Some required fields are pre-populated by a server process before being presented to a user in the workspace.  When the user fills the remaining fields and submits the form (by clicking the button "Done" in the workspace), the of standard validation 'required' message, even if all required fields contain data.

    The shape where I discovered this problem is moderately complex, so I built a form simple and process to try to understand what is happening.  The simple form contains exactly two text fields, both are user entered - required.  A field is filled by a server process when the task of the associated workspace is called, B field must be filled in by the user.  There is no script customized beyond the bridge of form and a Submit button.  It's about as simple as it gets.

    If the field is filled, and then the user fills B field and click on 'Finish', the message appears saying 'at least one required field is empty... "even if the two fields contain data.

    If I return to the form and remove the B field (and redeploy the form and remember the process), to field is pre-filled and the user clicks on 'Finish', no message is displayed and the form is sent.

    As far as I know, the built-in for required fields validation works correctly only if all fields are pre-filled or none of them are pre-filled.

    Can someone explain what is happening?

    EDIT: I forgot to mention, I also created and configured an extract of the data for the simple form.  The data preview only contains a value for the to field.  When displayed in the preview of the Designer tab, everything works as expected.

    After a little work I have a better understanding of what is happening and a solution.  I have scripted several calls to xfa.host.messageBox (...) on different events.  It turns out that the pre-filled fields are not the culprit - they have values as expected.  The problem is with the non-pre-filled fields, and and a subtle behavior of the event model that causes a problem when using the workspace INTERFACE (at least on SS3).  Field values may not be resolved until a field loses focus (for example when a user moves to another field, or click a button).  Form used outside of the workspace, by clicking a "submit" button causes the focus to move to the button, which causes the values to be bound to the fields.

    Solution: Use an indirect Submit on the form button and submit indirect click handler used (in addition to your normal code):

    xfa.host.setFocus(null);
    xfa.resolveNode("[[fully qualified name of the real submit button]]").execEvent("click");
    

    Working space should detect and then make an Indirect button and run the associated click Manager, claiming in turn the form submit true button.

    This is where begins the next bit of fun: there is a bug in the form bridge (at least in the ES3 version) code prevents him from indirect detection submit buttons when you use JavaScript as a language Manager click of the button and

    Here is my hack to solve this issue:

    1. Open the 'ContainerFoundation_JS' script in the Script of Designer Editor
    2. Ignore the warning at the top of the file
    3. Find the named function: isIndirectSubmitEvent (it's on the line 1512 or something)
    4. Change the line that reads:
      • if (script.indexOf(button.name + ".execEvent") != -1) {
        

        TO:

        if (script.indexOf(button.name + ".execEvent") != -1 || script.indexOf(button.name + "\").execEvent") != -1) {
        
    5. Save and deploy the form

    If there is a better way to achieve this, please share.

  • Validation in the field of the OFA

    Hello


    I've created a field LOV and property to true.
    I also created apply then the Create button.
    If no value is selected in LOV and if I click on the button apply the field gets validated.
    But when I clicked on cancel the null field is also get validated.

    I wrote the code to redirect to another page when I click on Cancel.
    How to achieve this even my LOV field is null.


    Thanks in advance,
    Roselyne

    Hello

    -To set the button cancel:

    Disable validation on the server side: * real *.
    Disable validation on the Client side: * real *.

    Concerning
    Meher Irk

  • Validation in the field for the city of delivery

    Hello everyone,

    I need a validation of field for the maritime City field. But as you know this field is not directly accessible. You have any tips how I can do?

    For any help, I would be very grateful.

    Kind regards
    Dmitri

    Dmitri, I don't think that it is possible for field validation on the city of delivery.

  • Find duplicate records in the fields.

    Hi all

    There are 5 A B C D E of type Varchar fields in my table x. 4 A B C D fields are key fields.

    I would like to ask two copies of the fields in the fields A B C D.

    Please suggest me.

    Thank you
    KSG

    Hello
    Simply:

    SELECT A, B, C, D, Count(*)
      FROM your_table
     GROUP BY A, B, C, D HAVING Count(*) > 1;
    
  • Validation error: the field types incompatibilities.

    Hi all

    I coded an integration to export data from the API in bulk Eloqua REST and it worked well before.

    But recently, when I try again to launch an export, I could only successfully to POST an export. I met a WebException when you try to VIEW a synchronization for export.

    The exception message is: "the remote server returned an error: bad request (400)"

    And the JSON response is:

    {

    {"failures": [{"field": "'status' ',' forced':" "Validation error: incompatibilities of field types."}]}

    I haven't changed anything recently, but it wouldn't work any longer.

    Is there something different for the API in bulk?

    Any suggestions for this exception?

    Thank you

    Biao

    This was announced in the recent release (Archives) what's new in Oracle Eloqua?.

    Validation of strict type for JSON serializer is now enabled (see API in bulk in the notes above), so it provides you with an explanation of what is wrong, by design.

    Make sure that your JSON is valid and everything should work fine.

  • Question of validation for the field date/calendar

    I want to use the regular Date field, but not sure what is the best way to validate user input.

    The display Format that I use is "DD MMM YYYY",

    If the user is using the calendar to select the date, no problem.

    However, the user can also type things in this area without using the built-in calendar,

    What should I do when the user types "MM/DD/YYYY" (eg. "19/09/2011")?

    How to validate that?

    If I put a validation schema "DD MMM YYY" in the validation tab, it doesn't seem to work.

    so, please help.

    Add the same schema in the Validation model/edit section and make sure that you include a model of Validation Message text in the dialog box informing the user that forms await you. If they enter the wrong format your message text appears then make it informative.

    Paul

  • Resource form: conditional validation to the fields

    Hello

    I have a form of resource that has a combobox and when the user chooses the 'Temporary' value, for example, the user must fill the two other fields: dates of start and end Date I created an adapter and he attributed the events before insertion and prior update.

    Problem: In the form of Assistant resource request events are not triggered, and this will happen only after approval of the application.


    You have an idea to implement which (if possible, without customization JSP)?


    Thank you


    Renato Guimaraes.

    Forms of the object not get inserted until the entire application is submitted, so you won't be able to use an adapter of entity on the object of data for the form of resources. It will not be inserted when you need validation performed.

    -Kevin

  • Field validation for the number of characters and integers for NRIC

    Hi all
    I have a requirement for field validation NRIC number, I put the validation in the field as first digit is followed by a character of 7 integer digits and last digit as the character. The format is S7975363G. The user is not leave the key in full for 1 and the last digit. Please let know us if this is possible.
    Thanks in advance.

    Try the following domain validation:

    Len ([]) = 9 AND FindOneOf (Mid ([], 1, 1), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + FindOneOf (Mid ([], 9, 1), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') = 2 AND Len (1 * Mid ([], 2.7)) = Len (Mid ([], 2.7))

    Replace the NRIC wearing the correct domain name

  • Simulating a "Required" conditional on two fields using the field Validation

    I'm trying to 'require' users to fill in the Email address field or the primary phone when you create a Contact record. I had an idea of how do, but couldn't make it work. Any suggestions?

    Thanks in advance,
    Charley


    I working on the screenplay of is as follows:
    The customer wants to check on two fields on a contact record - the main phone and primary e-mail address fields. The envy of their users must complete one or other fields. This kind of conditional required parameters being out of reach for the workflow, I tried to get validation in the field to work. I tried to implement something like the following as the validation rule:
    [example as WorkPhone <>] is Null AND that [< ContactEmail >] is Null
    Then a validation message is displayed informing the user that one or the other needs remaining.

    Check out this thread
    Re: Contact Validation field (e-mail, work phone, Mobile phone #)

  • Validation of the user interface of by-pass when the click on the menu

    Hello

    Scenario:

    Go to any entity change the navigation bar page, having required validations on the fields of the user interface.

    Now, try to browse page by clicking on an item of menu registered in the recent items menu in the Shell of the user interface.

    The required validation is triggered.

    Earlier we faced a similar question of the necessary validation is triggered when the click on the button 'Cancel' in the edit page. At this point, we immediately applied = true to the Cancel button and the problem is solved.

    Is there something on similar lines for the validation of UI bypassing during the click on the recent items?

    Thank you
    Ravi

    Hello

    Earlier we faced a similar question of the necessary validation is triggered when the click on the button 'Cancel' in the edit page. At this point, we immediately applied = true for > Cancel button and the problem is solved.

    It is the same for the af:menuItem IE (immediately apply = "true" to get around the validation of the user interface [client side], its support by almost all components of the adf).

    Kind regards
    Sicard.

  • Validation of custom field obj. 4: value of a field that is other req.

    Hi all

    I worked on a problem of validation of field for awhile. I have a custom on K4 drop-down list. This list of choices has two values YES and NO (a checkbox does not meet the conditions). What I do is if dropdown = "YES" then FieldA, FieldB and FieldC are needed elsewhere are not necessary. FieldA = FieldB = Date and FieldC = (short) text change. I tried many ways to validate in the fields A, B and C with statements such as IIf (list of choices = ValRech (list of choices, 'YES'), FieldA <>NULL, FieldA) or Iir (FieldValue (selection list) = 'YES', FieldA <>NULL, FieldA) etc... These are just my past attempts at this time I am trying just to random things to try to make it work. I'm probably using incorrect syntax (even if it passes the syntax checker). If anyone has any suggestions let me know. Also if I did not specify what it is I'm trying to let me know and I'll try to clarify.

    Thank you
    Z

    Hello

    If I understand correctly, you want this feature:

    If drop-down list = NO => any values are contained in the to field, B and C.
    If drop-down list = YES-online field is not null and field B is not null and C field is not null

    To trigger the validation when the value of the drop-down list, then you must configure the Validation in the field to the list of choices:

    [] = LookupValue("Picklist","NO") OR (Len ([]) > 0) AND Len ([]) > 0 AND Len ([]) > 0

    You have to put the validation also on Field_A and Field_B and Field_C, because in the case of an update of the, let's say, Field_B, you should prevent Field_B is deleted.
    If someone updates only Field_B and it does not change the value of the drop-down list, the validation on the choice list expression is not evaluated.

    Simona

Maybe you are looking for