AdfRichInputText.getSubmittedValue() instead of AdfRichInputText.getValue().

I was dealing with an interesting bug today and would like to share my experience with you ,

I have a search input text box and a submit button in UI ( all are ADF faces components). Submit button click event calls a javascript method and  process  search query with input text box value.

It works as expected in all browsers except IE 11. So I started debugging on javascript with IE developer tool and noticed that AdfRichInputText.getValue() is null ,but same javascript works for lover version of IE , Firefox, chrome and safari. Then I played with AdfRichInputText.getSubmittedValue() and it returns search query .

Here is the catch. AdfRichInputText.getValue() returns local value and AdfRichInputText.getSubmittedValue() returns submitted value of editable component.Though my request was new and local value holds null and submitted value holds actual value.

But still I don't understand how it worked in other browsers

Reference: 
http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12046/org/apache/myjs/trinidad/component/AdfUIEditableValue.html 

Environment : Webcenter spaces 11.1.1.7 with IE 11 patch
Browser: IE 11


Disable auto-complete feature for editable component.


 
<af:resource type="javascript">
   
      function disableAutoComplete(evt) {
      var comp = evt.getSource();
      comp.setAutoComplete('off');
      evt.close();
      }

    </af:resource>


 <af:inputText label="" id="pt_it1">
<af:clientListener method="disableAutoComplete" type="focus"/>
</af:inputText>

If you are interested to suppress auto-complete feature for browser form, you can refer Frank Nimphius's blog link



Handy code for invocking table selection listener from backing bean.

JSFUtils.resloveMethodExpression("#bindings.<Table binding name>.collectionModel.makeCurrent}",

                                         null,

                                         new Class[] { SelectionEvent.class },

                                         new Object[] { selectionEvent });

Handy code for getting ADF faces component from View root.




    private UIComponent findComponentOnPage(String compId) {

        UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
        root.invokeOnComponent(FacesContext.getCurrentInstance(), compId,
                               new ContextCallback() {
                public void invokeContextCallback(FacesContext facesContext,
                                                  UIComponent uiComponent) {
                    comp = uiComponent;
                }
            });
        return this.comp;
    }

Reference : http://www.oracle.com/technetwork/developer-tools/adf/downloads/58-optimizedadffacescomponentsearch-175858.pdf

Using IN operator in view criteria.


 Unfortunately, there is no declarative way to add IN operator in view criteria.Below code show programmatic way to add in clause in View criteria.

I have created EmployeesViewCriteria in EmployeesView view object and below method appends IN .

    public void filterWithInOperator() {

        ViewObjectImpl vo = this;

        ViewCriteria vc =
            vo.getViewCriteriaManager().getViewCriteria("EmployeesViewCriteria");
        ViewCriteriaRow vcr = vc.createViewCriteriaRow();
        vcr.setConjunction(ViewCriteriaRow.VC_CONJ_AND);
        ViewCriteriaItem vci = vcr.ensureCriteriaItem("DepartmentId");
        vci.setOperator(JboCompOper.OPER_IN);
        vci.setValueMinCardinality(3);
        vci.setValueMaxCardinality(3);
        vci.setValue(0, 10);
        vci.setValue(1, 20);
        vci.setValue(2, 30);
        vc.addRow(vcr);
        vo.applyViewCriteria(vc);
        vo.executeQuery();
        vo.setCurrentRow(this.first());

    }