Skip to Main Content

Java Development Tools

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!

Creating new background style for table data-row selected

FredericoSBNov 28 2013 — edited Dec 13 2013

Hello everyone,

I created this post because i can't create a new style for a table data-row selected background color. I've downloaded and modified the code from this website (http://lucbors.blogspot.nl/2012/02/adf-11g-even-fancier-multi-master-multi.html) but it is not working for me.

In my css skin i have this:

(this one does change my selected color in all my table selections, so i know the css is working and the trinidad config and skins files are well done)

af|table::data-row:selected:focused af|column::data-cell,

  af|table::data-row:selected:focused af|column::banded-data-cell,

  af|table::data-row:selected:inactive af|column::data-cell,

  af|table::data-row:selected:inactive af|column::banded-data-cell,

  af|table::data-row:selected af|column::data-cell,

  af|table::data-row:selected af|column::banded-data-cell{

  background-color:#7E9D1C !important;

  }

af|table::data-row:selected:focused af|column::data-cell.style-0,

  af|table::data-row:selected:focused af|column::banded-data-cell.style-0,

  af|table::data-row:selected:inactive af|column::data-cell.style-0,

  af|table::data-row:selected:inactive af|column::banded-data-cell.style-0,

  af|table::data-row:selected af|column::data-cell.style-0,

  af|table::data-row:selected af|column::banded-data-cell.style-0{

  background-color:Aqua !important;

  }

I think the problem is in my bean method. I have something like this:

   public void matchEmFromJavaScriptProducts() {

        // initialize and store previously selected values

        oldSelCoMapProducts.putAll(selCoMapProducts);   

        selCoMapProducts.clear();

        newSelectionProducts.clear();

       

        DCIteratorBinding conIter = ADFUtils.findIterator("distinct_product1Iterator");

        Row [] r = new Row[conIter.getAllRowsInRange().length]; 

        r = conIter.getAllRowsInRange();

        for (int i=0; i<conIter.getAllRowsInRange().length; i++)

        {

               ...       

            if (!oldSelCoMapProducts.containsKey(products))

            {

                selCoMapProducts.put(products, availableStyles.get(0));

            }

            else

            {

                selCoMapProducts.put(products, oldSelCoMapProducts.get(products));

                oldSelCoMapProducts.remove(products);

            }

            matchEmFactSalesProducts(r[i]); // where i do the match with the proper table

        }

       

        // all entries that remained in the oldSelCoMap are no longer selected rows anymore.

        // make the corresponding styles available for the next run.

        availableStyles.addAll(oldSelCoMapProducts.values());

        unavailableStyles.removeAll(oldSelCoMapProducts.values());

        

        // clear the previously selected values

        oldSelCoMapProducts.clear();

        // set the selectedRowKeys for the locations table

        dimProduct.setSelectedRowKeys(newSelectionProducts);

        

        // refresh both tables

        AdfFacesContext.getCurrentInstance().addPartialTarget(dimProduct);

}

I do have a init function in my constructor where i do this:

    public ControlBean() {

        init();

    }

   

    public void init(){

        availableStyles.add("style-0");

        availableStyles.add("style-1");

        availableStyles.add("style-2");

        availableStyles.add("style-3");

        availableStyles.add("style-4");

        availableStyles.add("style-5");

        unavailableStyles.clear();

    }

In my page, i don't have anything different from the tables (they are different tables, so they have different bindings, different selectionlisteners, etc but they are all tables with the same proprieties).

I think maybe i'm doing the style in a wrong way but i would like to know how can i correct this.

I'm using Jdeveloper 12.1.2.0.0 and my own database.

If you need any other information to help me, please ask but i would like some ideas.

Regards,

Frederico.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2014
Added on Nov 28 2013
35 comments
2,283 views