Dynamically apply the color to the lines of Table

Hello

I use JDeveloper - 11.1.1.6.0 version

I have a requirement to apply the background color for rows in the table dynamically.

In the table, I have a few lines with a checkbox.

When I select the checkbox of the line, the line selected as well as lines before and after the selected line should be displayed with a background color.

Please let me know of inputs for this question.

Thank you
Ravi

Hello

You can do this by surrounding components of the cell (outputText, inputText, checkBox etc) with for example a panelLabelAndMessage component. Then on this property of component inlineStyle use EL to refer to a property of the managed bean. The managed bean property can now assess the State of checkbox selection. The part of thing in your question is to say during the rendering of the previous and next row that the checkbox in the line between has been selected. You must find a way to say this. An option would be to apply the logic as below

JUCtrlHierNodeBinding currentRenderedAdfRow = ... use facesContext --> getApplication --> getExpressionFactory --> createValueExpression to create a handle to the #{row} expression
Row rw = currentRenderedAdfRow.getRow();

BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingEntries();

DCIteratorBinding dciterator = (DCIteratorBinding ) bindings.get("Name of iterator used by table ");
RowSetIterator rsIterator = dciterator .getRowSetIterator();

Row prevRow = rsIterator.setCurrentRow(rw);
int currRowIndex = rsIterator.getCurrentRowIndex();

Row prevRow = getRowAtRangeIndex(currRowIndex-1);
Row nextRow = getRowAtRangeIndex(currRowIndex-1);  

//return CSS that colors the background if the following conditions are true

if ( ((DataType) rw.getAttribute("checkBoxAttr")) ||  ((DataType) prevRow .getAttribute("checkBoxAttr")) |  ((DataType) nextRow .getAttribute("checkBoxAttr"))){

  //color background returning CSS

}

else{
  return empty string
}

I wrote this code to the top of my head, to ensure you are looking for null pointers (for example if there is no such thing as a prev-line). Also consider caching the calculation so that it doesn't have to be performed for each cell in a row, but only once per line. For example you can save the color and the line key in a bean managed in scope view and then compare the key with this bean managed before performing the calculation

Frank

Tags: Java

