How to use tree tables with CRUD operation for begineers ADF 11g

This is Friday night call for help.
This is only few sample ressources on the web for tree table and only one with CRUD operation.
I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
Depending if the user selection in the tree, the code insert from the master node to the children node.
Any other options because it is not working well.
Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "model.DepartmentsView";
final String empViewDefName = "model.EmployeesView";
if (ri != null && selectedNodeKey != null) {
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
Row foundRow = found[0];
String nodeDefname =
foundRow.getStructureDef().getDefFullName();
if (nodeDefname.equals(deptViewDefName)) {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
parents.insertRow(childrow);
} else {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
childrow.setAttribute("DepartmentId",
foundRow.getAttribute("DepartmentId"));
parents.insertRow(childrow);
} else {
System.out.println("Node not Found for " + selectedNodeKey);
}

I am looking for a sample that describe how to design a jsf page with a tree table.
So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
I got part of it working but not good enough.
By problem is the get insertion working
I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
#{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
Is it the right approach?
First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
we run this code
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
//ViewObjectImpl vo = getDepartmentsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
A new blank entry appears in the parent node and we enter a value.
The the problem starts when we want to add a child to this parent.
We select the created parent and press the insert button, this code get executed
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
childRows.insertRow(childrow);
But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
Do you see something wrong with the code?
The full code og my create children method is there below
I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
Thanks for your help
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
if (ri != null && selectedNodeKey != null) {
// last row
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
// foundRow is the row selected
Row foundRow = found[0];
// The row selected can be the parent node or the child node
String nodeDefname = foundRow.getStructureDef().getDefFullName();
// if parent row
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
//works but we try to resolve the creation of a parent
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
//childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
System.out.println("insert child row from master");
childRows.insertRow(childrow);
} else
//RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
//RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
Row childrow = ri.createRow();
System.out.println("insert child row from child ");
} else {
System.out.println("Node not Found for " + selectedNodeKey);
} else {
System.out.println(" param null try creating for first row : " +
ri + " * " + selectedNodeKey);
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
}

