Hierarchical table
Hi experts,
I have a hierarchical table. This is a normal Table with a mastercolumn, and the mastercolumn is binded to a recursive context node. The context node has a supply function which reads the data when the tree is selected in the table.
My question is: Is there a was to expand all nodes of the table? As I see this cannot be done, because even if I call the supply function, with the parent element, I cant provide the "node" parameter of the supply function..
Am I right?
Thanks
N.
Hello everyone,
It's possible here is the solution (You start calling this recursive method form an action where you get the root of your tree):
METHOD rec_subobj .
DATA: ls_nodes TYPE wdr_context_child,
lt_nodes TYPE wdr_context_child_map,
lt_all_nodes TYPE wdr_context_child_map,
lt_elements TYPE wdr_context_element_set,
lref_element TYPE REF TO if_wd_context_element,
lt_subobj TYPE wd_this->elements_bonus_sub_obj,
ls_subobj TYPE wd_this->element_bonus_sub_obj,
lv_counter TYPE NUMC3.
LOOP AT pt_nodes INTO ls_nodes.
* First set the expanded flag.
CALL METHOD ls_nodes-node->get_static_attributes_table
IMPORTING
table = lt_subobj.
LOOP AT lt_subobj INTO ls_subobj.
ls_subobj-expanded = abap_true.
MODIFY lt_subobj FROM ls_subobj.
ENDLOOP.
ls_nodes-node->bind_table( lt_subobj ).
* We've expanded on the current level, now colect the subobjects and recall this function
CALL METHOD ls_nodes-node->get_elements
RECEIVING
set = lt_elements.
LOOP AT lt_elements INTO lref_element.
lref_element->get_static_attributes( IMPORTING static_attributes = ls_subobj ).
CALL METHOD lref_element->get_child_nodes
RECEIVING
child_nodes = lt_nodes.
* lt nodes is a hashed table
LOOP AT lt_nodes INTO ls_nodes.
* lt_nodes is a hashed table, so we have to change the name :)
CONCATENATE ls_nodes-name lv_counter INTO ls_nodes-name.
INSERT ls_nodes INTO TABLE lt_all_nodes.
lv_counter = lv_counter + 1.
ENDLOOP.
ENDLOOP.
ENDLOOP.
IF lt_all_nodes IS NOT INITIAL.
wd_this->rec_subobj( pt_nodes = lt_all_nodes ).
ENDIF.
ENDMETHOD.
I should be able to give points to myself
Similar Messages
-
How can I use one hierarchical table as a node of another hierarchical tabl
I have a requirement where I have two hierarchical tables and one table should work as node for other table . How to achieve this??
To elaborate more the structure is like
Main Table (Company Structure)
Sub table Consolidation Groups which has got hierarchical structure
Sub table Entity which is also hierarchical.
The Entity table should act as a node for table Consolidation Groups
How can I achieve this functionality??
Thanks
Suvarnayou misunderstood me apparently. I said you can't organinze to tables so one serves as a node's value of the other. Let me show you wnat I suggested by an example.
First table has such values:
-A
|-B
|-C
and the second one is
-x
|-y
|-z
-p
|-r
|-s
I thought you wanted to confine relationships between them so fo B node be able to select only x's branch and for C - only p's branch. If it's similar to the truth then let's create another table with two fields. Field one points to table containing capital letters and field two - lower case letters. Both fields are of type lookup pointing to an hierachial tables. Now when you populate this table you'll create records like (I list two columns):
B - y
B - z
C - r
C - s
from your orinal table from now you should point to the above table. So instead of having two fields each pointing to its own table and compeling you to think how to organize two hierarchies, now you have only one field pointing to a table with all valid combinations. When you populate this table though YOU have to decide what such combinations are. It may make sense (if you have different users) to restrict access to this table on read-only level for regular users to preserve the valid combinations.
Hope it helps but if I understood your wrong give a concrete example. -
Hi All,
I want to know is there any work around to create a Hierarchical table in Adobe Interactive Forms?I need 2 levels of hierarchy(means 2 master columns in a single table)
regards
Sumithi Sumit...
This might be helpful for you... See this PDF file URL;
If it will be helpful for you means reward some points...
<b>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c29a4d25-0c01-0010-50ae-e69d0e1c61f3</b>
Urs GS -
How to query 2 hierarchical tables and join?
Hi
I've been bashing my head against a well to get this to work efficiently in 10g. I can solve the following writing some pretty horrible SQL, but can't figure out how to do it elegantly and optimally.
We have two hierarchical tables as follows:
select * from data_categories dac
dac_code name parent_dac_code
10 MANAGEMENT
20 MEDICATION 10
30 PROCEDURE 10
40 SURVEY
50 ASSESS
60 NATURE 50
70 OBSERVE 60
select * from data_elements des
des_id name parent_des_id dac_code display_seq
100 DOSE MEDICATION 1
110 1MG 100 1
120 2MG 100 2
130 3MG 100 3
140 ROUTE MEDICATION 2
150 ET 140 1
160 EM 140 2
170 RESPONSE MEDICATION 3
180 IMPROVED 170 1
190 NOCHANGE 170 2
200 FILED MANAGEMENT 1
210 INPUT OBSERVE 1
You'll note:
1) We have hierarchies in both tables, and a fk from data_elements to data_categories via the dac_code.
2) The depth of both data_categories and data_elements is unlimited.
3) There is no single root node record in either table.
4) The appropriate PK and FK indexes exist.
We need to write a query that returns the following results:
root_dac_code parent_dac_code des_level des_id name display_seq
ASSESS OBSERVE 1 210 INPUT 1
MANAGEMENT MEDICATION 1 100 DOSE 1
MANAGEMENT MEDICATION 2 110 1MG 1
MANAGEMENT MEDICATION 2 120 2MG 2
MANAGEMENT MEDICATION 2 130 3MG 3
MANAGEMENT MEDICATION 1 140 ROUTE 1
MANAGEMENT MEDICATION 2 150 ET 1
MANAGEMENT MEDICATION 2 160 EM 2
MANAGEMENT MEDICATION 1 170 RESPONSE 3
MANAGEMENT MEDICATION 2 180 IMPROVED 1
MANAGEMENT MEDICATION 2 190 NOCHANGE 2
MANAGEMENT MANAGEMENT 1 200 FILED 1
You'll also note we need to return the data in order of the root_dac_code, then parent_dac_code, followed by the display_seq.
Does anybody know how to write this query in an elegant and optimal manner?
Many thanks for any help!
Cheers,
CM.Flakey model.
Why does data_elements.dac_code appear to refer to data_categories.name rather than data_categories.dac_code?
You do not appear to be ordering by root_dac_code, parent_dac_code and display_seq (if you were MANAGEMENT/MANAGEMENT would not be at the end). Did you perhaps mean ORDER BY root_dac_code, des_id, display_seq?
Something like this perhaps?
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE TABLE data_categories (
2 dac_code NUMBER,
3 name VARCHAR2 (30),
4 parent_dac_code NUMBER);
Table created.
SQL> INSERT INTO data_categories VALUES (10, 'MANAGEMENT', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (20, 'MEDICATION', 10);
1 row created.
SQL> INSERT INTO data_categories VALUES (30, 'PROCEDURE', 10);
1 row created.
SQL> INSERT INTO data_categories VALUES (40, 'SURVEY', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (50, 'ASSESS', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (60, 'NATURE', 50);
1 row created.
SQL> INSERT INTO data_categories VALUES (70, 'OBSERVE', 60);
1 row created.
SQL> CREATE TABLE data_elements (
2 des_id NUMBER,
3 name VARCHAR2 (30),
4 parent_des_id NUMBER,
5 dac_code VARCHAR2 (30),
6 display_seq NUMBER);
Table created.
SQL> INSERT INTO data_elements VALUES (100, 'DOSE', NULL, 'MEDICATION', 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (110, '1MG', 100, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (120, '2MG', 100, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (130, '3MG', 100, NULL, 3);
1 row created.
SQL> INSERT INTO data_elements VALUES (140, 'ROUTE', NULL, 'MEDICATION', 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (150, 'ET', 140, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (160, 'EM', 140, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (170, 'RESPONSE', NULL, 'MEDICATION', 3);
1 row created.
SQL> INSERT INTO data_elements VALUES (180, 'IMPROVED', 170, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (190, 'NOCHANGE', 170, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (200, 'FILED', NULL, 'MANAGEMENT', 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (210, 'INPUT', NULL, 'OBSERVE', 1);
1 row created.
SQL> SELECT dc.root_dac_code, de.parent_dac_code,
2 de.des_level, de.des_id, de.name, de.display_seq
3 FROM (SELECT LEVEL des_level, des_id, name, parent_des_id,
4 CONNECT_BY_ROOT (dac_code) parent_dac_code, display_seq
5 FROM data_elements da
6 START WITH parent_des_id IS NULL
7 CONNECT BY PRIOR des_id = parent_des_id) de,
8 (SELECT CONNECT_BY_ROOT (name) root_dac_code, name dac_code
9 FROM data_categories
10 START WITH parent_dac_code IS NULL
11 CONNECT BY PRIOR dac_code = parent_dac_code) dc
12 WHERE de.parent_dac_code = dc.dac_code
13 ORDER BY dc.root_dac_code, de.des_id, de.display_seq;
ROOT_DAC_CODE PARENT_DAC_CODE DES_LEVEL DES_ID NAME
ASSESS OBSERVE 1 210 INPUT
MANAGEMENT MEDICATION 1 100 DOSE
MANAGEMENT MEDICATION 2 110 1MG
MANAGEMENT MEDICATION 2 120 2MG
MANAGEMENT MEDICATION 2 130 3MG
MANAGEMENT MEDICATION 1 140 ROUTE
MANAGEMENT MEDICATION 2 150 ET
MANAGEMENT MEDICATION 2 160 EM
MANAGEMENT MEDICATION 1 170 RESPONSE
MANAGEMENT MEDICATION 2 180 IMPROVED
MANAGEMENT MEDICATION 2 190 NOCHANGE
MANAGEMENT MANAGEMENT 1 200 FILED
12 rows selected.
SQL> -
Hierarchical Table Commands in MDM API
Hi,
I found only RetrieveLimitedHierTreeCommand,RetrieveLimitedHierChildrenCommand in MDM API for hierarchical tables.
So how can we add a child or a sibling, delete a child or sibling to the nodes of the tree.
Can anyone please give me links or some documentation on how to proceed with this.
The other problem we are facing when retrieving the children using RetrieveLimitedHierTreeCommand
When we add a search on the command it does not retrieve the children. it says the children for the level one node are null but if i donto set search it retrieves the children for all the nodes.
Is there any specific setting that has to be done for using the search.
Please let me know
Thanks,
PadmajaHi Greg,
I am adding the code snippet below. Can you please look into this and check if there are any problems
RetrieveLimitedHierTreeCommand hr=new RetrieveLimitedHierTreeCommand(conAccessor);
Search ser=new Search(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
FieldId fldId =repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getField("New_Code").getId();
StringValue fldVal = new StringValue("G0440");
ser.addSearchItem(new FieldSearchDimension(fldId),new TextSearchConstraint(fldVal.getString(),TextSearchConstraint.EQUALS));
hr.setSearch(ser);
ResultDefinition rd=new ResultDefinition(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
rd.setSelectFields(repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getFieldIds());
hr.setResultDefinition(rd);
hr.setSession(userSessionID);
try {
hr.execute();
} catch (CommandException e) {
e.printStackTrace();
When i execute this part of code and get the children. i get the children as null.
Thanks,
Padmaja -
Navigate to needed row in hierarchical table
Hello everyone.
I have a problem related to Table UI Element. In my case it has hierarchical structure. By default, all nodes are collapsed. I need to provide user with ability to find nessesary element: if it's leaf, then all parents above have to be expanded and row is selected. I did this. Unfortunately, if found row has big index, it isn't displayed and I have to scroll down to find my selected row. I know that I can set "FIRST_VISIBLE_ROW" property of table. But how can I determine index? Internal table which is the source for hierarchical table has different number of rows. For example my internal table has 700 rows, when in the UI table only 120 rows are displayed.Does anybody know?
-
Best way to create hierarchies tables
Good morning all,
I wanted to discuss the best practices of creating hierarchies to be consumed by OBIEE. As far as I understand, OBIEE has been optimized to use flattened hierarchies, such as:
ROW_WID CITY COUNTRY
1 NEW YORK CITY USA
2 MOSCOW RUSSIA
3 KIEV UKRAINE
4 SYDNEY AUSTRALIA
5 ATLANTA USA
Let's call it option 1. The only problem with this is that it has a potential to grow very wide. Also, There's a chance for confusion when there're duplicate entries, such as "New York" (city) and "New York State". Also, it's not always possible to define hierarchical relationships between data in a flat table - so-called ragged hierarchies. I found two major way of dealing with those (stack and flattening them out). Are there any other ways to deal with those? Specifically, I'm interested in dealing with hierarchies that involve complex positioning (a person might be a manager vertically, but managed horizontally - or - a person can have 2 managers - on different levels).
Also, in the example above - can I create dimensional outriggers (assign surrogate keys instead of text values to the dim - such as having NEW YORK as 100, MOSCOW as 200)? Sort of snowflaking a dimension. I was asked to do a proof of concept for this - but haven't been successful so far. If yes, could you please provide a simple Dim Outrigger < Dim < Fact diagram.
Thank youThanks Peter - I've checked that document before (I believe it's based on Kurt Wolffe's document on Siebel Analytics which I checked as well).
This option is fine if you're not going to do frequent changes - but in my case - it'll be a hell to maintain. We're sort of trying to prototype best solution - and it seems as flattening hierarchies is the best option, of course, given its limitations.
Also, there's another option of taking a different path and splitting and then building separate hierarchies -
How to calculate level summary in Hierarchical tables by level
Hi ,
We all know how to present the data in hieararchical tables using CONNECT BY PRIOR and START WITH clause.
Did anybody get the sum on each level , rolling up this informations up to Top level.
Ex. Table Project_Task
(Task_id number,
Task_name varchar2(20),
Parent_task_id number,
Budget number).
Need to get report having sum(budget) on different level.
Level Task Name Total Budget
-----------------------------------------I don't have 8.1.7 to test with anymore, but as I recall, you can create a new table from a join of your original tables, then query the new table. I believe you could also create a temporary table and insert into it, then select from that. What I am not sure about is whether 8.1.7 will allow the hierarchical subquery in the select clause or not. Please test the following and let us know. If not, then you will probably have to use PL/SQL.
scott@ORA92> -- test data:
scott@ORA92> CREATE TABLE task_id_hierarchy
2 AS
3 SELECT empno task_id,
4 ename task_name,
5 mgr parent_task_id
6 FROM emp
7 /
Table created.
scott@ORA92> CREATE TABLE budget_data
2 AS
3 SELECT empno task_id,
4 sal budget
5 FROM emp
6 /
Table created.
scott@ORA92> -- additional table and query:
scott@ORA92> CREATE GLOBAL TEMPORARY TABLE project_task
2 AS
3 SELECT tih.task_id,
4 tih.task_name,
5 tih.parent_task_id,
6 bd.budget
7 FROM task_id_hierarchy tih, budget_data bd
8 WHERE tih.task_id = bd.task_id
9 /
Table created.
scott@ORA92> INSERT INTO project_task
2 SELECT tih.task_id,
3 tih.task_name,
4 tih.parent_task_id,
5 bd.budget
6 FROM task_id_hierarchy tih, budget_data bd
7 WHERE tih.task_id = bd.task_id
8 /
14 rows created.
scott@ORA92> SELECT LEVEL,
2 task_name,
3 budget,
4 (SELECT SUM (NVL (budget, 0))
5 FROM project_task t2
6 START WITH t2.task_id = project_task.task_id
7 CONNECT BY PRIOR t2.task_id = t2.parent_task_id) total_budget
8 FROM project_task
9 START WITH parent_task_id IS NULL
10 CONNECT BY PRIOR task_id = parent_task_id
11 /
LEVEL TASK_NAME BUDGET TOTAL_BUDGET
1 KING 5000 29025
2 JONES 2975 10875
3 SCOTT 3000 4100
4 ADAMS 1100 1100
3 FORD 3000 3800
4 SMITH 800 800
2 BLAKE 2850 9400
3 ALLEN 1600 1600
3 WARD 1250 1250
3 MARTIN 1250 1250
3 TURNER 1500 1500
3 JAMES 950 950
2 CLARK 2450 3750
3 MILLER 1300 1300
14 rows selected. -
I would like to convert XML in to a simple table structure, with:
- 1 row per tag
- a tag_id for each tag
- a parent tag_id for each tag
- the attribute for each tag
E.g. for the following
DROP TABLE test_xml;
CREATE TABLE test_xml OF XMLType;
INSERT INTO test_xml
VALUES
(XMLType
('<tag1>
<tag2_1>
<tag2_1_1 Value1="A">
<tag2_1_1_1 Value2="B" Value3="C"/>
</tag2_1_1>
<tag2_1_2 Value1="D">
<tag2_1_2_1 Value2="E" Value3="F"/>
</tag2_1_2>
<tag2_1_3 Value1="G">
<tag2_1_3_1 Value2="H" Value3="I"/>
</tag2_1_3>
<tag2_1_4 Value1="J">
<tag2_1_4_1 Value2="K" Value3="L"/>
</tag2_1_4>
</tag2_1>
<tag2_2>
<tag2_2_1 Value4="M"/>
</tag2_2>
<tag2_3>
<tag2_3_1 Value5="N">
<tag2_3_1_1>
<tag2_3_1_1_1>
<tag2_3_1_1_1_1 Value6="O" Value7="P">
<tag2_3_1_1_1_1_1 Value2="Q" Value3="R"/>
</tag2_3_1_1_1_1>
</tag2_3_1_1_1>
</tag2_3_1_1>
<tag2_3_1_2>
<tag2_3_1_2_1 Value8="S" Value9="T"/>
</tag2_3_1_2>
</tag2_3_1>
</tag2_3>
</tag1>'
set long 1000
select * from test_xml;
SYS_NC_ROWINFO$
<tag1>
<tag2_1>
<tag2_1_1 Value1="A">
<tag2_1_1_1 Value2="B" Value3="C"/>
</tag2_1_1>
<tag2_1_2 Value1="D">
<tag2_1_2_1 Value2="E" Value3="F"/>
</tag2_1_2>
<tag2_1_3 Value1="G">
<tag2_1_3_1 Value2="H" Value3="I"/>
</tag2_1_3>
<tag2_1_4 Value1="J">
<tag2_1_4_1 Value2="K" Value3="L"/>
</tag2_1_4>
</tag2_1>
<tag2_2>
<tag2_2_1 Value4="M"/>
</tag2_2>
<tag2_3>
<tag2_3_1 Value5="N">
<tag2_3_1_1>
<tag2_3_1_1_1>
<tag2_3_1_1_1_1 Value6="O" Value7="P">
<tag2_3_1_1_1_1_1 Value2="Q" Value3="R"/>
</tag2_3_1_1_1_1>
</tag2_3_1_1_1>
</tag2_3_1_1>
<tag2_3_1_2>
<tag2_3_1_2_1 Value8="S" Value9="T"/>
</tag2_3_1_2>
</tag2_3_1>
</tag2_3>
</tag1>I want to generate the following output
tag_id parent_tag_id tag_name attribute
1 tag1
2 1 tag2_1
3 2 tag2_1_1 Value1="A"
4 3 tag2_1_1_1 Value2="B" Value3="C"
5 2 tag2_1_2 Value1="D"
6 5 tag2_1_2_1 Value2="E" Value3="F"
7 2 tag2_1_3 Value1="G"
8 7 tag2_1_3_1 Value2="H" Value3="I"
9 2 tag2_1_4 Value1="J"
10 9 tag2_1_4_1 Value2="K" Value3="L"
11 1 tag2_2
12 11 tag2_2_1 Value4="M"
13 1 tag2_3
14 13 tag2_3_1 Value5="N"
15 14 tag2_3_1_1
16 15 tag2_3_1_1_1
17 16 tag2_3_1_1_1_1 Value6="O" Value7="P"
18 17 tag2_3_1_1_1_1_1 Value2="Q" Value3="R"
19 14 tag2_3_1_2
20 19 tag2_3_1_2_1 Value8="S" Value9="T"I can find lots of ways of converting data to XML but not much this other way round
In the actual code, the XML will be in a file - not sure how much of a difference to the solution..
Thanks,
BenHi Ben,
Here's a first "working" solution, but certainly not the optimum considering the way I compute node IDs :
SQL> select * from v$version
2 ;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL>
SQL> SELECT x.*
2 FROM test_xml t,
3 XMLTable(
4 'declare function local:getID($e as node()) as xs:integer
5 {
6 for $i at $j in $d/descendant::*
7 where $i is $e
8 return $j
9 }
10 ; declare function local:getChildren($e as node()) as element()*
11 {
12 for $i in $e/*
13 return element r
14 {
15 element tag_id {local:getID($i)},
16 element parent_tag_id {if (not($e is $d)) then local:getID($e) else()},
17 element tag_name {local-name($i)},
18 element attr_list {string-join(for $j in $i/@* return concat(local-name($j),''="'',$j,''"'')," ")}
19 }
20 | local:getChildren($i)
21 }; local:getChildren($d)'
22 passing t.object_value as "d"
23 columns tag_id number path 'tag_id',
24 parent_tag_id number path 'parent_tag_id',
25 tag_name varchar2(30) path 'tag_name',
26 attr_list varchar2(100) path 'attr_list'
27 ) x
28 ;
TAG_ID PARENT_TAG_ID TAG_NAME ATTR_LIST
1 tag1
2 1 tag2_1
3 2 tag2_1_1 Value1="A"
4 3 tag2_1_1_1 Value2="B" Value3="C"
5 2 tag2_1_2 Value1="D"
6 5 tag2_1_2_1 Value2="E" Value3="F"
7 2 tag2_1_3 Value1="G"
8 7 tag2_1_3_1 Value2="H" Value3="I"
9 2 tag2_1_4 Value1="J"
10 9 tag2_1_4_1 Value2="K" Value3="L"
11 1 tag2_2
12 11 tag2_2_1 Value4="M"
13 1 tag2_3
14 13 tag2_3_1 Value5="N"
15 14 tag2_3_1_1
16 15 tag2_3_1_1_1
17 16 tag2_3_1_1_1_1 Value6="O" Value7="P"
18 17 tag2_3_1_1_1_1_1 Value2="Q" Value3="R"
19 14 tag2_3_1_2
20 19 tag2_3_1_2_1 Value8="S" Value9="T"
20 rows selected
Do you really want attributes displayed that way?
Edited by: odie_63 on 23 mars 2011 13:04 -
Best way to pass back data from hierarchical table view?
Hi,
I have a view hierarchy using a navigation controller that's working pretty well. One of the bottom level views is a table view where the user selects an item from the list. This bottom view checks the list item, saves the selected item in a property, and then pops the view off the stack.
What's the best way to alert the parent view that the child view has been popped off so it can retrieve the value in the property? The calling push returns immediately, so it doesn't appear to be a modal call. I want to be able to use the same controller from other parent forms, so I need to be able to do this without referencing the parent in the child form ideally.
Thanks
RayHi, well let me try to explain it a bit more
- Add a "delegate" property to your child-viewcontroller-class
- Define a protocoll within each chil-viewController-class
In this example let us name it "didSelectValue:(NSString *)value"
- In the parent-viewcontroller before pushing a child-viewcontroller set it's delegate property to "self" (parent-viewcontroller)
- In the parent-viewcontroller implement to protocoll-method "didSelectValue:(NSTring *)value"
- In the child view-controller in (assuming it is a tableViewcontroller) add some code in didSelectRowAtIndexPath that checks if the delegate is set and check if it responds to selector "didSelectValue:(NSString *)value". If so, call it with the selected value. -
Hi all,
I need a query to get the emp hirarchical table as follows: (BASED ON EMP TABLE)
KING --> JONES --> SCOTT
KING --> JONES --> FORD
and so on...
In other words, all the path from the president to the last level of the organization in one line each. For example:
King is manager of Jones, and Jones is chief of Scott and Ford, so I want to display both paths.
Moreover, I don't want to filter anything, I want to show all the possible paths for all the employees.
I would appreciate your help.
Thanks.In Oracle 8i, you can do the same thing, using the following packaged function by Solomon Yakobson:
CREATE OR REPLACE
PACKAGE Hierarchy
IS
TYPE BranchTableType IS TABLE OF VARCHAR2(4000)
INDEX BY BINARY_INTEGER;
BranchTable BranchTableType;
FUNCTION Branch(vLevel IN NUMBER,
vValue IN VARCHAR2,
vDelimiter IN VARCHAR2 DEFAULT CHR(0))
RETURN VARCHAR2;
PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
END Hierarchy;
Package created.
CREATE OR REPLACE
PACKAGE BODY Hierarchy
IS
ReturnValue VARCHAR2(4000);
FUNCTION Branch(vLevel IN NUMBER,
vValue IN VARCHAR2,
vDelimiter IN VARCHAR2 DEFAULT CHR(0))
RETURN VARCHAR2
IS
BEGIN
BranchTable(vLevel) := vValue;
ReturnValue := vValue;
FOR I IN REVERSE 1..vLevel - 1 LOOP
ReturnValue := BranchTable(I)|| vDelimiter || ReturnValue;
END LOOP;
RETURN ReturnValue;
END Branch;
END Hierarchy;
Package body created.
COLUMN name FORMAT A10
COLUMN val FORMAT A35
SELECT name, empno, mgr, val
FROM (SELECT LPAD (' ', ( level - 1 )) || ename name, empno, mgr,
hierarchy.branch (LEVEL, ename, ' --> ') AS val
FROM emp
START WITH mgr IS NULL
CONNECT BY PRIOR empno = mgr)
ORDER BY 4
NAME EMPNO MGR VAL
KING 7839 KING
BLAKE 7698 7839 KING --> BLAKE
ALLEN 7499 7698 KING --> BLAKE --> ALLEN
JAMES 7900 7698 KING --> BLAKE --> JAMES
MARTIN 7654 7698 KING --> BLAKE --> MARTIN
TURNER 7844 7698 KING --> BLAKE --> TURNER
WARD 7521 7698 KING --> BLAKE --> WARD
CLARK 7782 7839 KING --> CLARK
MILLER 7934 7782 KING --> CLARK --> MILLER
JONES 7566 7839 KING --> JONES
FORD 7902 7566 KING --> JONES --> FORD
SMITH 7369 7902 KING --> JONES --> FORD --> SMITH
SCOTT 7788 7566 KING --> JONES --> SCOTT
ADAMS 7876 7788 KING --> JONES --> SCOTT --> ADAMS
14 rows selected. -
Troubles when trying to transfer a table with hierarchical column to a tree
In WD for ABAP, I encounter many troubles when trying to transfer a table with hierarchical column to an actual tree. In my UI, the tree is in the left pane and the detail for a node is in the right.
1. With hierarchical table, I can bind the dataSource of the table directly to the context node in View which is mapped to a context node in component controller which is a DDIC structure. But with a tree, is it possible to map the dataSource of the tree or node in tree to context node in component controller?
2. With hierarchical table, when lead selection changed, the detail info in the right pane will change automatically. But with a tree, it seems to have to be implemented via action by myself.
Can anyone give some suggestions to overcome these troubles?Wei,
<i>With tree table, the dataSource of the table is just bound to the context node ORG_UNIT</i>
Hmmm... You said, that this node resides in component controller, not in view controller. Or does it?
Any recursive node that can be displayed with tree table can be displayed with tree as well. Period.
1. Create tree and bind data source to the same node as table data source.
2. Create tree node type and bind it to the same node again.
3. Create one additional calculated attribute in forementioned node (type boolean) that inverts/negates attribute for table column "hasChildren" to tree node "isLeaf".
4. That's all.
VS -
Hello! There,
I have to add a JTable in java application, It is so simple but I have problem when requirements has changed like Table/Grid should be in Hierarchical. Means Hierarchical Table like Table with Tree. I have a Hierarchical Tree Table sample but this is a XUL example. So, If you want to see, create a sample.xul file and put below code to that and open using mozilla browser.
THANKS IN ADVANCE
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="Hierarchical-Tree" title="Programming Languages at Hierarchical Tree"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tree rows="24">
<treecols>
<treecol id="college-student" label="Language" primary="true" flex="3"/>
<treecol id="degree" label="Uses" flex="6"/>
<treecol id="session" label="Version" flex="1"/>
</treecols>
<treechildren>
<treeitem container="true" open="true">
<treerow>
<treecell label="Java"/>
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Servlet"/>
<treecell label="Enterprise App. Development"/>
<treecell label="2.4"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Java Server Pages (JSP)"/>
<treecell label="Enterprise App. Development"/>
<treecell label="2.0"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Java Server Faces (JSF)"/>
<treecell label="Enterprise App. Development"/>
<treecell label="2.0"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</tree>
</window>Hi,
A well implemented JTreeTable can you found as a part from the SwingX-library.
You can find those library at here
Olek -
Sql query to retrieve records in parent sibling relationship in a table
I need help to write this Sql query on a table where it has the primary_id, parent_id, and sibling_id. A new row can be created with or without the parent_id and sibling_id. However most of the new rows are created from an existing row and the primary_id
of the existing row is inserted to the parent_id of the new row. This can go on for many many rows such as (B's parent_id has A primary_id, A's sibling_id has B primary_id), (C's parent_id has B primary_id, B's sibling_id has C primary_id), (D's
parent_id has C primary_id, C's sibling_id has D primary_id), What I want is when user pass on a primary_id on a row, the query will give me back all the related parent_id or sibling_id records. For example User pass the A's primary_id the query will
give me back the Row B and Row C as a sibling rows or user pass the C's primary_id the query should give me back row B and Row A as parent rows. Thanks
KahluaCheck http://social.technet.microsoft.com/wiki/contents/articles/21062.t-sql-hierarchical-table-sorting-with-a-parent-child-relation.aspx
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Webdynpro :: Hierarchical ALV display
Hello All,
I am new to Webdynpro ABAP. I am having a problem in ALV Hierarchical List display.
As per my requirement, I need to display an ALV Hierarchical List with first column as Hierarchical column.
Hierarchical level shpuld be up to 6 levels.
I have made the table as Hierarchical table , set the column as hierarchy.
I am able to display only one node and one leaf.
Sample Code:
data : alv_config_table type ref to CL_SALV_WD_CONFIG_TABLE.
wd_this->alv_config_table->if_salv_wd_table_settings~set_display_type(
if_salv_wd_c_table_settings=>display_type_hierarchy ).
DATA : lr_column_hier TYPE REF TO cl_salv_wd_column.
lr_column_hier = wd_this->alv_config_table->if_salv_wd_column_settings~get_column( 'NODE_CONTENT' ).
lr_column_hier->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
Anyone can suggest, how I can display multi level hierarchy for the same column.
Thanks in advance for yours inputs.
Hari GajulaHi,
You can refer this article: [ALV and Standard Table as Hierarchy in Web Dynpro ABAP|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f].
I hope it helps.
Regards
Arjun
Maybe you are looking for
-
MD04 - Showing partial delivered sales order
Hi, We work with allocation run (AFS), and too many sales orders are not delivered with 100%, some itens are delivered with a partial quantity and others items are not delivered. Consider the example: Sales order 0000321654 Item: 0010 - Ordered: 100
-
Move workflow status column from one library to another in Sharepoint 2010
Good morning, I have two libraries in the same site, LibraryA and LibraryB. On LibraryA, users upload documents upon which they start a collect signatures workflow. The view on LibraryA contains a column with the signatures workflow name showing st
-
Converting data volume type from LINK to FILE on a Linux OS
Dear experts, I am currently running MaxDB 7.7.04.29 on Red Hat Linux 5.1. The file types for the data volumes were initially configured as type LINK and correspondingly made links at the OS level via "ln -s" command. Now (at the OS level) we have
-
Is there a cable for syncing but NOT charging
My wife and I like to let the battery rundown before we recharge it, but the Sync cable we have for use in the car also charges the battery, often times going from 70% charge to fully charge rther than letting it run low before recharging. Is there a
-
I continue to get a "Start up disk full" message when I try to use iPhoto or iMovie. It then tells me to delete items, but it does not tell me how to do this. Can some one walk me through it? Thanks