Adding multiple rows to the view

Hi guys,
I have a table (PlannerTab)to which a view (PlannerVO)is attached the table has a add new row button and at the page level i have a save button which will commit the database.
The user clicks the add new row button and enters values for the columns
when he clicks save i need to default someother view attributes based on the values he has entered .. for example if he has entered employeename i need to get the employee id from the db and populate my view object attribute(employeeid).... how do i handle this esp when the user creates more than 1 row before he commits the database.
Thanks in advance ......
Tom

Tom,
How is user entering the employee name? Is it a normal text input field? Then what will happen if the entered name is wrong. I will suggest to use an LOV for field like that so that when you select the name, the corresponding Id will also get stored on page context if you configure properly.
Otherwise if you are not bothered about the validated data, you can put the logic to get the Id from name while saving logic.
--Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Adding multiple rows to the HtmlDataTable in bean.

    Hi,
    I am facing a problem in displaying the table data which I am constructing in my Bean using HtmlDataTable.
    I am constructing a HtmlDataTable and binding it to a <h:dataTable>. As per the requirement, I need to display the data in different
    rows of the table. My table has a single column.
    in my JSP, I have
    <h:dataTable id="doclist" value="#{empobject.docListTable}" binding="#{empobject.docListTable}" />
    in my java bean, I have
    <code>
         public HtmlDataTable getDocListTable() {
         FacesContext facesContext = FacesContext.getCurrentInstance();
         docListTable=(HtmlDataTable) facesContext.getApplication().createComponent(HtmlDataTable.COMPONENT_TYPE);
         docListTable.setRows(10);
         <i> // Column1 </i>
         UIColumn columnComponent1 = new UIColumn();
         List childrenList = docListTable.getChildren();
              <i> //Column is added.</I>
         childrenList.add(columnComponent1);
              <i>//Adding the header info for the column</i>
              columnComponent1.setHeader(new HtmlOutputText().setValue("Header"));
         // DataModel
         ListDataModel listDataModel = new ListDataModel();
         ArrayList list =(ArrayList)columnComponent1.getChildren();
         <i>FIRST ROW </i>
         HtmlOutputText rowComponent = new HtmlOutputText();
         rowComponent.setValue("Training ");
         rowComponent.setId("Row1");
         rowComponent.setStyleClass("Section");
         list.add(rowComponent);
         <i>SECOND ROW </i>
         HtmlOutputText rowComponent1 = new HtmlOutputText();
         rowComponent1.setValue("OPeration");
         rowComponent1.setId("Row11");
         rowComponent1.setStyleClass("Section");
         list.add(rowComponent1);
         listDataModel .setWrappedData(list);
         // docListTable.setValue(listDataModel);
              return docListTable;
    </code>
         Here I am assuming that 2 rows were added to the table. But what's happening is
    1) Table header is added properly.
    2) Insteadof having 2 table rows, within a single row, both outputtext values displayed. (i.e Training OPeration)
    As I am pretty new to JSF world, I am requesting experts to give me solution as to display the information in two rows.
    In real, my requirement is so complex as I will have to display the <td> in different styles and all depending upon some conditions.
    But, this above mentioned problem has become a major hurdle to proceed further. As somany complexities involved, I wanted to construct this
    table in my java bean only.
    Please help me out in adding some sample code while giving a solution.
    Thanks,
    -Nir

    Hi,
    I am facing a problem in displaying the table data which I am constructing in my Bean using HtmlDataTable.
    I am constructing a HtmlDataTable and binding it to a <h:dataTable>. As per the requirement, I need to display the data in different
    rows of the table. My table has a single column.
    in my JSP, I have
    <h:dataTable id="doclist" value="#{empobject.docListTable}" binding="#{empobject.docListTable}" />
    in my java bean, I have
    <code>
         public HtmlDataTable getDocListTable() {
         FacesContext facesContext = FacesContext.getCurrentInstance();
         docListTable=(HtmlDataTable) facesContext.getApplication().createComponent(HtmlDataTable.COMPONENT_TYPE);
         docListTable.setRows(10);
         <i> // Column1 </i>
         UIColumn columnComponent1 = new UIColumn();
         List childrenList = docListTable.getChildren();
              <i> //Column is added.</I>
         childrenList.add(columnComponent1);
              <i>//Adding the header info for the column</i>
              columnComponent1.setHeader(new HtmlOutputText().setValue("Header"));
         // DataModel
         ListDataModel listDataModel = new ListDataModel();
         ArrayList list =(ArrayList)columnComponent1.getChildren();
         <i>FIRST ROW </i>
         HtmlOutputText rowComponent = new HtmlOutputText();
         rowComponent.setValue("Training ");
         rowComponent.setId("Row1");
         rowComponent.setStyleClass("Section");
         list.add(rowComponent);
         <i>SECOND ROW </i>
         HtmlOutputText rowComponent1 = new HtmlOutputText();
         rowComponent1.setValue("OPeration");
         rowComponent1.setId("Row11");
         rowComponent1.setStyleClass("Section");
         list.add(rowComponent1);
         listDataModel .setWrappedData(list);
         // docListTable.setValue(listDataModel);
              return docListTable;
    </code>
         Here I am assuming that 2 rows were added to the table. But what's happening is
    1) Table header is added properly.
    2) Insteadof having 2 table rows, within a single row, both outputtext values displayed. (i.e Training OPeration)
    As I am pretty new to JSF world, I am requesting experts to give me solution as to display the information in two rows.
    In real, my requirement is so complex as I will have to display the <td> in different styles and all depending upon some conditions.
    But, this above mentioned problem has become a major hurdle to proceed further. As somany complexities involved, I wanted to construct this
    table in my java bean only.
    Please help me out in adding some sample code while giving a solution.
    Thanks,
    -Nir

  • URGENT: Insert multiple rows in a view object cache from the same Page

    Please let me know whether I can get insert multiple rows in the same view object from a single page.
    I'm using UIX on Jdeveloper 9.0.5.2
    Thanks a lot.

    Hi,
    please check Duncan Mills how-to on this
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    Frank

  • Free alternatives to JTable that allow multiple rows in the header?

    My goal is to make a table with two or more rows in the column header. For instance, imagine I want to have the numbers of the days in the calendar as columns, then I want to have a row over them with the months, spanning over multiple days, then I want to have a row over that with the year, spanning over multiple months. I want these rows to be in the column header so they're always visible as you scroll down.
    Right now, I'm doing this with the first rows of the grid, out of the header, so they get out of view when the user scrolls down. Also, by being in the actual grid, they screw up sorting of the table.
    So I need 2 features. Multiple rows in the column header and the ability to merge multiple cells in the header.
    I've see some code to do this but it seemed too complicated so I want to see if I can find a component that does this out of the box first. I've seen 2 3rd party JTable-based components that do this but they're paid products and paying the full price of a component bundle for these features isn't a very attractive idea.
    So, does anyone know of a good table component that does this?

    Have a look at JXTable from the SwingX project. You should be able to find it via Google.

  • InsertRow does not show the inserted row on the view

    hello:
    The code below works well and shows the row on the view when added. However, when there are several existing rows and I have to scroll to next pages. an insert button on that page does not show the new Row at all. Is there a way for me to see the row even if I scroll over to the last page and try an insert?
    ViewObject myVO = this.getMyView();
    Row newRow = myVO.createRow();
    newRow.setAttribute("Id", myId);
    myO.insertRow(newRow);
    Thanks

    Hi,
    I also have problems with code above for inserting a new row.
    When I insert a new row in a table and click on column header (to change sorting), that row (and any other new row before committing) disappears from table. And if I commit that table (without missing row), the missing row reappears with next refresh.
    Selection in that table (using SelectOne component with Autosubmit=true) also doesn't work with new rows (with existing rows it works fine). Selection allways sticks on first inserted row!
    Something weird is happening here...
    Please help.

  • How can i select some row from multiple row in the same group of data

    I want to select some row from multiple row in the same group of data.
    ColumnA        
    Column B
    1                  OK
    1                   NG
    2                   NG
    2                          NG
    3                          OK
    3                          OK
    I want the row of group of
    ColumnA if  ColumnB contain even 'NG'
    row , select only one row which  Column B = 'NG'
    the result i want = 
    ColumnA         Column B
    1                         NG
    2                   NG
    3                          OK
    Thank you

    That's some awful explanation, but I think this is what you were driving at:
    DECLARE @forumTable TABLE (a INT, b CHAR(2))
    INSERT INTO @forumTable (a, b)
    VALUES
    (1, 'OK'),(1, 'NG'),
    (2, 'NG'),(2, 'NG'),
    (3, 'OK'),(3, 'OK')
    SELECT f.a, MIN(COALESCE(f2.b,f.b)) AS b
    FROM @forumTable f
    LEFT OUTER JOIN @forumTable f2
    ON f.a = f2.a
    AND f.b <> f2.b
    GROUP BY f.a

  • How would I go about adding multiple rectangles using the same lines of code?

    How would I go about adding multiple rectangles using the same lines of code? I would prefer to just run through a set of code every time I need a polygon. If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.

    >>How would I go about adding multiple rectangles using the same lines of code?
    You could create a method that creates and returns x number of Rectangle elements:
    public IEnumerable<Rectangle> CreateRectangles(int numberOfRectsToCreate)
    for (int i = 0; i < numberOfRectsToCreate; ++i)
    Rectangle rect = new Rectangle();
    rect.Fill = Brushes.Blue;
    rect.Width = 100;
    rect.Height = 100;
    yield return rect;
    ..and then call this method from anywhere in your code:
    IEnumerable<Rectangle> rects = CreateRectangles(5);
    foreach (Rectangle rect in rects)
    //add to StackPanel or do whatever with the Rectangle elements:
    yourStackPanel.Children.Add(rect);
    >>If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.
    When adding Point objects to a Polygon you can only add one per call to the Add method but you could call the Add method inside a loop, e.g:
    for(int i = 0; i < 10; ++i)
    //add to StackPanel or do whatever with the Rectangle elements:
    Polygon p = new Polygon();
    p.Points.Add(new Point());
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • How to Insert the row in the View object

    I want to insert the row in the view object by instantiating Impl.java file
    Could someone please let me know how to insert the blank row
    Thanks

    Inserting onto a view object should be done the following way:
    //vo is your view object
    Row aRow = vo.createRow();
    //Set your attributes
    aRow.setAttribute("AttributeName", objectValue);
    //insert
    vo.insertRow(aRow);
    That should work for you if you are programming the input. If you are using java components bound to columns in a view object then the input should be done automatically for you when you commit.

  • Adding multiple rows

    How do I add multiple rows at once? Thanks,
    Owen

    See page 69 of the English edition of the user guide for the basics. If you've already been there and read that, you may be saying; yes, but I want to add them in the middle of my table. That's an extension of adding rows to the end of the table. Add as many rows as you need, at the end of the table. Then select the new rows by click-dragging across the row labels. Then grab the selection by one of the labels and pull to the left to separate the new rows from the rest of the table. Without letting go, move the cursor up the table to where you want the new rows to reside, just to the right of the labels, and you will notice that insertion marks, a split line, appear along the row borders under the mouse. When you reach the destination, let go of the mouse switch and the blanks will drop in where you want them.
    Jerry

  • Want to update multiple rows of the report but getting a bug.

    hi,
    I am trying to update multiple rows of a report.For that I have created a teport with dynamic checkbox generated using ---HTMLDB_ITEM.CHECKBOX(1,utt.trouble_ticket_id) " "----.Checkboxes are rendered perfectly on the report.
    but when I tried to update the selected rows of the report as given in the documentation
    begin
    :P16_priority:=htmldb_application.G_F01.count;
    for i in 1..htmldb_application.G_F01.count
    loop
    update umanage_trouble_ticket set severity =:P16_priority where
    trouble_ticket_id = htmldb_application.G_F01(i);
    end loop;     
    end;
    I found that all the rows are updated.not only selected rows.
    and the count it gives =no of rows returned + no of rows selected.
    Please help me regarding this.
    thanx.
    BHARAT

    Hi Bernhard,
    I think that u didnt get y problem.
    When I take the value from "htmldb_application.g_f01(i)" then it should return id's of rows that are checked but when I do that it returns id's of all the rows.So I am not able to update only checked rows.
    from id's of rows i mean value provided when generating checkboxes through query.
    htmldb_item.checkbox(1,trouble_ticket_id) " "
    I am approching to the solution as specified in the documentation. "Adding check boxes to each row in a report".
    but still cant find any solution.
    thanx that u showed some intrest in my problem.
    If u can get the solution reply soon.
    Regards
    BHARAT

  • Adding new row to the reports list page

    How can I add a new report row in the reports list of the reports tab.
    Ex: a new row to the report "users by Date of Join report" is to be added
    How can we add Please help me out in this

    I am facing the same problem!
    camickr wrote:
    Try adding an empty row containing a null value for the String instead of the empty String.camickr, it will not help, the DefaultRowSorter in the "*+compare(int model1, int model2)+*" method return -1 if the first value is null and 1 if the sacond value is null. and incase of DESCENDING it mult by -1.
                    // Treat nulls as < then non-null
                    if (v1 == null) {
                        if (v2 == null) {
                            result = 0;
                        } else {
                            result = -1;
                    } else if (v2 == null) {
                        result = 1;
                    } else {
                        result = sortComparators[counter].compare(v1, v2);
                    if (sortOrder == SortOrder.DESCENDING) {
                        result *= -1;
                    }And this is the real problem!
    The empty line is sorted as the smallest value and incase of DESCENDING it will be the first line (because of the mult by -1).
    We could have overide it and incase of the empty row(usualy the last row) do not mult by -1 in DESCENDING mode.
    But the problem is that the "+*compare*+" method and it's caller "*+Row+*" inner class are private :-(
    It is not wise to do it but we can do like kmp83 wrote:
    kmp83  wrote:
    copy/duplicate "private" code from DefaultRowSorter into my extended class.Anyone have another suggestion?

  • Import xml data in Access when multiple rows use the same fieldname

    HI.
    First of all sorry for my english :-) I have a LiveCycle Designer ES form with multiple rows that I send via e-mail as XML data.
    example:
    Row 1
    Firstname: John  Lastname: Dow
    Row 2
    Firstname: Steve  Lastname: Austin
    The exported XML is OK but when I want to import it into my Access database, only one row is imported. I pretty sure that the problem comes from the fact that may exported XML use the same fieldname (what is important if I want to import data in the correct Access field) but I don't know what to do to be able to import all the rows of the same Form.
    Any idea?
    Thanks a lot
    Frederic

    Hi Viktor,
    In case of order recognition rules you should increase the relevancy in the newer version of the cartridge so appropriate ORR will be triggered. In other xqueries, you can try using new namespace as a model variable for each and every version of the cartridge
    Regards,
    JP

  • Splitting a message with multiple rows from the JDBC Adapter

    Hi,
    I'd like to split the resultset message with multiple row elements and process each row separately..
    Does someone have this experience?
    Thanx, Peter

    Hi Chandrasekhar,
    I tried to follow your advise, but I'm not able to complete the process correctly.
    Let me explain my process:
    First - output from the JDBC adapter goes into the first receive step. Of course, there are multiple ROW elements. (Should be marked the ingoing message marked in the container as Multiline??)
    The next should be the transformation:
    format of the source message is like
    <message>
      <row>
        <column>w</column>
      </row>
      <row>
        <column>w</column>
      </row>
    </message>
    In the message I have the ROW element as 0..unbounded
    and <column> element exactly 1
    This message should be mapped to multiple messages of the format:
    <message>
      <value>w</value>
    </message>
    How should be the mapping be done?
    Is it N:1 or 1:N (because in another thread there was an 1:N mapping advised)
    Then (as you say) should follow the Block step:
    Which message (container element) should be marked as Multiline? And what does it mean: Current Message?
    Can you give me some advise, when and how to use the multiline mark?
    Thanx a lot, Peter

  • Adding multiple rows to a cell?

    Is it possible to add multiple rows of text to a single cell? I am trying to create a workout log. Typicaly I would record several exercises with weights and repititions to a single days workout. Is this possible in Numbers?
    Suggestion?
    Thanks.

    Hi Dcneuro,
    I am trying to create a workout log. Typicaly I would record several exercises with weights and repititions to a single days workout.
    You can enter multiple lines of text in a cell... But I'm wondering why you would want to do that. A log would be more useful if you structure it like this, one exercise to a row and repeat the date where appropriate:
    If you structure it that way or similarly (rather than entering multiple lines in a cell) then you can then use Numbers to do the things spreadsheet software is designed to do: derive summary statistics, charts, etc.  The formulas in this summary table are:
    B2, copied down:  =COUNTIF(Log::B,A2)
    C2, copied down: =SUMIF(Log::B,A2,Log::D)
    D2, copied down: =AVERAGEIF(Log::B,A2,Log::D)
    E2, copied down: =AVERAGEIF(Log::B,A2,Log::C)
    Obviously these workout numbers make no sense. This is just a simple example to give you an idea of the kinds of things you can do if you structure your log properly.
    Also, have a look at the Running Log template (File>New>Personal>Running Log on the Mac, or on the iPad: + then Create Spreadsheet then scroll down to the Personal section).
    SG

  • Adding multiple rows or columns to a sheet

    Hi There,
    I'm new to this so pardon me please.......I've tried everything, I've looked everywhere..........does anyone know how to add in multiple rows or columns into the middle of a worksheet? There has to be a quicker way to throw in a quick 20 rows rather than just doing it one by one?????
    Frustratingly yours
    Morris

    Hello
    It seems that you missed a detail:
    +1. Highlight the number of columns you want to add before or after your insertion point.+
    +_2. Control click to get menu._+
    +3. Select "Add Columns Before" or "Add columns After" - whichever is appropriate.+
    without Control
    with Control depressed
    Yvan KOENIG (from FRANCE mercredi 6 février 2008 15:50:47)

Maybe you are looking for