Similar Messages

  • How to convert the table with separate fields for every period

    Hi there,
    I have the table in R/3 called COSP. The table contains the separate fields for values of separate reporting periods, let's say Amount01, Amount02 etc. I need to extract this data to BW and load it into ODS, which contains the data like common key figure for amount and info object Fiscal Period. How to extract and tansform the data to be able to load it there?
    I mean, how to change the row like:
    100 100 200 200....
    for rows like:
    001 100
    002 100
    003 200
    004 200
    I hope you'll help,
    Kooyot

    Hi,
    you need to implement a bit of coding for that.
    With the 'do varying' statement abap provides a loop over those fields. Within this loop you can build up a new internal table with one entry for each period and amount.
    kind regards
    Siggi
    PS: I am not very familiar with CO, but I guess there will be a standard extractor for that.

  • How to create tree table with column headers

    hi,
    when i drag and drop a view object onto my .jspx page as a af: tree table ,
    am not able to get the column header of each column. all the columns in the table are just clubbed together not separated as in af:table.
    can anyone say how the column headers are created for the columns when we drop a view object as a tree table?

    Hi,
    this is not an option with the treeTable as it gets rendered by default when dragging and dropping the collection to the page. I haven't tried it, but I think you will have to check which node is getting rendered and based on this information add your own row layout . Sounds like a bit of coding work
    Frank

  • How to use Read table with out key fields

    Hi Experts,
    I need to retrieve the 2 internal tables data into single table.
    I have 3 common fields between the 2 tables but I don't have the Key fields. Then how to use the read table in this.
    Thanks in Advance.
    Edited by: satish4abap on Mar 10, 2010 9:39 AM

    Hi Satish,
    Key fields are nothing but the common fields with which you can pick the data from the second internal table.
    If you can paste your Internal table fields then we will be able to assit you better.
    However, in genral scenarios you can use it as below :
    In this scenario, we are putting data from 3 internal table to another single internal table.
    LOOP AT T_PRGEN INTO WA_PRGEN.
           WA_FINAL-GUID_PR       = WA_PRGEN-GUID_PR.
           WA_FINAL-ATTR20A       = WA_PRGEN-ATTR20A.
           WA_FINAL-ATTR05A       = WA_PRGEN-ATTR05A.
           WA_FINAL-ATTR05B       = WA_PRGEN-ATTR05B.
           WA_FINAL-ATTR05C       = WA_PRGEN-ATTR05C. " + DG1K902190
           WA_FINAL-ATTR10A       = WA_PRGEN-ATTR10A.
        READ TABLE T_V_TCAV201 INTO WA_V_TCAV201 WITH KEY ATTRV20 = WA_PRGEN-ATTR20A BINARY SEARCH.
        IF SY-SUBRC = 0.
          WA_FINAL-TEXT1   = WA_V_TCAV201-TEXT1.    "SUBID-TEXT1
        ENDIF.
        READ TABLE T_PNTPR INTO WA_PNTPR WITH KEY GUID_PR = WA_PRGEN-GUID_PR BINARY SEARCH.
        IF SY-SUBRC = 0.
           WA_FINAL-PRVSY  = WA_PNTPR-PRVSY.   "PROD NO
           WA_FINAL-GRVSY  = WA_PNTPR-GRVSY.   "LOGICAL SYS GROUP
        ENDIF.
      append wa_final to t_final.
    endloop.

  • How to Create a table with numeric trigger for INSERT

    Let me start off by saying that I am very new to DBMS.
    I need to create a Table with INSERT Trigger. I am not exactly sure if I need to have a BEFORE ot AFTER insert trigger but leanning towards AFTER.
    I have a Java code that will need insert a row each time that piece of code is executed. I would also like an oracle trigger to insert a unique numeric value (REC_ID) for that that record.
    I am totally lost and I am not sure how to go about it. Can you point me to the right direction?
    Basically my table will have the following 3 columns
    REC_ID NUMBER NOT NULL (uniquie value inserted by the trigger)
    PROPERTY_NAME VARCHAR2(100 BYTE)
    PROPERTY_VAL VARCHAR2(100 BYTE)
    Thank you in advance
    Eric

    Take a look at the following: Also please do a search in this forum.
    http://infolab.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html

  • How to use the iTrip with dock connector for iPod 5th gen. video

    I bought the new iTrip with dock connector for my iPod video 5th gen. and I followed exactly the instructions but I cannot hear any music on the radio. Has anyone experienced the same problem or the contrary has anyone managed to make it work. Thanks for your help.
    Inaha
    iMac 4   Mac OS X (10.3.9)   iPod 5th gen video

    I got the answer from someone else and it works.

  • How to use nested tables with the inner table in a separate row

    Hi,
    I am having a problem when changing our existing Adobe printform delivery note so that serial numbers are written for each item line.
    I've searched the forum and found many posts relating to nested tables, but none that had exactly my situation.
    Currently I print item lines like this (this uses the complete width of the form):
    Pos....Quantity...Material..........Description..................................................Date
    99.........99.........ABCDEFGH....alksdalksjdlkasjdlsajdlkjasldjaslkdjakslj........9999.99.99
    .................................................fskdjflsdfljsdflkjsdlkfjsdlkjfdfsf
    .................................................asdkadsfdkfhsdkfhskjdfhks
    but I want to add serial numbers after that for each item like this:
    Pos....Quantity...Material..........Description...................................................Date
    99.........99.........ABCDEFGH....alksdalksjdlkasjdlsajdlkjasldjaslkdjakslj.........9999.99.99
    .................................................fskdjflsdfljsdflkjsdlkfjsdlkjfdfsf
    .................................................asdkadsfdkfhsdkfhskjdfhks
    .................................................Serial numbers:
    .................................................9999999999..9999999999..9999999999
    .................................................9999999999..9999999999..9999999999
    I have added serial numbers to my the current table in the interface/context/data view so it look like this:
    TTYP - ITEM_FIELDS
    ...DATA structure
    ......POSNR
    ......QTY
    ......MATNR
    ......TTYP - ITEM_TEXTS
    .........DATA structure
    ............DESCRIPTION
    ......DATE
    ......TTYP - SERIAL_NOS
    .........DATA structure
    ............SERIAL_COL1
    ............SERIAL_COL2
    ............SERIAL_COL3
    In my Hierarchy I currently have this hierarchy and binding:
    Table - ITEM_FIELDS
    ...Body Row - DATA
    ......Cell - POSNR
    ......Cell - QTY
    ......Cell - MATNR
    ......Subform - ItemTexts
    .........Table - ITEM_TEXTS
    ............Body Row - DATA
    ...............Cell - DESCRIPTION
    ......Cell - DATE
    Now I am trying to add the SERIAL_NOS table into the ITEM_FIELDS/DATA body row right after the DATE cell - but I am not allowed to drag anything into the table structure.
    Does anybody have an ida how I can achieve this, please?
    Kind regards,
    Claus Christensen

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • How to  use data table with inputtext

    When i use datatable with input text it is not woking..
    Any one has used..
    Thanks in advance

    Thanks..
    My backing bean is in session scope ..
    This is my jsp.
    <h:dataTable id="dt1" border="1" cellpadding="5" cellspacing="3" rows="2" >
    <f:facet name="header">
    <h:outputText value="Header" />
    </f:facet>
    <h:column>
    <h:outputText value="#{sample.test}"></h:outputText>
    <h:outputText value="#{sample.test1}"></h:outputText>
    </h:column>
    <f:facet name="footer">
    <h:outputText value="The End" />
    </f:facet>
    </h:dataTable>
    When i run the application only header and footer is displayed..
    Is value attribute mandatory for datatable..

  • Issues with pagination when using Adobe table with Web dynpro for ABAP

    Hi All,
    I am facing strange issue with table text.
    I have three cols in table, one is of type Char255 and other two cols are of type string.
    The text in the col 1 is displayed perfectly but in other two cols of type string whenever we have pagination the text in table is getting truncated and in next page new row starts.
    Could you please tell me the settings that will enable flowing of text in the row of table to next page.
    Thanks,
    Arti.

    Check the properties of the text field you use for those columns (if you want to control it on this level) or check the same attribute for the row subform (one level up control): "allow page break within content".
    Regards Otto
    p.s.: we all have deadlines... and manage to pay something back. Think about it.

  • How to use USB interface with LabVIEW Embedded for ARM

    Hi everybody.
    I am developing an application based on the "LabVIEW Embedded for
    ARM". Now I am doing various tests using
    the evaluation board 2300 (with NXP LPC2378), but soon I will
    dedicate to program the micro used in my project (NXP
    LPC2148).
    During the tests, I have seen that "default" LabVIEW interface allows the use
    of CAN, I2C and SPI interfaces of the micro. I want to know how can I also use the
    USB interface that is on the micros -both LPC2148 and LPC2378- (pin USB_D + / D-, USB_UP_LED,
    USB_CONNECT, VBUS).
    Thanks in advance for your suggestions

    @chueco85
    If you've created an application in LabVIEW for ARM and you build it.
    you can go to tools >> ARM Module >> Show Keil uVision
    then go to he build options.
    the hex file will be created when you do a build.
    with flash magic :http://www.flashmagictool.com/
    you can program your device.
    Wouter.
    "LabVIEW for ARM guru and bug destroyer"

  • How to use old TC with new TC for storage only?

    Bought a 2TB TC and I still have my older 1 TB. Is their any way to use the older time capsule as a hard drive only and have that TC backed up along with my iMac on the new TC?

    Basically the answer to this is NO!!
    You can set it up but not the way you are thinking.
    The TC is now and forevermore a network drive. You can therefore bridge the TC and plug it into your network. The obvious place being your new TC. You can also turn off the wireless in the old TC.. it is now a network accessible hard disk.
    But Time Machine has a huge limitation.. it cannot backup network drives. So your TC cannot be backed up with your  iMac to the new TC. Not by Time Machine. You can buy a different backup software.. eg CCC is excellent and use that.
    Overall the TC is slower and less reliable than a USB drive plugged straight into your iMac.. especially if the iMac is newer type with USB3 ports.
    And the USB drive is local and so it can be backed up by Time Machine. (Must have HFS+ format and be included in the backup).

  • How to use oracle Portal with JDeveloper 10.1.3 ADF JSF

    Hi all
    I use JDeveloper 10.1.3
    I found out that the latest Portal 10.1.4 does not support JSF ADF
    IF I WANT USE PORTAL ,WHAT SHALL I DO?
    Thanks

    OracleAS Portal 10.1.4 does not support JSF portlets.
    JSF support in OracleAS Portal is in development.

  • Crud-operations-in-oracle-adf

    hi, I am using 11g 1.2 and ADF BC
    I followed the sample "http://andrejusb.blogspot.com/2010/05/crud-operations-in-oracle-adf-11g-table.html" and built a same thing in my bound task-flow.
    the 'Edit' , 'Insert' , 'Save' and 'Undo' button worked perfectly, but the 'Delete' button is not. let say I have three lines in the table, If I click a row and click the 'Delete' button, then all three lines are disapear, May I know why? Thanks for your guide!
    Rgds!

    But I do have the af:form in the page level. My table is inside the region which is in the page.
    I have added a af:Subform around my af:PanelCollection, but the result is worse, even when I click 'INSERT' button, the all three lines are disapear!!!
    May this sample and code can not work properly inside the region?
    Edited by: xsyang on Jul 19, 2011 4:42 AM
    finally I understand that the solution in the sample is for bindings in the page, but my af:table component in the page fragment. may not directly coding like sample. am i worng? can anybody guide me how to refer to binding in the fragment. Thanks!
    Edited by: xsyang on Jul 19, 2011 8:06 AM

  • How to create editable table with one empty row ?

    I'm looking for solution how to create editable table with one empty row using ADF BC. I have seen this solution in application that was created in JHeadstart and it's very well idea to use it insead of creation form.

    hammm, i do it this:
    drop the VO on the page, select Table->ADF Table....
    so, drop the botton create, from de VO->operations->create (the firts), and right botton (mouse) Edit binding....
    in Data collection select the VO, in Select an action select CreateInsert
    luck

  • How to create a table with events in smartforms?

    How to create a table with events view in smartforms?
    It doesn't like general table with header, main area and footer.
    for example:
    in smartforms: LE_SHP_DELNOTE
    table name is TABLEITEM(Delivery items table)

    Vel wrote:
    I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
    Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
    Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
    EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
    EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
    I'm using Oracle 10.2.0.4 version.
    Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements.

Maybe you are looking for

  • Acrobat 9.5.5 Windows 7 Page opens as a 3/4 page

    I cannot expand or minimize the page, the page is incomplete, and I cannot close the page without going to task bar.  When I click on Acrobat on the task bar, I then get one identical page over the other, again covering about 3/4 of the page.

  • Create different billing document types from same sales order type

    Hello, Please take a common document flow, just  like this one: - Sales Order (type ZE01 ) - Outbound Delivery - Billing Document ( ZA or ZB ) The billing document is based on the outbound delivery. Here is the requirement that we need to implement:

  • Problem with Applet load

    I can't load an applet in my page . Ocuur an error java.lang.UnsupportedClassVersionError message: unsupported major.minor versoin 48.0

  • Character Styles lost when reopening a document

    Having set Character Styles as usual (in this case with green type), when I reopened the same document all the type to which I had previously applied styles all reverted to black. When I checked the Character Styles list the green was as exactly as I

  • How to set regions to the same size

    Hi, Is there any way I can set all the regions on a page to the same size to prevent a staggering effect? e.g ------ region title 1 ------ ------------ region title 2 ------------ --- region title 3 --- I would like all titles to be the same length w