Monday, September 30, 2013

New Custom Popup Can be attached with ADF UI LOV

New Custom Popup Can be attached with ADF UI LOV

We can Add our custom popup on Declarative LOV(af:inputListOfValue).





ADF 11G : Implement Multiple Selection using View Criteria

ADF 11G : Implement Multiple Selection using View Criteria











Friday, September 27, 2013

Display the Selected Row in ADF Table

How to Display the Selected Row in ADF Table?



We can display the current(Selected) record number along with the tolal Number of record on any of the ADF table.



#{bindings.EmployeesView1Iterator.rangeStart+bindings.EmployeesView1Iterator.currentRowIndexInRange+1}/#{bindings.EmployeesView1Iterator.estimatedRowCount}

ADF Table Column

Sometimes we wanted to leave some space before the First Column of any ADF table.
Here is the solution for that.





Get Old value through ValueChangeEvent

Get Old value through ValueChangeEvent :


    public void Vce(ValueChangeEvent vce){
        System.out.println(this.getIt1().getValue().toString());
        System.out.println("New Values "+vce.getNewValue());
        System.out.println("Old Values "+vce.getOldValue());
        }


Thursday, September 26, 2013

ADF 11G : Clearing af:query Programatically

  ADF 11G : Clearing af:query Programatically

  public String customClearAFQuery() {
     
        RichQuery queryComp = qryId1; //qryId1 is the Id of af:query
        QueryModel queryModel = queryComp.getModel();
        QueryDescriptor queryDescriptor = queryComp.getValue();
        queryModel.reset(queryDescriptor);
        queryComp.refresh(FacesContext.getCurrentInstance());
        return null;
    }

ADF 11G : Check if VO is Dirty

ADF 11G : Check if VO is Dirty

Approach 1: Click 

Approach 2: 
    public String save() {
        System.out.println(isDirty()); //Call the method to check if VO is Dirty
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            return null;
        }
        return null;
    }


    public boolean isDirty(){
    boolean dirty=false;
    BindingContext bindingCtx = BindingContext.getCurrent();
    DataControlFrame dataCtrlFrame = bindingCtx.findDataControlFrame(bindingCtx.getCurrentDataControlFrame());
    Collection dataCol = dataCtrlFrame.datacontrols();
    for (DCDataControl dcDaCtrl : dataCol) {
    if (!dcDaCtrl.getName().equals("NeelmaniAMDataControl1") && !dcDaCtrl.getName().equals("NeelmaniAMDataControl2"))
        dirty = (dcDaCtrl.isTransactionDirty()==true) ? true :false;
    }
    return dirty;
    }

ADF Faces : Handling Dialog

 ADF Faces : Handling Dialog









   public void okAction(DialogEvent event){
         
            if (event.getOutcome().equals(DialogEvent.Outcome.yes)){
                           System.out.println("Component Regreshing...");
            }
            else if(event.getOutcome().equals(DialogEvent.Outcome.no)){
                           System.out.println("Canceled");
                }
    }

How to Invoke commandButton's action programatically at Runtime?

 How to Invoke commandButton's action programatically at Runtime?

   public String initiate() {
     
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIViewRoot root = facesContext.getViewRoot();
     
        RichCommandButton button = (RichCommandButton) root.findComponent("cb2"); //"cb2" is the Id of the CommandButton
        ActionEvent actionEvent = new ActionEvent(button);
        actionEvent.queue();
        System.out.println("Exiting from initiate()....");
        return null;
    }

ADF 11G : Pagination

Pagination for ADF Table has been introduce by Oracle in Jdeveloper 11.1.1.7 Version.

We Need to set the ScrollPolicy attribute to Page.

Changes Needed:

scrollPolicy=”page” autoHeightRow=”0”







Browser Compatibility Issue

Issue : The Current Compatibility Setting is not supported. Disable Compatibility View before running this web page.

Solution :

put following tag inside web.xml:





Rendered Vs Visible

Rendered Vs Visible


RENDERED: Making a field attribute's property RENDERED as false (Rendered=false) does NOT make the component to be part of JSF Tree.

VISIBLE: Making a field attribute's property VISIBLE as false (Visible =false) make the component to be part of JSF Tree, is sent to the client as part of HTML and is HIDDEN.

Skinning : How to Change Font Face and Color of UI Component under the PanelFormLayout?

Skinning : How to Change Font Face and Color of UI Component under the PanelFormLayout?



/*af|panelFormLayout::content-cell {font-size:200px;}*/

af|panelFormLayout::label-cell {font-size:14px; font-weight: bold;}
af|panelFormLayout::label-cell {color:rgb(63, 100, 180);}

Friday, September 20, 2013

JS : Warning on Browser Back Button

JS : Warning on Browser Back Button.
This Approach will not disable the browser back button. It will just show the warning message.













**********************************************************

public class PageB {
    private RichForm f1;
    private RichDocument d1;
    private RichDecorativeBox db1;
    private RichPanelHeader ph1;
    private RichCommandButton cb1;
    private RichCommandButton cb2;
    private RichPanelBox pb1;

    public void setF1(RichForm f1) {
        this.f1 = f1;
    }

    public RichForm getF1() {
        FacesContext fctx = FacesContext.getCurrentInstance();
        ExtendedRenderKitService service = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
        service.addScript(fctx, "window.onbeforeunload = function () { if (logoutAction==0) {return 'Are you sure for going Back:: Neelmani Jaiswal'}; }"); 
        return f1;
    }