Add blank Row in table.

Hi,
I want to Add Blank row in my table so i can add corresponding data into them and on click of commit button it should get updated in database.
In table I have primary key as a sequences generated for that i already added expression in my Attribute of EO.
Please suggest me some code so i can achieve this.
Jdev :- 11.0.0.3
Thanks
Ramit Mathur

Since there is a sequence try this url, this will do the job:
see section "4.12.5 Assigning the Primary Key Value Using an Oracle Sequence"
http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcentities.htm#insertedID12

Similar Messages

  • Blank Row in table control

    Hi,
      Could anybody tell me how to add a n  number of blank lines to the table control UI element on some event. I have tried with the method CREATE_ELEMENT but its clearing the table control.
    I have two nodes called   "lines" and "table".  "Lines" node contains attribute "Count". and this attribute is binded to inputfiled "INP".
    When i click on button , based on inputfield value (INP)  that many blank rows should get appended to the table control.
    Can anybody advice me how can i get this ?
    Can anybody send me the sample code of CREATE_METHOD if its correct approach.
    Thanks and Regards
    Sireesha.

    Hi Saurav,
       Thanks a lot for your reply.  I am very Sorry to miss one point in my first thread. With the CREATE_ELEMENT its adding the blank rows to the table control but its adding in the second page. I thought its clearing the table control entries but in fact the blank rows are getting added in the second page.
    My doubt is how to add blank rows only in the first page.  I have unchecked the "footerVisible" property for the table control. so when i add rows to the table i cannt see the new rows.
    How to add blank rows only in the first page...?
    Thanks for your help.
    Regards
    Sireesha.

  • How to add blank rows between groups of duplicate rows?

    here is my setup
    create table #tmpA(rowID int identity(1,1), fName varchar(10), lName varchar(10))
    insert into #tmpA
    select 'a', 'b' union all
    select 'a', 'b' union all
    select 'c', 'd' union all
    select 'c', 'd' union all
    select 'e', 'f' union all
    select 'e', 'f' union all
    select 'g', 'h' union all
    select 'g', 'h'
    select distinct fName, lName
    into #tmpB
    From #tmpA
    select t1.* from #tmpA t1 Join #tmpB t2 on t1.fName = t2.fName and t1.lName = t2.lName
    --output
    rowID  fName  lName
    1             a         b
    2             a         b
    3             c         d
    4             c         d
    5             e         f
    6             e         f
    7             g         h
    8             g         h
    I want to add blank rows between rows 2 & 3 and between rows 4 & 5 and between rows 6 & 7 in the join query above.  Is there Tsql that can accomplish something like this to make the join query result look like the following output?
    rowID  fName  lName
    1            a          b
    2            a          b
    3            c          d
    4            c          d
    5            e          f
    6            e          f
    7            g          h
    8            g          h
    or if this is not possible I could go with an output like this:
    rowID  fName  lName
    1             a         b
    2             a         b
    3
    4             c         d
    5             c         d
    6
    7             e         f
    8             e         f
    9
    10           g         h
    11           g         h
    Rich P

    I came up with the following on my own.  I was just hoping there might be a fancier way to do this - like without looping -- and yes, I could/should do this in a presentation layer, but I just wanted to do this in Query Analyzer (or whatever they call
    it now -- SSMS ...) -- BTW, thanks CELKO for the suggestion about how to insert multiple rows using Values -- works great.
    If (object_id('tempdb..#tmpA') is not null) drop table #tmpA
    If (object_id('tempdb..#tmpC') is not null) drop table #tmpC
    create table #tmpA(rowID int identity(1,1), fName varchar(10), lName varchar(10))
    insert into #tmpA
    values
    ('a','b'),
    ('a','b'),
    ('c','d'),
    ('c','d'),
    ('e','f'),
    ('e','f'),
    ('g','h'),
    ('g','h')
    create table #tmpC(rrowID int Identity(1,1), rowID int, fName varchar(10), lName varchar(10))
    declare @i int, @s varchar(10), @t varchar(10), @u varchar(10), @v varchar(10)
    select @i = min(rowID) from #tmpA
    set @u = 'xx'
    While (@u != 'yy')
    Begin
       select @s = fName, @t = lName from #tmpA Where rowID = @i
       if exists(select 1 from #tmpA Where rowID = @i + 1)
          select @u = fname, @v = lName From #tmpA Where rowID = @i + 1
       else
          set @u = 'yy'
        if @s = @u And @t = @v
           begin  
             Insert Into #tmpC(rowID, fName, lName) Select * from #tmpA Where rowID = @i
             Insert Into #tmpC(rowID, fName, lName) Select * from #tmpA Where rowID = @i + 1
           end      
        else
           begin
              Insert Into #tmpC(rowID, fName, lName) Select null, '', ''  
           end
        set @i = @i + 1
    End
    select * from #tmpC
    --output from #tmpC
    rrowID  rowID  fName  lName
      1            1         a        b
      2            2         a        b
      3          NULL 
      4            3         c        d
      5            4         c        d
      6          NULL  
      7             5         e        f
      8             6         e        f
      9           NULL  
      10           7          g        h
      11           8          g        h
      12         NULL  
    Rich P

  • How to add empty rows in table in smart form

    how to add empty rows in table in smart form?
    plz help me regarding this
    send me ur queries to [email protected]

    You will need to add some extra rows to the internal table that your table is displaying.  Use a program node to append additional rows with a key but no argument.
    Alternaively a template may me more suitable for your requirement than a table.
    Finally, please do not include you e-mail address in your question.  Your question and the answers provided to it are for the benefit of everyone in the Community.
    Regards,
    Nick

  • Blank row in table UI Element

    Hi All,
    I am having a UI table element in my screen. Below that i ve some input fields. When i lead select a row in table, the input field data changes accordingly.
    When i do not have a row in the table, am getting an error message saying no value for the input field.
    So when there is no row in table, if i append a blank row. It is working fine. Can anyone give someother solution for this issue.??
    Because in this solution we have a blank row in table when the table is empty. We do not want this blank row
    Am binding the table and the input fields below to the same node. (So that the table row data automatically reflects in the input fields below).

    hii ,
    u shud try using this :
    1 create a context attribute , say attr1 ,of type string under a separate node of cardinality 1..1 or 1..n ,say context node is cn_all.
    2 bind this attribute  attr1 with the value property of the ur UI element INput Field's .
    3 set the value of ur attribute of attr1 in ONLEAD SELECT of the  TABLE .
      DATA lo_nd_cn_all TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_all TYPE REF TO if_wd_context_element.
        DATA ls_cn_all TYPE wd_this->element_cn_all.
        DATA lv_attr1 LIKE ls_cn_all-attr1.
    *   navigate from <CONTEXT> to <CN_ALL> via lead selection
        lo_nd_cn_all = wd_context->get_child_node( name = wd_this->wdctx_cn_all ).
    *   get element via lead selection
        lo_el_cn_all = lo_nd_cn_all->get_element(  ).
    *   set single attribute
        lo_el_cn_all->set_attribute(
          EXPORTING
            name =  `ATTR1`
          IMPORTING
            value = lv_attr1).
    in this way , u wud not be creating the empty rows , also wud not get runtime error for ur Input field
    regards,
    amit

  • Blank Row in table during Master Data Load

    I am having some success with my master data loads, but when I maintain the master data I have noticed that every table has had a blank row inserted.
    Does anybody know why and what I should do with the row (i.e. delete it)?

    This blank row is by default created and you can no way delete it.  Though you delete it, a new row with blank values will be appended.  This is required for some technical reason while reading the table within ABAP programs. 
    This is applicable only for SAP tables and may not be required for custom developed ones unless you want to use this in screen programs.
    Regards,
    Raj

  • Blank row in table....

    Hi all,
           I have a serious problem with the table UI.
    In screen 1 ,I have  a table where I multiselect the table rows and press "next Button" this action leads to the Screen 2, where a summary of the previously selected rows is displayed..
    Here I get a blank row as my first row along with the selected rows.
    This is some wht URGENT...
    Thanks in advance

    hi gopi
    when you get element from the table the indexing is from 1,2,3etc. and not from 0,1,2.so the line get element at index=1 retrieves the first element ,get element at index=2 retrieves the second element and so on.
    use one more variable say int k=1  to retrieve elements and use i for count.
    instead of this line
    element.setDelivery(wdContext.nodeHeader_Data().getHeader_DataElementAt(i).getDeliv_Numb());
    use k to get element say as follows
    element.setDelivery(wdContext.nodeHeader_Data().getHeader_DataElementAt(k).getDeliv_Numb());
    the modified code may be
    for (int i = 0,int k=1; i < size; i+,k+) {
    if (wdContext.nodeHeader_Data().isMultiSelected(i) || i == leadSelection) {
    element = wdContext.nodeItemdata().createItemdataElement(new Bapishipmentitem());
    element.setDelivery(wdContext.nodeHeader_Data().getHeader_DataElementAt(k).getDeliv_Numb());
    wdContext.nodeItemdata().addElement(element);
    regards
    saravana.

  • Blank Rows in Table on Range Change After Add

    I have a table and to add rows to it, you click on an add button, enter the information and then click save. After clicking save you return to the first page of the table. If you click on the Next option and change the table range, the table only shows the first record (in that new range) but the rest of the lines are all blank with no data. So for example, if my range is 5 and I have 8 records, after hitting the next button I see the 6th record and then 2 more rows but they are blank. How do I refresh the data after the range change to show the rest of the records properly? (Note, this appears to only happen after adding new records).

    Since there is a sequence try this url, this will do the job:
    see section "4.12.5 Assigning the Primary Key Value Using an Oracle Sequence"
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcentities.htm#insertedID12

  • How to insert one blank row in table using ODataModel?

    Hi,
    I have a table in which the data is being shown using ODataModel. Now I want to add a new row dynamically when user clicks on 'New' button. For this I know using JsonModel it would be something like below where every field in the table is almost  blank as I want users to enter the data in it and later I want to save the data in the model at server:
    var tableModel = table.getModel();
      var tableData = timeSheetTable.getModel().getData();
      tableData.modelData.push({"workItem":"item5","day1":"","day2":"","day3":"","day4":"","day5":"","day6":"","day7":""});
       tableModel.setData(tableData);
      timeSheetTable.setModel(tableModel);
    How this thing can be achieved using ODataModel? I can't push data like what is shown above.
    I tried searching examples for this but no luck. Any help would appreciated.
    Thanks,
    Supriya Kale

    Hi,
    I have a table in which the data is being shown using ODataModel. Now I want to add a new row dynamically when user clicks on 'New' button. For this I know using JsonModel it would be something like below where every field in the table is almost  blank as I want users to enter the data in it and later I want to save the data in the model at server:
    var tableModel = table.getModel();
      var tableData = timeSheetTable.getModel().getData();
      tableData.modelData.push({"workItem":"item5","day1":"","day2":"","day3":"","day4":"","day5":"","day6":"","day7":""});
       tableModel.setData(tableData);
      timeSheetTable.setModel(tableModel);
    How this thing can be achieved using ODataModel? I can't push data like what is shown above.
    I tried searching examples for this but no luck. Any help would appreciated.
    Thanks,
    Supriya Kale

  • Add New Row in Table on click of a button

    Hi All,
    I am using JDeveloper 11.1.5
    I have a af:table with a detailFacet. In this detailFacet there is an af:commandButton. On click of this commandButton I want a new row to be added to the table programmatically.
    In my Backing Bean I have following code for my button:
    public String cb1_action() {
    // Add event code here...
    //RowKeySetImpl rowKeySet = new RowKeySetImpl();
    CollectionModel tableModel = (CollectionModel)t1.getValue();
    JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
    DCIteratorBinding tableIteratorBinding = adfTableBinding.getDCIteratorBinding();
    // DCDataRow rw = (DCDataRow)tableIteratorBinding.getRowSetIterator().createRow();
    // tableIteratorBinding.getRowSetIterator().insertRow(rw);
    Row lastRow = tableIteratorBinding.getNavigatableRowIterator().last();
    Row newRow = tableIteratorBinding.getNavigatableRowIterator().createRow();
    newRow.setNewRowState(Row.STATUS_INITIALIZED);
    int lastRowIndex = tableIteratorBinding.getNavigatableRowIterator().getRangeIndexOf(lastRow);
    tableIteratorBinding.getNavigatableRowIterator().insertRowAtRangeIndex(lastRowIndex+1, newRow);
    tableIteratorBinding.setCurrentRowWithKey(newRow.getKey().toStringFormat(true));
    AdfFacesContext.getCurrentInstance().addPartialTarget(t1);
    return null;
    On running this ,I get an Exception some thing like UnsupportedOperationException.
    Please help me to find where I am wrong.

    Take a look at this post which could provide solution for your use-case:
    http://mjabr.wordpress.com/2011/07/02/how-to-control-the-location-of-the-new-row-in-aftable/
    Thanks,
    Navaneeth

  • Add new row in table between two rows - OATableBean

    Hi,
    I have a requirement where I need to add a new row between two rows. Lets say I have a table with 5 rows. I am envisioning having an icon (table switcher) on the row #1, which when clicked will insert/create a new row between rows #1 and #2 like #1.5, something that can be achieved in core forms. In core forms, when we click the add button, it immediately creates a new row before the current row ( and pushes other rows down). Is that possible with OATableBean. Please let me know if you have any ideas.
    Thanks,
    Ravi.

    Hi,
    I used following code to insert the row in the end
    public void createNewRow()
    XXEGASRLinesVOImpl vo =getXXEGASRLinesVO1();
    Row row1 ;
    int i;
    Row row[] = vo.getAllRowsInRange();
    row1 = vo.createRow(); //vo.createRowSet("10");
    vo.insertRowAtRangeIndex(row.length,row1);//.insertRow();
    row1.setNewRowState(Row.STATUS_INITIALIZED);
    Check if it works for you, you have to modify it to meet your requirement.
    Regards,
    Reetesh Sharma

  • Add a row in table

    Hi,
    I have a node with one arrtribute and a child node. The parent node is bound to a table ui element.I want to add a new row to the table in a button click.
    Before i have done with single node and it was working fine.But i have one child node inside the node.
    That is the problem.

    Hi Ramanan,
    Please make the 'emp detals'  node as a singletn node.
    Then apply the following code.
    first_node_elem type ref to if_wd_context_element
    child node type ref to if_wd_context_node
    child_node_elem type ref to if_wd_context_element
    first_node_elem = first_node->create_element(  ).
    * Set attributes
    first_node_elem->set_attribute(
    name = 'Emp_number'
    value = 10000
    first_node-.bind_element(
    new_item = first_node_elem
    set_initial_elements = abap_false).
    * Create Child node
    child_node = wd_context->get_child_node(  'Emp_Details' ) .
    child_node_elem = child_node->create_element( ).
    *Set child attributes
    child_node_elem->set_attributes(
    name = 'Name'
    value = 'Ramanan'
    child_node->bind_element(
    new_item = child_node_elem
    set_initial_elements = abap_false).
    I hope it helps.
    Regards,
    Sumit Oberoi

  • How to set total number of rows of table control

    Hi All,
    I want to set the total number of rows of table control. I don't want to display the blank rows in table.
    Regards,
    Shrinivas

    Need some fine tuning regarding the scrollbar height but it's a start
    Unless this isn't what you asked for
    Small number of rows
    Large number of rows
    Attachments:
    PlayingWithTable.vi ‏17 KB

  • Need to add a blank row to a table when checkbox selected

    Hi ALL,
    I have a custom page having 2 check boxes and few fields , i am doing search operation by entering one checkbox checked and few other fields and data displaying in table region.
    my requirement is when i select second check box and click one button as add new row it should create a blank row in the table, means table should  availabe with a blank row so that user can insert data,
    please help me on thsi
    Thnaks

                 Hi there ,
                 If you 're working with advance table then you have an default option to create a blank row , please through topic 'add another row '
                 in jdev guide .
                 If you are working the regular table region then you might follow the below code suggested .
                 Create a new item of the type button ( not submit button ) and handle the event in PFR of your controller class
                String addRow=pageContext.getParameter(EVENT_PARAM);   //  "addRow " is an event attached to table
                if("addAnotherRow".equals(addRow))  
                      am.invokeMethod("AddRow");
              In AMimplementation class :
       public void AddRow()
        OAViewObject headerVO = (OAViewObject)getsdaPacelineWorkupHeaderUpdateVO1();
        sdaPacelineWorkupHeaderUpdateVORowImpl rowh = (sdaPacelineWorkupHeaderUpdateVORowImpl)headerVO.getCurrentRow();
        rowh.getPacelineHeaderId();
        OAViewObject lineVO = (OAViewObject)getsdaPacelineWorkupLineUpdateVO1();
        Row lineRow = lineVO.createRow();
        Row lineRo = lineVO.last();
        lineRow.setAttribute("PacelineHeaderId",rowh.getPacelineHeaderId());   
        lineRow.setNewRowState(Row.STATUS_INITIALIZED);
        lineVO.last();
        lineVO.next();
        lineVO.insertRow(lineRow);
        lineVO.setCurrentRow(lineRow);
        lineVO.setCurrentRow(lineVO.last());
      Note : Replace your vo name in place of sdaPacelineWorkupHeaderUpdateVO1()
       Please let me know if you have any questions .
      Regards ,
    Keerthi

  • How to add a blank row into a datatable

    i hava adatatable which contains the datas from database.i need to add a new data so that i need a blank row which contain the same number of columns in the existing datatable.
    Pls Help..

    sorry i am a beginner in jsf..
    In the crud Example i saw a code in MyCrudBean.java.i wrote the code like that but the same stage only one row is coming i cant add n items .
    * Department.java
    * Created on Nov 22, 2007, 4:43:12 PM
    package datatable;
    import Item.DeptDatabase;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.webui.jsf.component.Body;
    import com.sun.webui.jsf.component.Form;
    import com.sun.webui.jsf.component.Head;
    import com.sun.webui.jsf.component.Html;
    import com.sun.webui.jsf.component.Link;
    import com.sun.webui.jsf.component.Page;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.FacesException;
    import javax.faces.component.html.HtmlDataTable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class Department extends AbstractPageBean {
    Connection con = null;
    PreparedStatement StmtRateSel = null;
    ResultSet rs = null;
    private List<DeptDatabase> list = new ArrayList();
    private int addCount = 1;
    private HtmlDataTable myDataTable;
    private static final int DEFAULT_TABLE_ROWS = 10;
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
    * <p>Automatically managed component initialization. <strong>WARNING:</strong>
    * This method is automatically generated, so any user-specified code inserted
    * here is subject to being replaced.</p>
    private void _init() throws Exception {
    private Page page1 = new Page();
    public Page getPage1() {
    return page1;
    public void setPage1(Page p) {
    this.page1 = p;
    private Html html1 = new Html();
    public Html getHtml1() {
    return html1;
    public void setHtml1(Html h) {
    this.html1 = h;
    private Head head1 = new Head();
    public Head getHead1() {
    return head1;
    public void setHead1(Head h) {
    this.head1 = h;
    private Link link1 = new Link();
    public Link getLink1() {
    return link1;
    public void setLink1(Link l) {
    this.link1 = l;
    private Body body1 = new Body();
    public Body getBody1() {
    return body1;
    public void setBody1(Body b) {
    this.body1 = b;
    private Form form1 = new Form();
    public Form getForm1() {
    return form1;
    public void setForm1(Form f) {
    this.form1 = f;
    // </editor-fold>
    * <p>Construct a new Page bean instance.</p>
    public Department() {
    public void deptsave() throws SQLException{
    connection();
    StmtRateSel      = con.prepareStatement("execute prcPnsDepartmentIns");
    rs = StmtRateSel.executeQuery();
    con.close();
    @Override
    public void init() {
    // Perform initializations inherited from our superclass
    super.init();
    // Perform application initialization that must complete
    // before managed components are initialized
    // TODO - add your own initialiation code here
    // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
    // Initialize automatically managed components
    // Note - this logic should NOT be modified
    try {
    _init();
    } catch (Exception e) {
    log("Department Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Perform application initialization that must complete
    // after managed components are initialized
    // TODO - add your own initialization code here
    * <p>Callback method that is called after the component tree has been
    * restored, but before any event processing takes place. This method
    * will <strong>only</strong> be called on a postback request that
    * is processing a form submit. Customize this method to allocate
    * resources that will be required in your event handlers.</p>
    @Override
    public void preprocess() {
    * <p>Callback method that is called just before rendering takes place.
    * This method will <strong>only</strong> be called for the page that
    * will actually be rendered (and not, for example, on a page that
    * handled a postback and then navigated to a different page). Customize
    * this method to allocate resources that will be required for rendering
    * this page.</p>
    @Override
    public void prerender() {
    * <p>Callback method that is called after rendering is completed for
    * this request, if <code>init()</code> was called (regardless of whether
    * or not this was the page that was actually rendered). Customize this
    * method to release resources acquired in the <code>init()</code>,
    * <code>preprocess()</code>, or <code>prerender()</code> methods (or
    * acquired during execution of an event handler).</p>
    @Override
    public void destroy() {
    * <p>Return a reference to the scoped data bean.</p>
    * @return reference to the scoped data bean
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1) getBean("SessionBean1");
    * <p>Return a reference to the scoped data bean.</p>
    * @return reference to the scoped data bean
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1) getBean("RequestBean1");
    * <p>Return a reference to the scoped data bean.</p>
    * @return reference to the scoped data bean
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1) getBean("ApplicationBean1");
    private void connection() {
    try{
    Context ctx = new InitialContext();
    System.out.println("context"+ctx);
    if(ctx == null )
    throw new Exception("Boom - No Context");
    DataSource ds = (DataSource)ctx.lookup("BiteRiteJNDI");
    if (ds != null) {
    con = ds.getConnection();
    System.out.println("connnn"+con);
    catch(Exception e)
    {System.out.println(e);}
    public void addDataItem() {
    while (addCount-- > 0) {
    DeptDatabase myNewDataItem = new DeptDatabase();
    //myNewDataItem.setEditMode(true);
    list.add(myNewDataItem);
    //log(myDataList);
    // Reset counter and go to last page.
    addCount = 1;
    // log(myDataList);
    // Reset counter and go to last page.
    //addCount = DEFAULT_ADD_COUNT;
    pageLast();
    System.out.println("in add itm");
    // list.add(new DeptDatabase());
    public List getListtt(){
    return list;
    public HtmlDataTable getMyDataTable() {
    if (myDataTable == null) {
    myDataTable = new HtmlDataTable();
    myDataTable.setRows(DEFAULT_TABLE_ROWS);
    return myDataTable;
    private static void log(Object object) {
    System.out.println("bejoy"+new Exception().getStackTrace()[1].getMethodName() + ": " + object);
    public void pageLast() {
    System.out.println("in Page last");
    int count = myDataTable.getRowCount();
    System.out.println("count"+count);
    int rows = myDataTable.getRows();
    System.out.println("rows"+rows);
    if (rows != 0) { // Prevent ArithmeticException: / by zero.
    System.out.println("not equals zero");
    myDataTable.setFirst(count - ((count % rows != 0) ? count % rows : rows));
    log(new Integer(myDataTable.getFirst()));
    public void setListtt(List<DeptDatabase> list) {
    this.list = list;
    * CRUD table: set datatable.
    * @param myDataTable The datatable.
    public void setMyDataTable(HtmlDataTable myDataTable) {
    this.myDataTable = myDataTable;
    jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : Department
    Created on : Nov 22, 2007, 4:43:11 PM
    Author : Administrator
    -->
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page binding="#{Department.page1}" id="page1">
    <webuijsf:html binding="#{Department.html1}" id="html1">
    <webuijsf:head binding="#{Department.head1}" id="head1">
    <webuijsf:link binding="#{Department.link1}" id="link1" url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body binding="#{Department.body1}" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{Department.form1}" id="form1">
    <h:dataTable binding="#{Department.myDataTable}" id="myDataTable" value="#{Department.listtt}" var="dataItem">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Departments"/>
    </f:facet>
    <h:inputText value="#{dataItem.department}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="StockItem"/>
    </f:facet>
    <h:inputText value="#{dataItem.stockItem}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="StockUnit"/>
    </f:facet>
    <h:inputText value="#{dataItem.stockUnit}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="MaxStock"/>
    </f:facet>
    <h:inputText value="#{dataItem.maxStock}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="MinStock"/>
    </f:facet>
    <h:inputText value="#{dataItem.minStock}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="ReorderLevel"/>
    </f:facet>
    <h:inputText value="#{dataItem.reorderlevel}"/>
    </h:column>
    </h:dataTable>
    <h:commandButton action="#{Department.addDataItem}" value="Add"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    i dont know wats the problem??
    pls send a sample code to add n items

Maybe you are looking for