Thursday 26 December 2013

How to do hour and time format restriction for inputText



The below code required for the time format restriction to restrict the time for up to 23:59


<af:inputText label="" id="time" simple="true" value="" contentStyle="width:30px;"                  maximumLength="5">

<af:validateRegExp pattern="([01][0-9]|2[0-3]):[0-5][0-9]" messageDetailNoMatch="Time   Format must match HH:MM" hint="Time Format: HH:MM"/>

</af:inputText>

Thanks..

Wednesday 25 December 2013

af:inputDate disabling the input through keyboard


The below code will use to disabling the keyboard input on af:inputDate


<f:view>

        <af:document title="PanelBoxDemo.jspx" id="d1" binding="#{backingBeanScope.backing_PanelBoxDemo.d1}">

        <af:resource type="javascript">

       function disableDatePicker(evt){

        evt.cancel();

       }

     </af:resource>

            <af:form id="f1" binding="#{backingBeanScope.backing_PanelBoxDemo.f1}">

                <af:inputDate label="Label 1" id="id1" binding="#{backingBeanScope.backing_PanelBoxDemo.id1}">

                    <af:clientListener method="disableDatePicker" type="keyDown"/>

                </af:inputDate>

            </af:form>

        </af:document>
    </f:view>

Thanks..

Disclose the panel Box with a double-click on the header


The below code will use to disclose the panel Box with double-click on the header.


<f:view>

        <af:document title="PanelBoxDemo.jspx" id="d1" binding="#{backingBeanScope.backing_PanelBoxDemo.d1}">

        <af:resource type="javascript">

       function openPanelBox(mouseEvent){

          var pbx = mouseEvent.getSource();

          pbx.broadcast(new AdfDisclosureEvent(pbx, !pbx.getDisclosed()));

       }

     </af:resource>

            <af:form id="f1" binding="#{backingBeanScope.backing_PanelBoxDemo.f1}">

                <af:panelBox text="PanelBox1" id="pb1" binding="#{backingBeanScope.backing_PanelBoxDemo.pb1}">

                    <f:facet name="toolbar"/>

                    <af:clientListener method="openPanelBox" type="dblClick"/>

                </af:panelBox>

            </af:form>

        </af:document>

    </f:view>

Thanks..

Sunday 15 December 2013

How to display Error/Warning/Information/Exception Messages in ADF Applications

This blog we will see how to display Error/Warning/Information/Exception Messages in backing bean and implementation class.

The below example required for displaying error message from backing bean:

FacesContext facesCntx = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error while Execution","Error while Execution");
facesCntx.addMessage(null,msg);


The below example required for displaying warning message from backing bean:

FacesContext facesCntx = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_WARN, "Execute Successfully", "Execute Successfully");
facesCntx.addMessage(null,msg);


The below example required for displaying information message from backing bean:

FacesContext facesCntx = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Executed Successfully", "Executed Successfully");
facesCntx.addMessage(null,msg);


The below example required for displaying warning message from implementation class:

getDBTransaction().addWarning(new JboWarning("Warning Occur"));


The below example required for displaying exception message from implementation class:


throw new JboException("Exception Occur");


Thanks..

Saturday 14 December 2013

Working with different scopes in ADF

This blog we will see how to use the different scopes like Application Scope, PageFlow Scope, Session Scope, Request Scope in ADF.

Request Scope:

FacesContext fcx =FacesContext.getCurrentInstance();
 

// Set Into Request Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx.getRequestMap().put("key","value");
 

//get Request Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx .getRequestMap ().get("key");


Application Scope:

FacesContext fcx =FacesContext.getCurrentInstance();
 

// Set Into Application Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx.getApplicationMap().put("key","value");
 

//get Application Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx . getApplicationMap ().get("key");


Session Scope:

FacesContext fcx =FacesContext.getCurrentInstance();


// Set Session Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx.getSessionMap ().put("key","value");


//get Session Scope value
ExternalContext exCntx =fcx.getExternalContext();
exCntx . getSessionMap ().get("key");


PageFlow Scope:

// Set Into PageFlow Scope value
RequestContext.getCurrentInstance().getPageFlowScope().put("key","value);
 

// Get PageFlow Scope value
RequestContext.getCurrentInstance().getPageFlowScope().get(name);


Thanks..

Friday 29 November 2013

Creating ADF Data Control for Web Services


This blog we will see how to create ADF data controls for web service.

The following steps need to follow for creating ADF data control for a web service.

Step-1:- Create a Fusion Web Application (ADF)
   

Step-2:- Right click on the project and select “New”. Select “Web service” in the left side tab then selects “Web Service Data Control (SOAP/REST)” then click “OK”.

Step-3:- Now you can give the “Name” and “URL” of the data control. (URL contains the wsdl of the service).

Step-4:- Click on “Next”. Then it will display all operations of the service. Now you need to select the operation for which you want to create data control.


Step-5:- Now click on “Next” then it will display all the selected operations. Now you can give the XSD URL and XSL URL for the selected operations.
Note:-  If the XSD URL and XSL URL exist then give else leave it blank.


Step-6:- Now click “Next”. Now it will display the Endpoint Authentication screen. Here you can give the user name and password (if exist) for the data control port.

Step-7:- Now click”Next” then click “Finish”. Now all the existing data control will create.

Now you can use the data controls in your UI screen.

You can download the code:Download
 
Thanks...