How to set dynamically row data in datatable

hi All.
i have a datatable with columns and listeners as below.
//pstBildirimAyrList.jsp
<h:dataTable id="table1"
value="#{pc_PstBildirimAyrList.pd_pstBildirimAyrListData.pstBildirimAyrBean}"
var="varpstBildirimAyrBean" >
<h:column id="column8">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Personal ID" id="text15"/>
</f:facet>
<h:inputText id="bki_birey_id"
     value="#{varpstBildirimAyrBean.bki_birey_id}"
     styleClass="inputText"                         onchange="this.form.submit();"
     valueChangeListener="#{pc_PstBildirimAyrList.changeValuesForId}"
     immediate="true" >
          <hx:validateConstraint regex="DigitOnly" />
</h:inputText>
</h:column>
<h:column id="column9">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Name" id="text17"/>
</f:facet>
<h:inputText id="bki_birey_adi" value="#{varpstBildirimAyrBean.adi}"
     styleClass="inputText" maxlength="50" required="true"
style="text-align: left">
</h:inputText>
</h:column>
</h:dataTable>
//faces-config file is
<managed-bean>
     <managed-bean-name>pc_PstBildirimAyrList</managed-bean-name>
     <managed-bean-class>pagecode.pst.PstBildirimAyrList</managed-bean-class>
     <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
     <managed-bean-name>pd_pstBildirimAyrListData</managed-bean-name>
     <managed-bean-class>com.vadi.pst.data.PstBildirimAyrData</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
