Please disable your adblock and script blockers to view this page

Search this blog

Monday, 30 June 2014

Using Star Rating component (dvt:ratingGauge) in ADF 12c (12.1.3 new component)

Hello all
As ADF 12.1.3. is out , there is lot of enhancement in UI layer, component for Rating is available in this release i;e rating gauge (dvt:ratingGauge)
see how this rating gauge look like-

1.XML Source- Simple Rating Gauge with Star Symbol

<dvt:ratingGauge id="ratingGauge2" value="2" minimum="1" maximum="5" inlineStyle="width:300px;height:80px;"/>

2. XML Source- Rating Gauge with Circular Symbol


<dvt:ratingGauge id="ratingGauge2" value="2" minimum="1" maximum="5" inlineStyle="width:300px;height:80px;"
                     shape="circle" inputIncrement="half" readOnly="false"/>


2. XML Source- Rating Gauge with Circular Symbol, Rectangular Unselected Symbol



<dvt:ratingGauge id="ratingGauge2" value="2" minimum="1" maximum="5" inlineStyle="width:300px;height:80px;"
                     shape="circle" inputIncrement="half" readOnly="false" unselectedShape="rectangle"/>

Sample Application Based on Departments Table of Default HR Schema



  • Added a column in HR's Departments table for Rating


  • now create model using Departments table and drop on page (page fragment in bounded taskflow)as table and form, select Rating attribute from Data Control and drop as Gauge-->Rating Gauge(Minimum-0 Maximum-9)
  • see on page it is ready to show Rating of Department, but still not able to take input


  • By default rating gauge is readonly means it doesn't take input from user, set readonly to false and set increment (full or half) values
  • So i have tried this, but when i select any rating and commit data, it doesn't reflect changes in Database table, it is still showing previously saved value
  • i don't know why this is happening, so i have used valueChangeListener and set new rating in current row of Department, in this way it is working fine

  •     /**ValueChange Listener to SetRating
         * @param vce
         */
        public void ratingVCE(ValueChangeEvent vce) {
            if (vce.getNewValue() != null) {
                System.out.println("New Rating -" + vce.getNewValue());
                DCIteratorBinding iter = (DCIteratorBinding) getBindings().get("Departments1Iterator");
                iter.getViewObject().getCurrentRow().setAttribute("Rating", vce.getNewValue());
            }
        }
    

  • Now run and enjoy new rating gauge :)

Happy Learning :) Download- Sample ADF Application


Friday, 27 June 2014

Oracle JDeveloper and Oracle ADF 12c (12.1.3.0.0) out (bug fixed and lots of new features introduced)

hello all
ADF & Jdeveloper 12c (12.1.3.0) released with lots of new features and previous (12.1.2.0) bugs are fixed

Bugs Fixed in 12c (12.1.3.0)-

related to af:query, af:tabel filter and scrolling, property inspector, inputlistofvalues, radioGroup, af:message, checkbox, table pagination, context menu, autosuggest in inputlistofValues, shuttle component
Check out complete list of fixed bugs- Bug Fix List



New Features introduced in 12c (12.1.3.0)-

Enjoy some very cool ADF Faces components
  • 30+ chart types, thematic map with zoom and rotation feature
  • new gauge and awaited rating gauge
  • new component af:deck ,like CSS image slider to show multiple child details one by one with slide and fade effect
  • CSS rule for changing button's color and width
  • Export to CSV feature, mouse hover in list view
Check out complete list of features- New In This Release

Happy Learning , Enjoy new Jdev :)

Monday, 23 June 2014

Navigating to (open) specific tab in af:panelTabbed programmatically -Oracle ADF

Hello All,
This post is about a development requirement - how to move (navigate or open) to a specific tab in panel tabbed  in Oracle ADF?
Suppose i have to open second tab of af:panelTabbed on a button click, so see how to do this using ADF Faces
  • Create a Fusion Web application and a page to drop panel tabbed and a button


  • now bind panel tabbed and it's showDetailItem to managed bean, in order to use disclosed property and to get client id
  • See the code to open (disclose) a specific tab of af:panelTabbed
        //Binding of Panel Tabbed
        private RichPanelTabbed panelTabBind;
    
        public void setPanelTabBind(RichPanelTabbed panelTabBind) {
            this.panelTabBind = panelTabBind;
        }
    
        public RichPanelTabbed getPanelTabBind() {
            return panelTabBind;
        }
    
        /**
         * @Method to disclose (open) specific tab
         * Pass the binding of af:showDetailItem that you want to open
         */
        public void setDisclosedFirstTab(RichShowDetailItem tabBind) {
            RichPanelTabbed richPanelTabbed = getPanelTabBind();
            for (UIComponent child : richPanelTabbed.getChildren()) {
                RichShowDetailItem sdi = (RichShowDetailItem) child;
                if (sdi.getClientId().equals(tabBind.getClientId())) {
                    sdi.setDisclosed(true);
                } else {
                    sdi.setDisclosed(false);
                }
            }
            AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabBind);
        }
    

  • Now see the code written on button action- here i have checked that which tab is currently disclosed? and based on that i have passed next tab binding to this method



  •     /**Method to be called on Navigate Button
         * @param actionEvent
         */
        public void naviGateButtonAction(ActionEvent actionEvent) {
            if (firstTabBind.isDisclosed()) {
                setDisclosedFirstTab(secTabBind);
            } else if (secTabBind.isDisclosed()) {
                setDisclosedFirstTab(thirdTabBind);
            } else {
                setDisclosedFirstTab(firstTabBind);
            }
        }
    

  • now run your page and see navigation in af:panelTabbed

 Cheers Happy Learning :) Sample ADF Application