Similar Questions

  • Allow users to add dynamically to the lines - data form

    Hello

    In some ways, I do not understand how to use this function to "allow users to dynamically add rows. When I check this option in the online form, where and how can a user add the lines? I understand that users with write access can do it, but I have write access, but I don't see any button Add or any possibility of adding the lines from the form online.

    Please let me know.

    Thank you

    Hello-

    Have you tried Edit > Add Row?

    Thank you!

  • How to get the line object table View

    Hello

    I use Jdev 11.1.1.7

    My requirement is, there are two ways I can get lines in my logic, you're based getFilteredRows (RowQualifier) and vo.executeQuery () - on a specific condition or I should consider first or later...

    getFilteredRows() returns the line [], I need to find a way to make [Row] of the View object properly after ececuteQuery() on the VO... When I use vo.getAllRowsInRange () which returns only a single line, but what iterate the VO even, I see that there is more than one line... How can he get all the range of the VO table?

    Thank you

    You can set the size of the field-1?

    ViewObjectImpl (Oracle ADF model and Business 10.1.2 API components reference)before calling getAllrowsinRange?

  • remove the space between the lines of tables

    Hello

    How can I get rid of the excess space between the lines in the attached table?  It looks nice and tight in DW, but extends more place in IE and Firefox.  I tried to adjust the height of the cell but no effect.

    Thank you!  TTT

    Try to add this CSS to your style sheets 1.  It will not change the cell height, but he's going to build your lists a little.

    ul,li {line-height: 1; margin-top:0; margin-bottom:0}
    

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    -------------------------
    HTML Validator - http://validator.w3.org

    CSS Validator - http://jigsaw.w3.org/css-validator/

    Tutorials HTML & CSS - http://w3schools.com/

  • How to select the lines/odd table...

    How to select lines / odd in a table?
    Help, please.

    Published by: vaibhav on May 7, 2012 05:30

    This can be done by using the function mod like this:

    For even rows
    Select * from (select rownum rn, nom_table.* from tableName) where mod (rn, 2) = 0;

    For the odd lines
    Select * from (select rownum rn, nom_table.* from tableName) where mod (rn, 2) = 1;

  • How the lines of table in CS2

    Is it possible to table rows in illustrator?  IE perhaps 30 lines enclosed in a circle all the raidiating of the center of the circle from the center point (a bit like a sunburst effect).

    Thank you!!

    land,

    This looks like a work of the polar grid with concentric dividers tool 0-30 radial dividers. You can unlink as necessary.

  • Dynamically set the size of table

    Hello world!

    I have a table of cluster (each cluster contains 4 values) and according to the interactions between users, new groups are added to the table. I would like to set up a 'Clear' button which removes all elements inside the table, but I can't find a solution so far. The best I can do is put all the elements of the cluster to 0 but the cluster itself is always in the table.

    Does anyone know how to do?

    Thank you very much

    Julien

    Hi jfcors,

    the cluster must be in the table, because it defines the type of data in the table.

    You also seem poorly understand the term "empty array": a table is empty when there is no elements inside!

    Extracted from:

    @aCe:

    Your example only removes an element of an array, but not the entire table! Sorry, it's okay...

  • Dynamically adjust the size of table control panel

    Hello

    I have a combo box control that I drag within a table.

    Since my request depends on the size of the initialized array, I'm having a problem with the car, adjust the number of items to display on the control panel.

    Say for example, I wanted to have 4 zones of drop-down list on my table, I drag the table to show the 4 combo boxes.

    The problem is that if I wanted to change this moment of execution at 2 or 6 elements, it still shows 4 items in the control.

    Is there a way to adjust based on the number of items?

    I found it... must be a day tired... Since the solution is too simple

  • How to apply the color to the line in a tabular presentation

    Hello

    My requirement is to apply the color to the line in a tabular presentation according to the conditions of the column value.


    Thank you

    1243 Tulasi wrote:
    I created a form of demo using the emp table

    but now it throw an error like "error report:"
    ORA-06550: line 1, column 29:
    PLS-00201: identifier 'CLERKS' must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    http://Apex.Oracle.com/pls/Apex/f?p=16091:1:12227641756607:

    Workspace: tipper
    username: guest
    password: demo

    Please help me on this very urgent issue.

    Thank you.

    Check it now, only it was you must reference column names using bind variables syntax not #XXX #.

    Refer to the help when you click on * model column 1 Expression * in your report model.

    also, I noticed that you lose the background color when you mouseover it. To do this, you may need to remove the #HIGHLIGHT_ROW # of your model.

    See you soon,.
    Vikram

  • Apply the last character of line color

    Hi all

    I'm newbie in Javascript.

    Question: I want to apply the color to the last character in the line. It does not work.

    My lines are:

    myDocument var = app.activeDocument;

    myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

    for (i = 0; i < myLine.length; i ++)

    {

    myLine [i] .characters. item(-1). fillColor = "SS";

    }

    I think that the error which was held in the item(-1) only occurance.

    Can someone give the solution?

    / * But if I want to apply the color at the beginning of the line, it works.

    This is the line i follow:

    myDocument var = app.activeDocument;

    myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

    for (i = 0; i < myLine.length; i ++)

    {

    myLine [i].characters.item (0) .fillColor = "SS";

    }*/

    Hello X,

    You must check the end doubled characters is undesirable space, enter brand, shift enter, etc...

    Please try the JS code below.

    var myDocument = app.activeDocument;
    var myLine = myDocument.stories.everyItem().lines.everyItem().getElements();
    for(i=0; i
    

    THX

    csm_phil

  • Dynamically change the color of the text substring

    Hello!

    I'm working on a simple serial terminal and I would like to change the color of each line depending on whether the message is sent or received. I have an indicator of string in which I add all messages, sent or received.

    My problem is that when I change the color of a substring by using a property node, all the text in my chain indicator changes. Here is a small Video that shows my problem (my real VI is a little too big to put here but the part of string works the same. I concatenate, keep the clues and apply the property node):

    Result:

    Any idea on how I could change the color of the new line? It seems the selection doesn't really work, because everything in the chain takes the new color.

    Thanks in advance,

    Tim

    PS: I've seen a web-based solution in which the property node must be extended for every line, of course it does not work for me as the number of lines changes dynamically.

    The problem you have is that the string contains no format information and it does not keep the indicator.  You will need to set the font.color in each line, each time you receive a new message.  See my post here - http://forums.ni.com/t5/LabVIEW/Different-fonts-in-string-indicator/m-p/1601602/highlight/true#M5823...

  • Selected color change of line to the table in the ADF

    Hi all

    I'm new to ADF. I use Jdeveloper 11.1.2.4 version.

    My requirement is when I chose several lines, color of the line should be changed to red.

    I dragged and dropped ViewObject of the Department in the form of a table on a page and RowSelection to the multiple. I need color of selected lines/lines to be past to red. How can achieve us?

    I wrote the method selectionListner on the table, in which I get the details of the selected line. How can we apply color to selected lines.

    Thanks in advance.

    Best regards

    Claude Reynier.

    How about you create a variable temporary level VO with a default null value.

    Now on the selection listener retrieves the current line and change the value of this variable 'Y '.

    In the inlineStyle write an EL, if the value of this variable is 'Y' changes the color.

    Thank you

  • is it possible to apply the sort on the columns added to a dynamic display object?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    We have created a dynamic display object in the AM Impl, all objects in view columns are added dynamically.


    All lines are displayed correctly, but when sorting columns data disappear. (point of view are being refreshed, of course).


    is it possible to apply the sort on the columns added to a dynamic display object?

    This is how we show data in the JSF page:


    < af:table lines = ' #{bindings. " DynamicVO.rangeSize}' fetchSize = "#{bindings." DynamicVO.rangeSize}.

    emptyText = "#{bindings." DynamicVO.viewable? "{'No data to display.': 'Access Denied.'}".

    var = 'row' rowBandingInterval = '0' value = ' #{bindings. " DynamicVO.collectionModel}.

    selectedRowKeys = ' #{bindings. " DynamicVO.collectionModel.selectedRow}.

    selectionListener = "#{bindings." DynamicVO.collectionModel.makeCurrent}.

    rowSelection = "single" id = "t1" >

    < af:forEach elements = "#{bindings." Var DynamicVOIterator.attributeDefs}' = 'def' varStatus = 'vs' >

    "< af:column headerText =" #{def.propertyMap.label} "sortable ="true"sortProperty =" #{def.name} ".

    ID = "clmn$ {vs.index}" >

    < af:outputText value = "#{row [def.name]}" id = "ot1" / > "

    < / af:column >

    < / af:forEach >

    < / af:table >




    Thanks guys, I created a custom class that contains a model that can be sorted in a pod of support and I have to the adf work table it and it is very good about sorting.

    JSF:

    Rows = "#{pageFlowScope.crudBean.dynamicTable.collectionModel.RowCount} '"

    contentDelivery = 'immediate' var = 'row' rendered = 'true '.

    Binding = "#{backingBeanScope.crudBackingBean.tasksTable} '"

    selectionListener = "#{backingBeanScope.crudBackingBean.customListener} '"

    "rowSelection ="single"id ="t1"partialTriggers =": pt_gr2 "columnStretching =" column: clmn0 ">

    inlineStyle = "width: 100px;"  ID = "clmn$ {vs.index}" > "

  • find out all the line last character and color fill

    Dear friend,

    I need to find all the last character and fill color of line (no need to the last character of words).

    My code problem: no space in the last character is not the fill color.

    My code is below:

    var myDocument = app.activeDocument;  
    var myLine = myDocument.stories.everyItem().lines.everyItem().getElements();  
    for(i=0; i<myLine.length; i++)  
    {  
        var myCon = myLine[i].texts[0].contents;  
        if(myCon.match(/\n| /gi) != null){  
            try{  
                if(myLine[i].characters.item(-2).fillColor = myDocument.colors[2]);
                }catch(e){}  
            }  
        }  
    

    My screenshot as below:

    last.png

    Please suggest a friend

    Thanks in advance

    KS

    Add a ' if else ' statement to apply the fill color to the second to the last character only if the last character is a space. otherwise apply the fill color for the last character.

    myDocument var = app.activeDocument;

    myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

    for (i = 0; i

    {

    Chantal var = myLine [i] .texts [0] .silence;

    If (myCon.match (/ \n| IM)! = null) {}

    try {}

    If (myLine [i].characters.item-(1) .silence == "'" ") {}

    myLine [i].characters.item-(2) .fillColor = myDocument.colors [2];

    } else myLine [i].characters.item-(1) .fillColor = myDocument.colors [2];

    } catch (e) {};

    }

    }

  • How to apply the Swatch of paper color on the page

    Hi Experts

    I want to apply the paper Swatch on the page color.

    I have try this to set the paper Swatch color but no success.

    indesign #target

    myDocument var = app.documents.add ();

    myPages var = myDocument.pages;

    myPage = myPages.item var (0);

    var swatchclr = app.activeDocument.swatches.itemByName ("Paper") .properties = {space:ColorSpace.RGB, model: ColorModel.PROCESS};

    swatchclr.colorValue = [255,150,0];

    There is no change in the value of the paper Swatch color.

    How to apply that color on the page?

    Thank you.

    Hello

    Watch this line ('=' repeated):

    app.activeDocument.swatches.itemByName("Paper").properties swatchclr = = {space:ColorSpace.RGB, model: ColorModel.PROCESS};

    swatchclr.colorValue = [255,150,0];

    Swatchclr is a swatch.properties not a swatch.

    Make:

    swatchclr = app.activeDocument.swatches.itemByName ("Paper");

    swatchclr. Properties = {space:ColorSpace.RGB, model: ColorModel.PROCESS, colorValue: [255,150,0]};

    Rgds

Maybe you are looking for