HtmlDataTable dynamic row setting

I have an HtmlDataTable component that i wish to dynamicaly change the values of the rows when the table is buit. I wish to have an icon (a graphicImage) displayed (its rendered property set to true) in a row if a certain condition is met or, if the condition is not met then the icon should not be displayed ( its rendered property set to false). My question is how do you access the rows of the dataTable to access the component to set the rendered property before the table is rendered. I created a component binding expression within the graphicImage tag but the bean getter only gets called once ( i assumed it would get called for each row of the table). The jsf code for the table is displayed below:
<h:dataTable value="#{SoFoBean.featureList}"
var="fo"
id="foListTable"
styleClass="tableBackground"
rowClasses="tableOddRow, tableEvenRow"
cellspacing="1"
cellpadding="1"
binding="#{SoFoBean.foListTable}">
<h:column id="foListCol">
<f:verbatim>
<div id="foListRow">
</f:verbatim>
<h:graphicImage value="images/SoFo/KeyOneIcon.png"
binding="#{SoFoBean.keyOneIcon}"/>
<f:verbatim>
</div> <%--foListRow --%>
</f:verbatim>
....... snip .........
</h:column>
</h:dataTable>

For something similar I have created a small custom component that will translate a "code" into a image url.
Maybe something similar would make sense to you?
Basically extend the classes for the graphicImage (tag, component). Add two attributes
    <attribute>
      <description>The code which must be translated into an image. Usually
        this is a value-binding.</description>
      <attribute-name>lookupValue</attribute-name>
      <attribute-class>java.lang.String</attribute-class>
    </attribute>
    <attribute>
      <description>A value-binding resolving into a
        java.util.Map-implementation containing code/image-path map-entries.
        The code is used as the key for the Map lookup object. The value must
        contain the image path/name. It is recommended that the path starts
        with a "/" because the JSF-renderer will then add the context-name in
        front if it. </description>
      <attribute-name>lookupMap</attribute-name>
      <attribute-class>java.lang.String</attribute-class>
    </attribute>reroute getValue() and getUrl() to your own "translate-method"
   * @see javax.faces.component.UIGraphic#getUrl()
  public String getUrl() {
    return lookupImageUrl();
   * @see javax.faces.component.UIGraphic#getValue()
  public Object getValue() {
    return lookupImageUrl();
  private String lookupImageUrl() {
    String imageUrl;
    Map lookup = (Map) getValueBinding("lookupMap").getValue(getFacesContext());
    String lookupValue = (String) getValueBinding("lookupValue").getValue(
        getFacesContext());
    String currentValue = lookupValue;
    if (currentValue != null && lookup != null) {
      if (lookup.containsKey(currentValue)) {
        imageUrl = (String) lookup.get(currentValue);
      } else {
        imageUrl = "NOTFOUND: " + lookupValue;
        log.error("value (" + lookupValue + ") not found in map "
            + StringUtils.toStringForLog(lookup));
    } else {
      imageUrl = "missing lookupValue or lookupMap";
      log.error("missing attribute(s)! lookupValue =" + lookupValue + " map ="
          + StringUtils.toStringForLog(lookup));
    return imageUrl;
  }In the tag return "" for the renderer-type, then you can "reuse" the standard JSF-renderer ;-)
hth
Alexander

Similar Messages

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

  • How to set boundry value in dynamic rows in datagrid

    hi friends,
    I am new to flex.i want to add dynamic rows to datagrid that means.once i enter the first record i want to press tab button then it will automatically  go to the second row.and update the record continuously.once it reach the maximum value means the next row will not be edit.
    mxkimum value =10000
    from value            to value        percentage
    0.01                        2000             10
    2000                         8000           20
    8000                        10000               30
    after it reach 10000 next row will not edit,this is i want how i do this please help.
    If any suggession tel
    thanks
    B.venkatesan

    Hi,
    As Armin said use the following:
    wdContext.nodeXXX().currentXXXElement().setAttributeValue("attributeName", value)
    Here you give the value as value of simpleType and not its description.
    thanks & regards,
    Manoj

  • Dynamic Row Suppression based on grid POV

    Hi,
    I need to suppress rows based on the grid POV. The report is set up to have accounts in the rows and the user is able to select a specific account in the grid POV. Based on the grid selection, half of the accounts in the rows either need to be suppressed or not.
    One solution already available is to use advanced suppression on each row but this option will take too long. I'd like to find a solution using UDA's or some other way. Any ideas?

    Im not sure there is any simple way to get dynamic row selection based on what is selected in the page.
    If I were designing the form based on what you have stated, I would probably stick both Account and Year in the page, and the 400 products in rows. This would require the user to select the different combinations of Year / Account, but would mean only 12 columns (instead of 72).
    Alternatively you could stick Account in rows too - meaning 800 rows, but less combinations to select in Page....all depends what is deemed acceptable to the user.
    Probably other approaches that may be better than above (put Product in the Page for fun!!)
    Thanks
    JB

  • Standard Dynamic action set up for country USA

    Hi All,
    Could anybody tell me where can search standard dynamic action set up for country USA.
    Regards
    Sirisha

    Go to table V_T588Z and then enter the infotype for which you are checking. Then click on the Selection option from the menu, and then By Contents. you will get a small popup of the table fields. Scroll to the end and select "Var. function part" and then click on the green tick.  Then in the Field contents enter - T001P-MOLGA='10' then select choose.
    You will then get all the D'actions for the US. Make a note of the numbers under the column FC & No. Then go back and then check the rows as per the noted number combinations. Thats all you have all the D'actions maintained for US.

  • Dynamic Rows in Report Painter

    Hello everyone,
    I'm new to report painter and m using the SAP Library help  material to understand report painter. I've one query though i.e
    Is it possible to create a report hrough report painter with dynamic rows ? if yes then pls let me know how.
    Regards
    Anik

    Thank you.
    See I have the below Rows
    Total Revenue
    Cost2
    Cost3
    Direct Cost
    Gross = Total revenue - Direct Cost
    Gross % = (Gross/Total revenue ) * 100
    I have Columns as with basic Key figures and Formulas
    Year(basic key Figure)
    Year+1(basic key Figure)
    Total = Year + (Year+1)
    Its giving me correct values in case of Basic Key figures and not in the formula case.
    It giving error when there is formula both in Row and Column.
    In the above case last row and last colum. Only Column formula is getting implemented.
    Here for example I have mentioned 4 rows and 4 columns.. But I have 15 Rows and 30 columns .. out of which 15 rows and columns have formulas...
    % Rows are problem.. which gives me errors... I tried using Special cells, but I am not 100% sure how to use them.
    I would be very thankful if you can help me out.. Please

  • Error while saving dynamic row values of datagrid with record.

    hi friends,
    i am trying to add dynamic row in datagrid and save that value with record.i succeeded in first part while i am saving the record the error show like this.
    errro:Property fromAmount not found on com.ci.view.Task and there is no default value.
    how i resolve this error.
    any suggession welcom
    thanks in advance.
    B.venkatesan
    code:
    package:
    package com.ci.view
        [Bindable]
        public class Task
            public function Task(frmAmount:String,toAmount:String,commissionPercentage:String)
                this.frmAmount=frmAmount;
                this.toAmount=toAmount;
                this.commissionPercentage=commissionPercentage;
            public var frmAmount:String;
            public var toAmount:String;
            public var commissionPercentage:String;
    main mxml:
    [Bindable]
                private var tasks:ArrayCollection;
                private static const ADD_TASK:String= "";
                private function init():void
                    tasks = new ArrayCollection();
                    tasks.addItem(new Task("0","1000","0"));
                    tasks.addItem({frmAmount:ADD_TASK});
                private function checkEdit(e:DataGridEvent):void
                    // Do not allow editing of Add Task row except for
                    // "Click to Add" column
                    if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                        e.preventDefault();
                private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                        var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var txtIn1:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var txtIn2:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var dt:Object = e.itemRenderer.data;
                        // Add new task
                        if((txtIn.text) != ADD_TASK)
                            var x:String=String(txtIn.text);
                            tasks.addItemAt(new Task("", "", ""), e.rowIndex);
                        // Destroy item editor
                        commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                        e.preventDefault();

    Venktesan,
    You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
    ORIGINAL:
    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    EDITED:
    if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    Thanks
    Pradeep

  • SQL to read with the DISABLE STORAGE IN ROW set

    I am having problems inserting a clob > 4k. I have changed my default setting to DISABLE STORAGE IN ROW. The problem is, when my clob
    4k, I get a null pointer exception on my read. THE INSERT:
    insert into XML_W_BOOKING (WORKCONVERSATIONID, FREQUENTFLYERNUMBER, XMLSTRING)values(WORKCONVERSATIONID_SEQ.NEXTVAL, pCntr.frequentFlyerNumber, EMPTY_CLOB());
    THE UPDATE:
    PreparedStatement pstmt = this.connection.prepareStatement("update XML_W_BOOKING set XMLSTRING = ? where WORKCONVERSATIONID = ?");
    pstmt.setAsciiStream(1, new StringBufferInputStream(pCntr.xmlString), pCntr.xmlString.length());
    pstmt.setLong(2, pCntr.workConversationId);
    pstmt.executeQuery();
    pstmt.close();
    THE READ:
    myContainer.workConversationId= pRset.getLong(1);
    myContainer.frequentFlyerNumber=pRset.getLong(2);
    java.sql.Clob clob = pRset.getClob(3);
    int c;
    int length = new Long(clob.length()).intValue();
    StringBuffer strBuf = new StringBuffer(length);
    BufferedInputStream bin = new BufferedInputStream(pRset.getAsciiStream(3));
    while((c = bin.read()) != -1){
    strBuf.append((char)c);
    String str = strBuf.toString();
    System.out.println("str: " + str);
    myContainer.xmlString = str;
    Any suggestions? Is there a special sql statement I should be using to read when the "DISABLE STORAGE IN ROW" setting? I am using Oracle 8i and wls 5.1.
    IP: Logged
    null

    Enable/Disable storage in row is used for LOB columns. If enable storage in row is specified and the length of the LOB field is less than 4K then the LOB is stored along with other table data, else it is stored in a seperate segment. If disable storage in row is specified then LOB data is stored always in a seperate segment. When the LOB is stored in a seperate segment the storage parameters are determined by the values specified for CHUNKS and PCTVERSION. One chunk stores only one LOB data even if enough space is aavailable in the chunk. If the size of LOB data is small then enable storage.
    To calculate the space used by the tables use the query below
    For Table Data
    select segment_name, sum(bytes) from user_segments where segment_name in ('TABLE', 'TABLE1', 'TABLE2') group by segment_name;
    For LOB's
    select segment_name, sum(bytes) from user_segments where segment_name in (select segment_name from user_lobs where table_name in('TABLE', 'TABLE1', 'TABLE2'))
    group by segment_name;
    Jayant

  • Dynamic rows in Table Control

    Hi Experts,
    My Requirement is create a table control with 5 coloumns. The rows have to be displayed dynamically...
    I created a screen , and placed a table control.
    For eg :
       if my internal table having 2 entries , then the table control should only have two rows....(no disable/greyout)
       if internal table having say 40 entries , then the table control should have 40 rows...
    Thanks,
    Lakshmiraj.A

    Hi,
    Refer
    table control dynamic rows
    Dynamic rows increment according to user input in Table Control Module Pool
    Hope this helps
    Sumana

  • How to Handle Multiple row sets in BPEL

    Hi,
    I'm going to return list of records from a stored procedure, and try to catch it using BPEL and then those records should be insert to
    another stored procedure to insert those values to a Table.
    (Second Stored Procedure will do the INSERT function)
    Using ref cursor i can get row set. Is it possible to use Ref Cursor as IN parameter to next procedure??
    or else how can i handle this???
    thank you...

    Is your data model right? If you are adding in one and deleting in another it sounds to me more like a process that an entity, in which case you may revisit your data model and simplify it, add in a session bean with the process method to co-ordinate between the two.
    However, if you want to map multiple different tables within a single entity bean it is possible and just part of the mapping. How you actualyl specify it depends on which implementation you are working with.
    Cheers,
    Peter.

  • Can't insert new row in last position in row set

    I am trying to programmatically insert a new row into the last slot of a View Object's default row set.
    I normally can do this:
    Row newRow = vo.createRow();
    // set stuff on the row
    vo.last();
    vo.next();
    vo.insert(newRow);and, voila, the row is in the last position.
    But on this particualr view object, when I do the above, the row is inserted in the first slot.
    There doesn't seem to be anything unusual about the View object. it is a child Vo in the data model, but that shouldn't matter.
    When I debug with vo.getCurrentRowSlot(), even after performing last(); next();, vo.getCurrentRowSlot() returns 0, never 3.
    Has anyone else run into this behavior and if so, any resolution or explanation?
    FYI, I was able to use the following workaround:
    Row lastRow = vo.last();
    if (lastRow != null){
        int indx = vo.getRangeIndexOf(lastRow) + 1;
        vo.insertRowAtRangeIndex(indx, newRow);
    } else {
       vo.insertRow(newRow);
    }   

    would this solve your problem
    http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html

  • How to use open Row set in sql server 2014

    Hello All,
    How to open the row set using sql server 2014 using link server connection.

    Hi  denyy,
    Are you referring to the OPENROWSET function in SQL Server 2014?
    The OPENROWSET method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. The examples below demonstrate how to use the OPENROWSET function:
    A. Using OPENROWSET with SELECT and the SQL Server Native Client OLE DB Provider
    SELECT a.*
    FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
    'SELECT GroupName, Name, DepartmentID
    FROM AdventureWorks2012.HumanResources.Department
    ORDER BY GroupName, Name') AS a;
    B. Using the Microsoft OLE DB Provider for Jet
    SELECT CustomerID, CompanyName
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb';
    'admin';'',Customers);
    GO
    C. Using OPENROWSET to bulk insert file data into a varbinary(max) column
    USE AdventureWorks2012;
    GO
    CREATE TABLE myTable(FileName nvarchar(60),
    FileType nvarchar(60), Document varbinary(max));
    GO
    INSERT INTO myTable(FileName, FileType, Document)
    SELECT 'Text1.txt' AS FileName,
    '.txt' AS FileType,
    * FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document;
    GO
    D. Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file
    SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt',
    FORMATFILE = 'c:\test\values.fmt') AS a;
    Reference:
    OPENROWSET (Transact-SQL)
    Using the OPENROWSET function in SQL Server
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.

  • I need to add the Dynamic rows in the Jform

    {color:#800000}*I have used Jform in the net beans... when the submit button i clicked then the dynamic rows should be inserted.. how can do that... i have used DefaulttableModel but in netbeasns it is not supporting i dont know how to add please tell me where i have to add the changes*{color}

    vidhyaprakash wrote:
    I have used Jform in the net beans... What is a Jform?
    when the submit button i clicked then the dynamic rows should be inserted.. Is this Swing coding? When I think of submit buttons, I usually think of Java Server Pages.
    In other words, if possible, please clarify your question as details matter here. Also, showing the code you've tried would help too.
    Good luck.

  • Can someone pls explain what the Dynamic Range setting does?

    Hello All,
    In the STB's Audio menu there's an option for Dynamic Range.  The available settings for Dynamic Range are None, Light, or Heavy.   I'm not noticing any difference in the sound regardless of the option chosen.   What is this option supposed to do?  

    http://en.wikipedia.org/wiki/Dynamic_range gives you a bit of a winded explantion of what it is.  In a nutshell dynamic range is the difference between the quietest and loudest sound.
    I beleive the dynamic range setting is designed is to help users that have a certain connections (eg HDMI) deal with fluctationing volume.  Heavy compresses the highs and lows to a narrower range, light uses less compression and none of course is no change.  If you have trouble hearing some channels and commercials are loud you might want to try heavy.  Keep in mind that heavy distorts audio the most and none the least.
    My audio system is a Pioneer Amp with a Polk 5.1 speaker system.  I've noticed no difference but to be fair I don't think I've tried it under condtions that I would notice it.  In addition I'm currently using an optical connection for my audio which apparently doesn't change with dynamic range.
    There is a few other threads that discuss this including ....
    http://forums.verizon.com/t5/FiOS-TV-Technical-Assistance/anyone-else-having-problems-with-volume-ou...
    http://forums.verizon.com/t5/FiOS-TV-Technical-Assistance/Intermittent-Audio-Distortion-with-HDMI-ho...

  • Dynamic row additon in Interactive Offline Adobe Form

    Hi ,
    I have to add some dynamic row based on some condition in Adobe Form .Please let me know.
    Ricky

    Hi Ricky,
    You need multiple rows for a dynamic structure field of a data source.
    Just do data binding to the table.
    In row-->binding tab select check box "Repeat Row for each Data Item".
    Leave the min value as 1 you can specify the max value if do want to restrict.
    If you need to have a row added dynamically via code, you can do so by using table.row.instancemanger.addinstance
    Regards,
    Sai

Maybe you are looking for

  • Passing parameter to Function in select clause BIP 11g

    Hi, I am developing a dataset where i ahave to pass Parameter to a function which retrives the cursor in BIP 11g below is the SQL: select cizcompfn(:P_USER_ID) COMPANY_INFO, cizinstfn(:P_REPORT_CD, :P_USER_ID) CURRENCY_INFO, sysdate AS PRINT_DATE_TIM

  • What is the wrong in the below code

    Hello All, I am creating a DDIC table dynamically through a program. REPORT  zbc_create_table2. TABLES: dd02l. PARAMETER: tab_name TYPE tabname OBLIGATORY VISIBLE LENGTH 18 . SELECT-OPTIONS s_table FOR dd02l-tabname. DATA: gs_cl_bc_dyn TYPE REF TO zc

  • How to send different XML using static URL

    Hi Guys, I have the problem, my legacy system sends xml messages to XI by HTTP, my legacy system support only a static url http://host:8000/sap/xi/adapter_plain I have more than one interface, how did u fix this problem. I need to send xml to XI with

  • IDOC Segments data?

    Hi, Can anyone tell in which tables is the IDOC segments data is stored? Rgds, Kanwar

  • Magic Bullet Looks plugin problem

    Hi everyone! I installed MB Looks for FCP. FCP does not show/detect the plugin. So I am wondering - is there a specific plugin folder where all the effects are kept for FCP to check what is going on? Thanks! Jo