Skip to Main Content

Security Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Custom Validation field OIM 11gR2 PS2

828718Dec 29 2014 — edited Jan 6 2015

Hi

I need validate if a document number exist into oim database, if case exist, a message error need be shown.

I am doing a custom validation for field in Create User form. I created a custom code and I deployed the oracle.iam.ui.custom-dev-starter-pack.war with the custom libs. I changed the sandbox configuration to use the custom validation field.

private static final String DOCUMENT_ATTRIBUTE = "DOCUMENTO__c";

private UIComponent document;

...

gets and sets

...

    public void validator(FacesContext facesContext, UIComponent uiComponent, Object object) {

     

      if(uiComponent.equals(document)){

       

        DocumentValidator valid = new DocumentValidator();

        String login = new String();

        String documentToValid = new String();

        documentToValid = FacesUtils.getAttributeBindingValue(DOCUMENT_ATTRIBUTE,String.class);

        login = valid.docValidate(documentToValid);

        if(!login.isEmpty()){

          facesContext.addMessage(uiComponent.getClientId(facesContext),

                                              new FacesMessage(FacesMessage.SEVERITY_ERROR, EXIST_DOC+" - "+login+" document : "+documentToValid, null));

        }

        else{

          FacesUtils.partialRender(document);

        }

      }

}

Sandbox configuration:

Data Component - Catalog / Text field imput value with Label

<mds:insert parent="_xg_pfl5" position="last">

      <af:inputText xmlns:af="http://xmlns.oracle.com/adf/faces/rich"

  value="#{bindings.DOCUMENTO__c.inputValue}"

  label="#{bindings.DOCUMENTO__c.hints.label}"

  required="true"

  columns="#{bindings.DOCUMENTO__c.hints.displayWidth}"

  maximumLength="#{bindings.DOCUMENTO__c.hints.precision}"

  shortDesc="#{bindings.DOCUMENTO__c.hints.tooltip}"

  id="dtrt_dc_8912853077"

  autoSubmit="true"

  valueChangeListener="#{pageFlowScope.cartDetailStateBean.attributeValueChangedListener}"

  helpTopicId="Documento"

  validator="#{backingBeanScope.userformbean.validator}"

  binding="#{backingBeanScope.userformbean.document}">

         <f:validator xmlns:f="http://java.sun.com/jsf/core" binding="#{bindings.DOCUMENTO__c.validator}" />

      </af:inputText>

   </mds:insert>

...

So, this metod getAttributeBindingValue is returning null . I dont know if some configuration wrong.

Can help me ?

This post has been answered by Abhishek Singh 'J_IDM' on Dec 29 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2015
Added on Dec 29 2014
5 comments
486 views