if i changed bki_birey_id((UIInputText)) value, i want to change automatically (by searching in Database) bki_birey_adi (UIInputText) .
For this reason, I added a listener to bki_birey_id. its code is below.
PstBildirimAyrList.java
public void changeValuesForId(ValueChangeEvent valueChangedEvent) {
     HtmlDataTable dt = (HtmlDataTable) (facesContext
                         .getViewRoot()
                         .findComponent("form1")
                         .findComponent("table1"));
     PstBildirimAyrBean pstBildirimAyrBean = (PstBildirimAyrBean) dt.getRowData();
     if (valueChangedEvent.getComponent().getId().equals("bki_birey_id")) {
          HtmlInputText birey_id = (HtmlInputText) dt.findComponent("bki_birey_id");
          HtmlInputText birey_adi = (HtmlInputText) dt.findComponent("bki_birey_adi");
          HtmlInputText birey_soyadi = (HtmlInputText) dt.findComponent("bki_birey_soyadi");
          try {
               BkiBireyBean bkiBireyBean =
                    (new BkiBireyDBAO()).fetchByPrimaryKey(
               Long.parseLong(birey_id.getValue().toString()));
               birey_adi.setValue(bkiBireyBean.getAdi());
               birey_soyadi.setValue(bkiBireyBean.getSoyadi());
          } catch (Exception e) {
               birey_adi.setValue("-");
               birey_soyadi.setValue("-");
it's look like true. but When page is return, bki_birey_adi is not set.
what's wrong?
please help me.
Thanks in advance.
Note : i'm sorry for down spelling.

Create a binding for your dataTable.
In the binding create a UIData element with gettters and setters.
You can manipulate rows and columns from it.

Similar Messages

  • How to bind dynamic row data to submit it by HTTP submit (PHP) - addInstance and Data Binding

    Hi,
    i have got a problem with submit HTTP all data (variables) from PDF to submit.php.
    I have got table with dynamic add/remove Table Row button. When i add it their names are Table.Row[0] , Table.Row[1], Table.Row[2] etc. Only Table.Row is real, and every other row is create dynamically by addInstance script command.
    When i fill "Data Binding" box like this: "Use name(Row)" then after submiting it do PHP i will see only last Table.Row data. For example if last would be Table.Row[3] then i will see only this on my submit.php and the others will be replaced by this value. This is happen becouse of replacing value by value with the same name (data binding is seeing only one Table.Row without instance name:"[1]", "[2]", "[3]" etc.).
    I guess that if i would change something to get addInstance command with Row names like Row1, Row2, Row3 then all will be ok.
    Another way it`s to change something in the "Data Binding" box (Object > Binding Tab) to get relative name like Row[*] instead of "Use name(Row)".
    I don`t know how to solve it and i need your help

    Create a binding for your dataTable.
    In the binding create a UIData element with gettters and setters.
    You can manipulate rows and columns from it.

  • How to set dynamic expiration date in User Task

    Hi
    I need to set the expiration date of a User Task to a specific date, not a duration. Is it possible to do this?

    I have also got a smiliar problem. Does anyone have any further information to how this can be achieved?
    I have been able to use the Human Task Wizard screen (<usertask>.task) to hard code the expiration time. Using the Fixed Duration option of days, hours or minutes. I have tried to use the 'By Expression' to do this but have been unable to get it to work. I have tried to select the /task:task/task:systemAttributes/task:expirationDuration or the /task:task/task:systemAttributes/task:expirationDate element within the task workflow xsd but are unsure how to get it to read the date. I have tried to assign a time component to expirationDate and a time period P0DT0H20M to the expirationDuration element.

  • How to obtain the row data in the component datatable?

    if I want to edit a row data, and then know which row is edited in the component datatable, and how to do?
    How to obtain the row data in the component datatable, and update it to database, not simplely edit a simple table
    Any ideas? Thanks

    Thank you very much for your help Alexander !
    It's quite confusing when you leave Struts and try to adapt your projects for JSF for the first time...
    I wanted to click on a row with a "onMouseClick" on the TR tag like I used to do in Struts/JSTL. But it seems to be impossible in a dataTable.
    Ok then. I've added a column at the end of the row with an icon.
    But eventually I didn't need to declare link parameters.
    In my BackingBean I did like this :
    public String selectEventForUpdate() throws IllegalAccessException, InvocationTargetException {
            PortletAgenda event = (PortletAgenda) JSFUtils.getInRequestMap("event");
            BeanUtils.copyProperties(this, event);
            return null;
       }JSFUtils.getInRequestMap(...) is a method I wrote in a util object :
    public static Object getInRequestMap(String name) {
            Object res = null;
            Map requestMap=FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
            if (requestMap!=null) {
                res=requestMap.get(name);
            return res;
    }  " event " is the name of the item in my dataTable list.
    My backingBean has the same attributes as "event".
    So when the page is reloaded I have a backingBean full with the selected properties to edit/update.
    Thanks to your reply I realized that putting this form in the middle of the dataTable seems to be impossible.
    So I put this form in a floating DIV in front of the table with a shadow.
    It works :o) !
    But I'm a little bit disapointed to be honest...
    I used to build my web applications with Struts and JSTL and doing this kind of interface was really easy.
    I've decided 3 days ago to convert into JSF because the "GUI Layer" seemed to be improved.
    But now I realize that I cannot put a onMouseOver and onMouseClick on a row and I cannot display a different row in the middle of a table....
    I think it's a shame because there is a facet for header and footer.
    And it would be great if we could create our own personal facet that appears only if a condition is true.
    For exemple " if the current item id is the same as the request parameter id then display the following facet content ....... (with a panel group and a form inside to update the row) "
    It's easy to do that with JSTL thanks to c:forEach and c:if but it seems to be impossible to use JSTL tags like this during the dataTable iteration.
    And JSF tags seems to have no logical tags like " if " or loops that can be nested in dataTable.
    I really need to realize this interface (you click on a row then an edit form appears where you clicked).
    Do I have to write a component myself that extends dataTable?
    Do you know if writing such a component is hard to do for a beginner like me?
    (I've juste discovered JSF 3 days ago and I've used Struts/JSTL for 2 years til now)
    I'd be glad to have much advices from you about that.
    Regards

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to set dynamic parameter in list of values in parameter property

    Hi,
    I am using cr4e-all-in-one-win_2.0.1version.I have created .rpt file in that how to set dynamic parameters(from database) in list of values parameter property
    Regards,
    amol

    Hi,
    I am using cr4e-all-in-one-win_2.0.1version.I have created .rpt file in that how to set dynamic parameters(from database) in list of values parameter property
    Regards,
    amol

  • How to set special rows in jtable not selectable

    Hello programmers,
    anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
    in advance thanks for your answers

    table = new JTable(...)
         public void changeSelection(int row, int column, boolean toggle, boolean extend)
              if (row == 0)
                   return;
              else
                   super.changeSelection(row, column, toggle, extend);
    };

  • How to set dynamic color , based on xml element

    Hi,
    We have a requirement, where based on certain conditions, a cell will be shown in a specific color. We would like the coloir to be based on an XML element. The xml element will have values like '#FF00FF' etc..
    We tried using xsl attribute with the following syntax ,
    <xsl:attribute xdofo:ctx="block"name="color"><?stdcolor?></xsl:attribute><?end if?>
    where stdcolor is the xml element, but when we use this , this is giving a syntax error.
    Let us know, if this is possible or is there any other alternate way to do this.
    Regards,
    - Vasu -

    Hi Vasu,
    http://winrichman.blogspot.com/2008/09/how-to-set-dynamic-color-based-on-xml.html
    use the following :)
    <xsl:attribute xdofo:ctx="block" name="color" ><xsl:value-of select="stdcolor" /></xsl:attribute>
    TO get the colors you wanted , you can refer to
    http://www.w3schools.com/Html/html_colors.asp

  • T.code KO88: how to set the document date?

    Hi All,
    could anyone tell me how to set the document date in the t.code KO88?
    Thanks
    Gandalf

    Hi,
    Normally, the system define  the posting date based the date when document entered into Financial Accounting or cost accounting. Based on posting date,system will define the posting period and fiscal year.
    Posting date can be different from Entry date ( the date date entered into SAP system), where no influence from user, and it can also different from Document date. Document date is the of original document was created.
    Hope this will give you clearer overview of dates which are used in system.
    Regards,
    Irhasni

  • How to set max row display rows in PO's PLD

    Hi,
    How to set max row display rows in PO's PLD
    Thanks and Best Regards
    Bruce

    Hi
    Max. Rows per Page is depend on PLD Settings and Depend on Repetitive Area Fieds Height.
    Try this,
    1st Case:
    ->> Administration Module.
    ->> System Initialization.
    ->> Open the Print Perferences Window.
    ->> Click General Tab on Print Perferences Window.
    ->> Assign the Max. Rows per Page - 99 (or) your wishes.
    ->> Update the Print Perferences.
    2nd Case:
    ->> Open your PLD.
    ->> Choose Repetitive Area on Field Index Window.
    ->> Click Format Tab on Properties Area Window.
    ->> Assign the Lines in Repetitive Area - Your Wishes .
    ->> Save the PLD.
    Regards,
    Madhan.

  • How to maintain dynamic rows with data when click on Previous button?

    Hi,
    I have 1 aspx page and divided into 3 pages using panels.Each panel has "Next" and Previous buttons
    I have created and deleted dynamic table rows when click on Add button using javascript. whenever i click on Next button it will navigate to same page of next panel.
    when i click on previous button then it goes to previous panel but whatever i have added dynamic table rows in 1st panel that got removed.
    Can u please help me for how to maintain state of dynamic table rows with entered data when click on Previous button?
    How to get dynamic table rows with entered data in previous panel when click on Previous button?
    Please find the below javascript code:
    function insertRow() {
    if (index >= 2) {
    document.getElementById('deleteRow').style.display = "inline";
    else { document.getElementById('DeleteRow').style.display = "none"; }
    var table = document.getElementById("myTable");
    var row = table.insertRow(table.rows.length);
    cell1 = row.insertCell(0);
    t1 = document.createElement("select");
    t1.options[t1.options.length] = new Option('--Select--', '0');
    t1.id = "ddlYear" + index;
    cell1.appendChild(t1);
    for (var i = 1975; i <= 2015; i++) {
    opt = document.createElement("option");
    opt.value = i;
    opt.text = i;
    t1.add(opt);
    t1.style.width = "155px";
    var cell2 = row.insertCell(1);
    t2 = document.createElement("Select");
    t2.options[t2.options.length]=new Option('--Select--','0');
    t2.options[t2.options.length]=new Option('State Board','1');
    t2.options[t2.options.length]=new Option('CBSE','2');
    t2.options[t2.options.length]=new Option('ICSE','3');
    t2.options[t2.options.length] = new Option('Others', '4');
    t2.style.width = "155px";
    t2.id = "ddlCourse" + index;
    cell2.appendChild(t2);
    var cell3 = row.insertCell(2);
    t3 = document.createElement("input");
    t3.id = "txtCity" + index;
    cell3.appendChild(t3);
    var cell4 = row.insertCell(3);
    t4 = document.createElement("input");
    t4.id = "txtInstitute" + index;
    cell4.appendChild(t4);
    var cell5 = row.insertCell(4);
    t5 = document.createElement("Select");
    t5.options[t5.options.length] = new Option('--Select--', '0');
    t5.options[t5.options.length] = new Option('English', '1');
    t5.options[t5.options.length] = new Option('Hindi', '2');
    t5.options[t5.options.length] = new Option('Telugu', '3');
    t5.options[t5.options.length] = new Option('Others', '4');
    t5.style.width = "155px";
    t5.id = "ddlMedium" + index;
    cell5.appendChild(t5);
    var cell6 = row.insertCell(5);
    t6 = document.createElement("input");
    t6.id = "txtSpecialization" + index;
    cell6.appendChild(t6);
    var cell7 = row.insertCell(6);
    t7 = document.createElement("input");
    t7.id = "txtFnl" + index;
    cell7.appendChild(t7);
    index++;
    function DeleteRow(index) {
    var table = document.getElementById("myTable");
    table.deleteRow(index);
    // if (index = 2) { alert("There is no rows added.Please add the new row"); }
    Design:
    <tr style="font-size: 12pt" id="trSecond" runat="server">
    <td colspan="3">
    <table id="myTable" width="100%" border="0">
    </table>
    <tr>
    <td colspan="3" align="right">
    <input type="button" title="Add" value="Add" onclick="insertRow();" />
    <input type="button" id="deleteRow" title="Delete" value="Delete Row" onclick="DeleteRow(this);" style="display:none" />
    </td>
    </tr>
    Thank you.

    Put the button click into an action listener and build the new frame there. The code I have below isn't exactly what you're doing (it's amazingly oversimplified), but it's probably similar enough to get your wheels turning in the right direction.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class sample
         public static void main(String[] args)
              JFrame frame = new JFrame("Sample");
              frame.setSize(400,400);
              Container content = frame.getContentPane();
              content.setLayout(new FlowLayout());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JTextField text = new JTextField(10);
              content.add(text);
              JButton button = new JButton("Send");
              content.add(button);
              frame.setVisible(true);
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        JFrame myframe = new JFrame("Results");
                        myframe.setSize(200,200);
                        Container mycontent = myframe.getContentPane();
                        mycontent.setLayout(new FlowLayout());
                        String mytext = text.getText();
                        JLabel label = new JLabel();
                        label.setText(String.valueOf(mytext));
                        mycontent.add(label);
                        myframe.setVisible(true);
    }

  • How to set the rows of dataTable using loadBundle tag?

    Hi,
    Can i set the rows property of a <h:dataTable> using the value from a <f:loadBundle> tag?
    I tried the following code
    <f:loadBundle basename="com.message.NumberOfRows" var="numRows"/>
    I have NumberOfRows.properties file with the following entry
    rows=5
    The dataTable code
    <h:dataTable value="#{mastData.list}" rows="#{numRows.rows}" align="center" var="mastBean">
    </h:dataTable>
    This code is generating ClassCast Exception.
    Please comment on this issue.
    Thanks,
    Renju

    Hi,
    Exactly Reymond, See Renju you already using mastData bean for datatable. In that create a bean method something like rows & create a getter/setter method returning int. In getter method try this code as
    ResourceBundle bundle = ResourceBundle.getBundle("ur resource bundle");
    rows = Integer.parseInt(bundle.getString("rows_to_display"));
    return rows.
    Hope you can now get some clear idea i guess
    Regards,
    A.

  • How to set dynamic where clause in ADF?

    Hi,
    I have a View object called BillInfoVO. This has
    all the information about who created the request, the time , status etc.,
    I need to display this VO in a jsp. But before I display, i need to fileter this
    VO results with different where clauses according to the role of the user.
    For example, if the role is admin, then
    where clause should be 'status = 'Completed, and created by = 'Current user'
    If the role is requestor, then
    the where clause should be
    sales manager id = 'Current user' and
    Status != Complete etc.,
    Could any one please let me know how I can
    dynamically set the where clause to filter the appropirate
    result row set in the jsp?
    Your help will be greatly appreciated.
    Thanks,
    venki

    You'll create a service method in your AM that will use the setWhereClause method of a viewobject.
    Then you'll expose it as a client method.
    Then you'll drag it from your data-control onto a button in your JSF page that will call your page for the query.
    More about service methods here:
    http://download.oracle.com/docs/html/B25947_01/bcservices003.htm#sm0206
    http://download.oracle.com/docs/html/B25947_01/bcquerying008.htm#sthref286

  • How do i dynamically add data to a JTabel?

    Hey
    How do i add the data to a JTabel dynamically from a HashMap?
    I tried the following:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package test;
    import java.util.HashMap;
    import java.util.ArrayList;
    import java.util.Set;
    import javax.swing.JTable;
    * @author Jesper
    public class Players {
        HashMap<String, Stats> players;
        public Players(){
            players = new HashMap<String, Stats>();
            addPlayer();
        public void addPlayer(){
            players.put("Martin ?rnskov", new Stats(19, 3, 1));
            players.put("Thomas Raun", new Stats(23, 6, 0));
            players.put("Jimmy Mayasi", new Stats(26, 26, 3));
            players.put("Lasse J?rgensen", new Stats(33, 0, 0));
        public JTable showPlayers(){
            String[] columnames = {"Spiller", "Kampe", "M?l", "R?de kort"};
            Object[][] data;
            Set<String> key = players.keySet();
            for(String player : key){
               data = {{player, players.get(player).getMatches(), players.get(player).getGoals(), players.get(player).getRedCards()}};          
            final JTable table = new JTable(data, columnames);
            return table;
    but on this line Netbeans says that variable is allready defined:
       data = {{player, players.get(player).getMatches(), players.get(player).getGoals(), players.get(player).getRedCards()}};          
    I can see the problem is this, but when it cant be done this way, how can i do it then?

    Instead of creating the table directly with data values, use a DefaultTableModel whose constructor is very similar. But DefaultTableModel has interesting method as addRow, removeRow... for dynamically handling data (and visually to table).
    Set<String> keys = players.keySet();
    Object[][] data = new Object[keys.size()][columNames.length];
    for(i=0; i<keys.size(); i++) {
       String key = keys.next();
       data[0] = player;
    data[i][[1] = players.get(player).getMatches();
    data[i][[2] = players.get(player).getGoals();
    data[i][[3] = players.get(player).getRedCards();
    DefaultTableModel model = new DefaultTableModel(data, columNames );
    JTable table = new JTable(model);
    Later in your code, as you want to dynamically update the table, work with the model instead of the table to add , remove, change cell values of the table.
    +PS : your code loop is probably wrong. You are setting data variable for each value of the set. I suppose you want to add a row to data array. data is a two dimension array+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to select one row from the datatable

    hi,
    I have a data table which displays the employee list .the table contains 4 columns which represents the employee code,address,status like that.
    when we click on particular row,the row must be selected and the total details of the employee will be displayed on the same page below the datatable.
    how to write the code for this.

    Hi
    Jsp Page
    <h:dataTable value="#{bean.list}" var="role" binding="#{bean.table}">
    binding- attribute need to include in dataTable tag
    Bean
    1> private UIData _table; as variable
    2>Getter and setter Methods
    public void setTable(UIData table) {
    _table = table;
    public UIData getTable() {
    return _table;
    3> Object objectName=(Object)_table.getRowData();; -- include the code in the method u wanna fetch the row data.
    It'll work

Maybe you are looking for

  • Any prerequisites for using javascripts (JS) in SAP BPC 7.5NW (SP5)

    Hi, I keep getting evalution and parsing errors, every time I use a JS in my conversion files. It simple standard JS, like: js:parseInt(%external%) js:%external%.substring(2,5) etc Are there any prerequisites for using javascripts ?? Is there anywher

  • Help! Multiple quiz results in Results Analyzer erase previous results

    I'm very new to Captivate and having trouble with the Quiz Results Analyzer. I have 3 separate quizzes and have included the button for students to "post results" and log into an Acrobat account, then I can view their scores in the Analyzer. I'm usin

  • "Orphan Timeline" & "End Action Not Set." What does this mean????

    I am setting up a Blu-Ray DVD in Encore. I have a project on a Premiere Pro CS 5.5 Timeline, which is 2 and a half hours long with 24 Encore chapters in it. I have not yet Encoded it in Media Encoder as of yet. I am setting up all my menus and button

  • How to block changes in purchase order after purchase release

    Dear all Can u please tell us how to block any changes in purchase order after purchase order is released... (We don't want any line items addition or quantity addition or any changes once purchase order is released..)We wanted this for a particular

  • Keywords are not showing up on photos

    After going to great length to assign keywords to my entire photo library, I burned all the photos onto iPhoto DVDs in preparation for my computer getting a new hard drive installed. After new hard drive was installed, I reinstalled iPhoto 4.0.3 and