Next_record into tree
I have a tree and i have an toolbox (next, previous, last etc).
I want to implement next_record in tree so than the user can go to the next node using the toolbox. What can I do ?
I'm a beginner with Forms :-)
Thanks
Hi,
find the node you will display highlighted with ftree.find_tree_node.
To toggle highlighting use ftree.set_tree_selection.
eg.
--fill tree with test nodes
--set Node3 highlighted
DECLARE
node ftree.node;
BEGIN
node := ftree.add_tree_node('t.ree', ftree.root_node, ftree.parent_offset, ftree.last_child, ftree.leaf_node, 'Node1', NULL, 'Node1');
node := ftree.add_tree_node('t.ree', ftree.root_node, ftree.parent_offset, ftree.last_child, ftree.leaf_node, 'Node2', NULL, 'Node2');
node := ftree.add_tree_node('t.ree', ftree.root_node, ftree.parent_offset, ftree.last_child, ftree.leaf_node, 'Node3', NULL, 'Node3');
ftree.set_tree_selection('t.ree', node, ftree.select_on);
END;
--toggle higlighting to Node1
--find Node1 by value
--start at root_node
DECLARE
node ftree.node;
BEGIN
node := ftree.find_tree_node('t.ree', 'Node1', ftree.find_next, ftree.node_value, ftree.root_node, ftree.root_node);
if not ftree.id_null(node) then
ftree.set_tree_selection('t.ree', node, ftree.select_on);
end if;
END;
Similar Messages
-
SharePoint 2013---How to convert current left Navigation into tree view
Hi All,
I want to convert current left navigation into tree view in SharePoint 2013. When we click on Modify Navigation and set headers and links; I need that should be convert into tree view. All headers should be expandable to thier links.
I just want tree view on navigation headers and links. not for all site and subsites which we can enabled from site settings --> Modify All Site settings --> Tree view
Please help me Master Page editing on Navigation Generation.. Thanks in advance!
Regards,
AnnaHi Anna,
If you want to replace the Quick Launch part with the custom treeview web part in master page, you can comment out or remove the quick launch code block "<!--SPM:<SharePoint:SPNavigationManager id="QuickLaunchNavigationManager.....>....<>-->",
then insert the custom web part snippet code in proper location in seattle master page, then all pages inheriting the seattle master page will have this web part.
Note, please back up the master page before customizing the original master page for recovery.
http://msdn.microsoft.com/en-us/library/office/jj862341(v=office.15).aspx
http://www.sharepointpals.com/post/Add-snippets-in-Page-layout-using-design-manager
Thanks,
Daniel Yang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
Daniel Yang
TechNet Community Support -
MDM Hierarchy Table Into Tree (Java WebDynpro)
Hello all,
I have a requirement of showing a MDM Hierarchy Table into Tree UI element.
These are the steps am following:
1) MDM Connectivity
2) Using RetrieveLimitedHierTreeCommand command to retrieve tree structure of the table
3) Using getChildren() method of each node to get the children
4) Made a tree ui element with a recursive node
Now since the Hierarchy table can reach any level of nodes how do i write code for dynamic tree node/leaf generation?
Please guide me through with detailed steps/code if possible?
Regards,
Yogesh BhatiaHi Yogesh,
After getting the HierNode you have to recursively populate the hierarchy tree using the below code:
private void createHierarchyTree( parent_element, com.sap.mdm.data.HierNode HierNode)
if(HierNode != null && HierNode .getChildren() != null)
for(int iChildCount=0 ; iChildCount < HierNode .getChildren().length ; iChildCount++)
IPublic<comp name>.Iparent_element objTreeElement = parent_element.node<Recursive node name>().create<name>Element();
objTreeElement.setattr1(HierNode.getChildren()[iChildCount].getDisplayValue());
objTreeElement.setattr1_Recid(HierNode.getChildren()[iChildCount].getId().id);
parent_element.node<Recursive node name>().addElement(objTreeElement);
// call the method recursively
createHierarchyTree(objTreeElement, HierNode.getChildren()[iChildCount]);
This will populate the tree, you need to create an action in the tree view and link it to TreeNode Type action property using which you can get the selected value.
Hope this helps!!
Cheers,
Arafat -
MDM Hierarchy Table Into Tree UI Control in ABAP WebDynpro & MDM ABAP APIs
Experts,
I am a newbie to ABAP / MDM ABAP APIs. I am looking into the possibility of using Tree as as a UI control in a webdynpro abap application to represent hierarchy tables, perform hierarchy / taxonomy search, create and update records involving hierarchy fields, using MDM ABAP APIs.
I would like to seek inputs to check whether and how, is it possible to use MDM ABAP APIs to:
1. To perform taxonomy search on material table
2. To Create material records in the main table involving taxonomy fields.
3. To search on main table records using taxonomy attribute values as search parameters.
4. To use Tree UI control with in WebDynPro ABAP, to peform above operations.
We intend to use function modules - service calls from within WebDynPro ABAP applications, hence would like to know the feasibility, actual build effort and complexity of function modules.
Inputs and advice on same will be highly appreciated and duly rewarded.
Regards,
Paras1. To perform taxonomy search on material table - if material table is of type Taxonomy then possible
2. To Create material records in the main table involving taxonomy fields - possible . you create records in main table and assign value of field to that of taxonomy table entry
3. To search on main table records using taxonomy attribute values as search parameters. - possiblr
4. To use Tree UI control with in WebDynPro ABAP, to peform above operations. - yes possible
dont mix between hierarchy table and taxonomy table
they are diff in MDM , but it is possible to build UI with WD tree element for each of these types.
all that you said are supported in ABAP APIs
thanks
-Adrivit -
Read directory structure into tree structure
Hi ya,
I want to be able to write a command line program that either takes a root node(directory root) or just takes the directory root from where the program is run reads in the directory tree into a tree structure. Then I want to analyse the tree.
I would like to know what are the best ways to do this and what are the most useful classes.
Thanks a lot for the help,
MartinHere is a quickie du(1) (disk usage) clone that should give some hints. The Getopt class is something I wrote so you won't be able to compile this as such.
import java.io.File;
public class Du
public static void main(String args[])
boolean sum_mode = false;
Getopt getopt = new Getopt(args, "sk");
while (getopt.next()) {
switch (getopt.option()) {
case 's':
sum_mode = true;
break;
case 'k':
break;
default:
System.err.println("du: unknown option \"-" + getopt.optionName() + "\"");
System.exit(1);
if (getopt.parameterCount() == 0) {
du(new File("."), ".", sum_mode, true);
} else {
for (int n = 0; n < getopt.parameterCount(); n++) {
String name = getopt.parameter(n);
du(new File(name), name, sum_mode, true);
private static long du(File file, String path, boolean sum_mode, boolean topmost_file)
long bytes = 0;
if (file.isDirectory()) {
File files[] = file.listFiles();
String sub_path = path + "/" + file.getName();
for (File f : files)
bytes += du(f, sub_path, sum_mode, false);
if (!sum_mode || topmost_file)
System.out.println((bytes / 1024) + "\t" + path + "/" + file.getName());
} else {
bytes = file.length();
if (topmost_file)
System.out.println((bytes / 1024) + "\t" + path + "/" + file.getName());
return bytes;
} -
JTreeTable - advance probelms? puting into tree a JCheckBox
I carefuly read the example in the Swing Connection but the problem is as such presently i modified the component to view the tree in the Table with the aditional column named Selected) but the finla version is as such i would like to put JCheckBox into the tree component vied in the Table. So far I achieved it but it looks terrible (the renderer is cutting some space at the bottom of every table line of tree) what i did ? As shown in example when JTree component is returned I return my JCheckTree component.
My question is anybody seen working example with combination JCheckBoxTreeTable Component or knows how to write one ?
Any code snipets, examples i would be very greatful.
MchmielewskiHi.,
See whether it is useful... It can bring u checkbox in each node and you can select or deselect.
-sps :)
private MyMutableTreeNode topNode = null;
private MyMutableTreeNode mainSection = null;
private MyMutableTreeNode subSection = null;
private MyMutableTreeNode child = null;
private DefaultTreeModel treeModel = null;
// constructor..
public void createTree()
topNode = new MyMutableTreeNode("Root Node");
treeModel = new DefaultTreeModel(topNode);
createNodes(topNode);
jTree1.setModel(treeModel);
MyRenderer renderer = new MyRenderer();
MyCellEditor myEditor = new MyCellEditor();
jTree1.setCellRenderer(renderer); // TO DRAW EACH NODE IN TREE.
jTree1.setCellEditor(myEditor); // TO EDIT OR DO ANY ACTIONS IN THE NODES.
jTree1.setEditable(true); // TO DO ANY ACTION IN THE NODES.
jScrollPane1.setViewportView(jTree1);
public void createNodes(DefaultMutableTreeNode tNode)
mainSection = new MyMutableTreeNode("Parent 1");
tNode.add(mainSection);
subSection = new MyMutableTreeNode("Child 1");
mainSection.add(subSection);
child = new MyMutableTreeNode("Leaf 1");
subSection.add(child);
subSection = new MyMutableTreeNode("Child 2");
mainSection.add(subSection);
child = new MyMutableTreeNode("Leaf 2");
subSection.add(child);
class MyMutableTreeNode extends DefaultMutableTreeNode implements ItemListener
JCheckBox x;
String title;
public MyMutableTreeNode(String title)
super(title);
this.title = title;
x = new JCheckBox(title);
x.addItemListener(this);
x.setBackground(Color.WHITE);
public void itemStateChanged(ItemEvent ie)
MyMutableTreeNode parentNode;
MyMutableTreeNode leaf;
MyMutableTreeNode tempParent;
MyMutableTreeNode tempRoot;
if( ie.getStateChange() == ItemEvent.SELECTED )
int count = getChildCount();
// System.out.println("Selected "+title);
if( count != 0 )
this.getCheckBox().setSelected(true);
for ( int i = 0; i < count; i++)
parentNode = (MyMutableTreeNode)this.getChildAt(i);
if( parentNode.getChildCount() != 0 )
parentNode.getCheckBox().setSelected(true);
for ( int j = 0; j< parentNode.getChildCount(); j++ )
leaf = (MyMutableTreeNode)parentNode.getChildAt(j);
leaf.getCheckBox().setSelected(true);
else
parentNode.getCheckBox().setSelected(true);
else
this.getCheckBox().setSelected(true);
//System.out.println("There are no Child Nodes for "+this.title);
else if( ie.getStateChange() == ItemEvent.DESELECTED )
int count = getChildCount();
if( count != 0 )
this.getCheckBox().setSelected(false);
for ( int i = 0; i < count; i++)
parentNode = (MyMutableTreeNode)this.getChildAt(i);
if( parentNode.getChildCount() != 0 )
parentNode.getCheckBox().setSelected(false);
for ( int j = 0; j < parentNode.getChildCount(); j++ )
leaf = (MyMutableTreeNode)parentNode.getChildAt(j);
leaf.getCheckBox().setSelected(false);
else
parentNode.getCheckBox().setSelected(false);
else
this.getCheckBox().setSelected(false);
jTree1.repaint(); // THIS IS FASTER THAN jTree1.updateUI();
public JCheckBox getCheckBox()
return x;
class MyRenderer implements TreeCellRenderer
public MyRenderer()
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
return ((MyMutableTreeNode)value).getCheckBox();
class MyCellEditor implements TreeCellEditor
public void addCellEditorListener(javax.swing.event.CellEditorListener l)
public void cancelCellEditing()
public Object getCellEditorValue()
return this;
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
return ((MyMutableTreeNode)value).getCheckBox();
public boolean isCellEditable(java.util.EventObject isEditableEvt)
if (isEditableEvt instanceof MouseEvent)
MouseEvent me = (MouseEvent) isEditableEvt;
if (me.getClickCount() == 1)
return true;
return false;
public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
public boolean shouldSelectCell(java.util.EventObject anEvent)
return true;
public boolean stopCellEditing()
return true;
} -
Unable to expand child links in ALV Tree
Hi,
I have written the following code for ALV Tree using function modules.
REPORT ZSID_ALV_TREE.
type pool declarations for tree
TYPE-POOLS : fibs,stree.
tables: ekko.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
it_ekpo TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
wa_ekpo TYPE t_ekko.
DATA:w_repid type sy-cprog.
*Data declaration for additional node information
DATA : t_node TYPE snodetext.
*Internal table and wa decl for nodes
DATA : it_node LIKE TABLE OF t_node INITIAL SIZE 0,
wa_node LIKE t_node.
*Start of selection event
START-OF-SELECTION.
*Select the data for tree
PERFORM fetch_data.
*Build the hierarchy for tree
PERFORM build_hierarchy.
*Build Tree for display
PERFORM build_tree.
*& Form fetch_data
text
--> p1 text
<-- p2 text
FORM fetch_data .
SELECT ebeln
up to 10 rows
FROM ekko
INTO corresponding fields of TABLE it_ekko .
loop at it_ekko into wa_ekko.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
FROM ekpo
appending TABLE it_ekpo
where ebeln eq wa_ekko-ebeln.
endloop.
endform.
*& Form build_hierarchy
text
--> p1 text
<-- p2 text
FORM build_hierarchy .
*Building the nodes and hierarchy for tree
CLEAR : it_node[], wa_node.
wa_node-type = 'T'.
wa_node-name = 'Product Hierarchy Level'.
wa_node-tlevel = '01'.
wa_node-nlength = '35'.
wa_node-color = '4'.
wa_node-text = 'Test'.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
loop at it_ekpo into wa_ekpo.
wa_node-type = 'P'.
wa_node-name = 'Purchasing Doc'.
wa_node-tlevel = '02'.
wa_node-nlength = '25'.
wa_node-color = '4'.
wa_node-text = wa_ekpo-ebeln.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the values of internal table into tree
wa_node-type = 'P'.
wa_node-name = 'Material No'.
wa_node-tlevel = '03'.
wa_node-nlength = '20'.
wa_node-color = '1'.
wa_node-text = wa_ekpo-matnr.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
ENDLOOP.
ENDFORM. " build_hierarchy
*& Form build_tree
text
--> p1 text
<-- p2 text
FORM build_tree .
*Fm for constructing the tree
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = it_node.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
w_repid = SY-CPROG.
*FM for displaying the tree
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
CALLBACK_PROGRAM = w_repid
CALLBACK_USER_COMMAND = 'USER1_COMMAND'
CALLBACK_TEXT_DISPLAY =
CALLBACK_MOREINFO_DISPLAY =
CALLBACK_COLOR_DISPLAY =
CALLBACK_TOP_OF_PAGE =
CALLBACK_GUI_STATUS =
CALLBACK_CONTEXT_MENU =
STATUS = 'IMPLICIT'
CHECK_DUPLICATE_NAME = '0'
COLOR_OF_NODE = '4'
COLOR_OF_MARK = '3'
COLOR_OF_LINK = '1'
COLOR_OF_MATCH = '5'
LOWER_CASE_SENSITIVE = 'X'
MODIFICATION_LOG = 'X'
NODE_LENGTH = 40
TEXT_LENGTH = 75
TEXT_LENGTH1 = 0
TEXT_LENGTH2 = 0
RETURN_MARKED_SUBTREE = 'X'
SCREEN_START_COLUMN = 0
SCREEN_START_LINE = 0
SCREEN_END_COLUMN = 0
SCREEN_END_LINE = 0
SUPPRESS_NODE_OUTPUT = 'X'
LAYOUT_MODE = ' '
USE_CONTROL = 'L'.
IMPORTING
F15 =
ENDFORM. " build_tree
FORM USER1_COMMAND TABLES node STRUCTURE seucomm
USING command
CHANGING value(exit)
VALUE(LIST_REFRESH).
write 'Hi'.
endform.
But I have a problem
1. I can expand the child links in tree structure when I comment the exporting parameter CALLBACK_USER_COMMAND in the function Module 'RS_TREE_LIST_DISPLAY'.
2 But when i uncomment the exporting parameter I am unable to expand the child links in output.
Please let me know if i have missed something in the code.
Useful answers will be rewarded
Regards,
SiddharthHi Sidhhart,
Check out this prog.
REPORT Z_KULDEEP_ALV_HIERARCHY
message-id zord
line-size 270.
Tables:
Vbap,
Vbak.
*& PROGRAM VARIABLES
type-pools slis.
*& INTERNAL TABLES & STRUCTURES
data:
begin of t_header occurs 0,
EXPCOL type c,
vbeln type vbak-vbeln,
audat type vbak-audat,
vkorg type vbak-vkorg,
vtweg type vbak-vtweg,
spart type vbak-spart,
end of t_header,
begin of t_item occurs 0,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
pstyv type vbap-pstyv,
end of t_item,
t_fieldcat type standard table of slis_fieldcat_alv with header line,
t_event type standard table of slis_alv_event with header line,
x_keyinfo type slis_keyinfo_alv,
x_layout type slis_layout_alv,
x_variant like disvariant.
*& GLOBAL VARIABLES
data:
g_repid type sy-repid,
g_formname type slis_formname value 'TOP_OF_PAGE'.
*& SELECTION SCREEN *
selection-screen begin of block a with frame title text-000.
Select-options : s_date for vbak-audat obligatory.
p_date type vbak-audat.
selection-screen end of block a.
*& INITIALIZATION *
initialization.
clear : g_repid,t_header,t_item.
refresh : t_header,t_item.
g_repid = sy-repid.
*& AT SELECTION-SCREEN *
at selection-screen.
if s_date-high > sy-datum.
message e001.
endif.
start-of-selection.
select vbeln audat vkorg vtweg spart from vbak
into corresponding fields of table t_header
where audat in s_date.
select vbeln posnr matnr arktx pstyv from vbap
into table t_item
for all entries in t_header
where vbeln = t_header-vbeln.
end-of-selection.
perform sub_display_alv.
*& Form sub_display_alv
text
--> p1 text
<-- p2 text
form sub_display_alv.
*column 1
perform sub_populate_fieldcatalog using:
'VBELN' " field name
'T_HEADER' " table name
'ORDER' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 2
perform sub_populate_fieldcatalog using:
'AUDAT' " field name
'T_HEADER' " table name
'ORDERDATE' " column heading
'10' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 3
perform sub_populate_fieldcatalog using:
'VKORG' " field name
'T_HEADER' " table name
'SALES ORG' " column heading
'6' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 4
perform sub_populate_fieldcatalog using:
'VTWEG' " field name
'T_HEADER' " table name
'DIVISION' " column heading
'2' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 5
perform sub_populate_fieldcatalog using:
'SPART' " field name
'T_HEADER' " table name
'CHANNEL' " column heading
'4' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 6
perform sub_populate_fieldcatalog using:
'vbeln' " field name
'T_item' " table name
'Order' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 7
perform sub_populate_fieldcatalog using:
'POSNR' " field name
'T_ITEM' " table name
'SALES DOC.ITEM' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 8
perform sub_populate_fieldcatalog using:
'MATNR' " field name
'T_ITEM' " table name
'MATERIAL' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 9
perform sub_populate_fieldcatalog using:
'ARKTX' " field name
'T_ITEM' " table name
'SALES ORDER ITEM' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 10
perform sub_populate_fieldcatalog using:
'PSTYV' " field name
'T_ITEM' " table name
'ITEM CATEGORY' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
perform sub_assign_events.
Create a Layout for the ALV
perform sub_layout.
Define the key fields that links the header & item tables
perform sub_define_key.
dispaly list
perform sub_call_list_display.
endform. " sub_display_alv
*& Form sub_populate_fieldcatalog
text
-->P_G_FIELDCAT text
-->P_0198 text
-->P_0199 text
-->P_0200 text
-->P_0201 text
-->P_0202 text
-->P_0203 text
-->P_0204 text
-->P_0205 text
-->P_0206 text
-->P_0207 text
-->P_0208 text
-->P_0209 text
-->P_0210 text
-->P_0211 text
-->P_0212 text
-->P_0213 text
form sub_populate_fieldcatalog using
l_fieldname
l_tabname
l_column_heading
l_outputlen
l_fix_column
l_key
l_no_out
l_do_sum
l_no_sum
l_input
l_cfieldname
l_datatype
l_hotspot.
t_fieldcat-fieldname = l_fieldname.
t_fieldcat-tabname = l_tabname.
t_fieldcat-reptext_ddic = l_column_heading.
t_fieldcat-outputlen = l_outputlen.
t_fieldcat-fix_column = l_fix_column.
t_fieldcat-key = l_key.
t_fieldcat-no_out = l_no_out.
t_fieldcat-do_sum = l_do_sum.
t_fieldcat-no_sum = l_no_sum.
t_fieldcat-cfieldname = l_cfieldname.
t_fieldcat-datatype = l_datatype.
t_fieldcat-hotspot = l_hotspot.
append t_fieldcat.clear t_fieldcat.
endform. " sub_populate_fieldcatalog
*& Form sub_assign_events
text
--> p1 text
<-- p2 text
form sub_assign_events.
refresh t_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 1
importing
et_events = t_event[]
exceptions
list_type_wrong = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Read the record for the top-of-page event
read table t_event with key slis_ev_top_of_page.
if sy-subrc = 0.
t_event-form = g_formname.
append t_event.
endif.
endform. " sub_assign_events
*& Form SUB_LAYOUT
text
--> p1 text
<-- p2 text
form sub_layout.
clear x_layout.
x_layout-f2code = 'QUOTE'.
x_layout-zebra = 'X'.
x_layout-expand_fieldname = 'EXPCOL'. " Field for expand/collapse
*Stat
x_layout-colwidth_optimize = 'X'.
x_layout-no_totalline = 'X'. " 0001+
endform. " SUB_LAYOUT
*& Form SUB_DEFINE_KEY
text
--> p1 text
<-- p2 text
form sub_define_key.
clear x_keyinfo.
x_keyinfo-header01 = 'VBELN'.
x_keyinfo-item01 = 'VBELN'.
endform. " SUB_DEFINE_KEY
form top_of_page.
write :/10 sy-datum, 20 sy-pagno, 30 sy-uname.
endform.
form sub_user_command using f_ucomm like sy-ucomm
f_selfield type slis_selfield.
if f_ucomm = 'QUOTE'.
if f_selfield-fieldname = 'VBELN'.
Set Parameter id 'AUN' field f_selfield-value.
call transaction 'VA03'.
endif.
endif.
endform.
*& Form sub_call_list_display
text
--> p1 text
<-- p2 text
form sub_call_list_display.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_user_command = 'SUB_USER_COMMAND '
is_layout = x_layout
it_fieldcat = t_fieldcat[]
i_save = 'A'
it_events = t_event[]
i_tabname_header = 'T_HEADER'
i_tabname_item = 'T_ITEM'
is_keyinfo = x_keyinfo
tables
t_outtab_header = t_header[]
t_outtab_item = t_item[]
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " sub_call_list_display -
Once again, File Tree refreshing
Ok, so I created my own implementation of a JTree to display a file system. Works fine and everything, but I want it to update in a regular interval.
Right now my own model extends TreeModel and I put a class containing the file object as custom data in DefaultMutableTree objects.
Now I tried all kinds of things like reload(), nodeStructureChanged() and similar stuff, but I can't get it to update.
Here's my current code:
FileTreeModel:
public class FileTreeModel extends DefaultTreeModel {
private ArrayList treeModelListeners = new ArrayList();
private DefaultMutableTreeNode rootFile;
public FileTreeModel(DefaultMutableTreeNode root) {
super(root);
rootFile= root;
//////////////// Fire events //////////////////////////////////////////////
* The only event raised by this model is TreeStructureChanged with the
* root as path, i.e. the whole tree has changed.
protected void fireTreeStructureChanged(DefaultMutableTreeNode oldRoot) {
int len = treeModelListeners.size();
TreeModelEvent e = new TreeModelEvent(this,
new Object[] {oldRoot});
for (int i = 0; i < len; i++) {
((TreeModelListener)treeModelListeners.get(i)).
treeStructureChanged(e);
//////////////// TreeModel interface implementation ///////////////////////
* Adds a listener for the TreeModelEvent posted after the tree changes.
@SuppressWarnings("unchecked")
public void addTreeModelListener(TreeModelListener l) {
treeModelListeners.add(l);
* Returns the child of parent at index index in the parent's child array.
public Object getChild(Object parent, int index) {
if(((DefaultMutableTreeNode)parent).getUserObject() instanceof String){
return ((DefaultMutableTreeNode)parent).getChildAt(index);
FileNode[] files=getOrderedList((FileNode)((DefaultMutableTreeNode)parent).getUserObject());
if(files.length>index){
return new DefaultMutableTreeNode(files[index]);
return null;
public int getChildCount(Object parent) {
//if root
if(((DefaultMutableTreeNode)parent).getUserObject() instanceof String){
return ((DefaultMutableTreeNode)parent).getChildCount();
FileNode[] files=getOrderedList((FileNode)((DefaultMutableTreeNode)parent).getUserObject());
if(files!=null){
return files.length;
return 0;
public boolean isLeaf(Object FileNode) {
if(((DefaultMutableTreeNode)FileNode).getUserObject() instanceof String){
return false;
}else{
FileNode f=(FileNode)((DefaultMutableTreeNode)FileNode).getUserObject();
return f.get().isFile();
* Returns the index of child in parent.
public int getIndexOfChild(Object parent, Object child) {
FileNode[] files=getOrderedList((FileNode)((DefaultMutableTreeNode)parent).getUserObject());
if(files!=null){
for(int i=0;i<files.length;i++){
if(files.equals((FileNode)((DefaultMutableTreeNode)child).getUserObject())){
return i;
return -1;
* Returns the root of the tree.
public Object getRoot() {
return rootFile;
* Removes a listener previously added with addTreeModelListener().
public void removeTreeModelListener(TreeModelListener l) {
treeModelListeners.remove(l);
* Messaged when the user has altered the value for the item
* identified by path to newValue. Not used for now.
public void valueForPathChanged(TreePath path, Object newValue) {
System.out.println("*** valueForPathChanged : "
+ path + " --> " + newValue);
//get ordered list, so that dirs appear first
public FileNode[] getOrderedList(FileNode f){
if(f!=null){
File[] fc=f.get().listFiles();
if(fc!=null){
ArrayList<FileNode> fchildren=new ArrayList<FileNode>();
//Implementation of manual file filter is required because of special
//folders, atleast in windows
for(int i=0;i<fc.length;i++){
if(fc[i].isDirectory()){/!fc[i].getName().equals(FileSystemView.getFileSystemView().getSystemDisplayName(fc[i]))){
fchildren.add(new FileNode(fc[i]));
continue;
String extension = Utils.getExtension(fc[i]);
if (extension != null) {
if (extension.equals(Utils.alb)) {
fchildren.add(new FileNode(fc[i]));
FileNode[] fret=new FileNode[fchildren.size()];
int pos=0;
for(int i=0;i<fret.length;i++){
if(((FileNode)fchildren.get(i)).get().isDirectory()){
fret[pos]=((FileNode)fchildren.get(i));
pos++;
for(int i=0;i<fret.length;i++){
if(!((FileNode)fchildren.get(i)).get().isDirectory()){
fret[pos]=((FileNode)fchildren.get(i));
pos++;
return fret;
return null;
JFileTree:
public class JFileTree extends JTree {
public JFileTree() {
getSelectionModel().setSelectionMode(
TreeSelectionModel.SINGLE_TREE_SELECTION);
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
setCellRenderer(renderer);
}and FileNode:
//slightly modified to return filename instead of path in tostring() to fit into trees
public class FileNode{
private File f;
public FileNode(File file) {
f=file;
public String toString(){
return FileSystemView.getFileSystemView().getSystemDisplayName(f);
public File get() {
return f;
public void set(File f) {
this.f = f;
}I searched quite a bit in these forums but only found places where it said to use reload or one of the functions to insert nodes or so which isn't applicable in the case of a file system.
I could really need some help here, as I have been messing around for quite some time but couldn't get it working properly.
Does anyone know of a complete and proper implemented FileTree? The sun examples act a bit different, and the other examples I could find weren't complete in the aspect of refreshing the contents.
Message was edited by:
Fragman
Message was edited by:
FragmanI searched quite a bit in these forums...Well you should probably be searching the Swing forums where Swing related questions should be posted.
I don't know much about using JTree, but I see no reason to create a custom TreeModel. Use the DefaultTreeModel. It handles parent/child relationships which is all a directory structure is.
In either case start with a simple example. That is hard code two different tree structures and then have a button to toggle the tree model. Once you understand how that works then you move on a more dynamic structure.
The code you posted doesn't help use since it is not compileable or executable.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting. -
ALV Tree Report--clicking on a row....
Hello Experts,
i have a alv tree report.my requirement is,
"Selecting a row means clicking on record and then click on a another button called YES ,For other functionality i need to capture the row '.
How can i solve this problem.
Thanks,
Sridhar.hi check this..
REPORT z_simpletree.
type pool declarations for tree
TYPE-POOLS : fibs,stree.
*Data declaration for additional node information
DATA : t_node TYPE snodetext.
*Internal table and wa decl for nodes
DATA : it_node LIKE TABLE OF t_node INITIAL SIZE 0,
wa_node LIKE t_node.
*Internal table and wa decl for Education table PA0022
DATA : it_0022 TYPE STANDARD TABLE OF pa0022 INITIAL SIZE 0,
wa_0022 TYPE pa0022.
*Internal table and wa decl for text table t517x
DATA : it_517x TYPE STANDARD TABLE OF t517x INITIAL SIZE 0,
wa_517x TYPE t517x.
*Internal table and wa decl for text table t517T
DATA : it_517t TYPE STANDARD TABLE OF t517t INITIAL SIZE 0,
wa_517t TYPE t517t.
*Internal table and wa decl for text table t519T
DATA : it_519t TYPE STANDARD TABLE OF t519t INITIAL SIZE 0,
wa_519t TYPE t519t.
*initialization event
INITIALIZATION.
*Start of selection event
START-OF-SELECTION.
*Select the data for tree
PERFORM fetch_data.
*Build the hierarchy for tree
PERFORM build_hierarchy.
*Build Tree for display
PERFORM build_tree.
*& Form fetch_data
text
--> p1 text
<-- p2 text
FORM fetch_data .
*select data from PA0022
SELECT * FROM pa0022 INTO CORRESPONDING FIELDS OF TABLE it_0022
UP TO 50 ROWS.
*select data from T517x
SELECT * FROM t517x INTO CORRESPONDING FIELDS OF TABLE it_517x
WHERE langu = 'E'.
*select data from T517T
SELECT * FROM t517t INTO CORRESPONDING FIELDS OF TABLE it_517t
WHERE sprsl = 'E'.
*select data from T519t
SELECT * FROM t519t INTO CORRESPONDING FIELDS OF TABLE it_519t
WHERE sprsl = 'E'.
ENDFORM. " fetch_data
*& Form build_hierarchy
text
--> p1 text
<-- p2 text
FORM build_hierarchy .
*Building the nodes and hierarchy for tree
CLEAR : it_node[],
wa_node.
wa_node-type = 'T'.
wa_node-name = 'Education'.
wa_node-tlevel = '01'.
wa_node-nlength = '15'.
wa_node-color = '4'.
wa_node-text = 'Infotype 0022'.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the values of internal table into tree
LOOP AT it_0022 INTO wa_0022.
wa_node-type = 'P'.
wa_node-name = 'PERNR'.
wa_node-tlevel = '02'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = wa_0022-pernr.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the text of T517t
READ TABLE it_517t INTO wa_517t WITH KEY slart = wa_0022-slart.
wa_node-type = 'P'.
wa_node-name = wa_0022-slart.
wa_node-tlevel = '03'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = wa_517t-stext.
wa_node-tlength ='40'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the text of T519t
READ TABLE it_519t INTO wa_519t WITH KEY slabs = wa_0022-slabs.
wa_node-type = 'P'.
wa_node-name = wa_0022-slabs.
wa_node-tlevel = '04'.
wa_node-nlength = '8'.
wa_node-color = '2'.
wa_node-text = wa_519t-stext.
wa_node-tlength ='40'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the text of T517x
READ TABLE it_517x INTO wa_517x WITH KEY faart = wa_0022-sltp1.
wa_node-type = 'P'.
wa_node-name = wa_0022-sltp1.
wa_node-tlevel = '05'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = wa_517x-ftext.
wa_node-tlength ='40'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
wa_node-type = 'P'.
wa_node-tlevel = '06'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = '% Completed'.
wa_node-tlength ='15'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
ENDLOOP.
ENDFORM. " build_hierarchy
*& Form build_tree
text
--> p1 text
<-- p2 text
FORM build_tree .
*Fm for constructing the tree
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = it_node.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*FM for displaying the tree
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = sy-repid
check_duplicate_name = '1'
color_of_node = '3'
color_of_mark = '3'
color_of_link = '1'
color_of_match = '5'
node_length = 30
text_length = 75
use_control = 'L'.ENDFORM. " build_tree
regards,
venkat -
Hi all,
I have a 3 level tree. The view objects are connected through view links. In the lowest level node view object, i initialized it and added where clause in the run time. I am sure that the vo executes the query with where clauses and correct parameters however when i clicked to expand all, query brings all the data into tree.
What can be the problem?VO query is;
SELECT
xxtlCheckListHeaderEO.CL_SURVEY_ID,
xxtlCheckListHeaderEO.LAST_UPDATE_DATE,
xxtlCheckListHeaderEO.LAST_UPDATED_BY,
xxtlCheckListHeaderEO.CREATION_DATE,
xxtlCheckListHeaderEO.CREATED_BY,
xxtlCheckListHeaderEO.CL_SETUP_ID,
xxtlCheckListHeaderEO.CL_DESCRIPTION,
xxtlCheckListHeaderEO.CL_STATUS,
xxtlCheckListHeaderEO.VESSEL_ID,
xxtlCheckListHeaderEO.PROJECT_ID,
xxtlCheckListHeaderEO.CL_SURVEY_TYPE_ID,
xxtlCheckListHeaderEO.CL_PERIOD_ID,
xxtlCheckListHeaderEO.SURVEY_REPORT_ID,
XCL.CL_NUMBER,
XCL.CL_DESC,
XCL.CL_LOOKUP_ID,
XCL.CL_LOOKUP_DETAIL_ID,
(XCL.CL_CODE_LETTER || ' - ' || XCL.CL_DESC) CODEDESC,
('RenderEnabled') RENDER_ENABLED
FROM XXDENIZ.XXDP_CL_SURVEY xxtlCheckListHeaderEO,
XXDENIZ.XXDP_CL_SETUP XCL
WHERE XCL.CL_SETUP_ID =xxtlCheckListHeaderEO.CL_SETUP_ID
I tried;
setWhereClause("VESSEL_ID = :1 AND CL_SURVEY_TYPE_ID = :2");
setWhereClauseParams(null);
setWhereClauseParam(0, vesselId);
setWhereClauseParam(1, surveyTypeId);
executeQuery();No changes in the query
Also;
SELECT
xxtlCheckListHeaderEO.CL_SURVEY_ID,
xxtlCheckListHeaderEO.LAST_UPDATE_DATE,
xxtlCheckListHeaderEO.LAST_UPDATED_BY,
xxtlCheckListHeaderEO.CREATION_DATE,
xxtlCheckListHeaderEO.CREATED_BY,
xxtlCheckListHeaderEO.CL_SETUP_ID,
xxtlCheckListHeaderEO.CL_DESCRIPTION,
xxtlCheckListHeaderEO.CL_STATUS,
xxtlCheckListHeaderEO.VESSEL_ID,
xxtlCheckListHeaderEO.PROJECT_ID,
xxtlCheckListHeaderEO.CL_SURVEY_TYPE_ID,
xxtlCheckListHeaderEO.CL_PERIOD_ID,
xxtlCheckListHeaderEO.SURVEY_REPORT_ID,
XCL.CL_NUMBER,
XCL.CL_DESC,
XCL.CL_LOOKUP_ID,
XCL.CL_LOOKUP_DETAIL_ID,
(XCL.CL_CODE_LETTER || ' - ' || XCL.CL_DESC) CODEDESC,
('RenderEnabled') RENDER_ENABLED
FROM XXDENIZ.XXDP_CL_SURVEY xxtlCheckListHeaderEO,
XXDENIZ.XXDP_CL_SETUP XCL
WHERE XCL.CL_SETUP_ID =xxtlCheckListHeaderEO.CL_SETUP_ID
AND VESSEL_ID = :1
I put the where clause in query and set the parameter in run time but i think it is also setting view link parameter and third level in the tree is not displayed.
And when i changed :1 to :2 in order to not create conflict with VL but this time it gives error;
SELECT * FROM (SELECT
xxtlCheckListHeaderEO.CL_SURVEY_ID,
xxtlCheckListHeaderEO.LAST_UPDATE_DATE,
xxtlCheckListHeaderEO.LAST_UPDATED_BY,
xxtlCheckListHeaderEO.CREATION_DATE,
xxtlCheckListHeaderEO.CREATED_BY,
xxtlCheckListHeaderEO.CL_SETUP_ID,
xxtlCheckListHeaderEO.CL_DESCRIPTION,
xxtlCheckListHeaderEO.CL_STATUS,
xxtlCheckListHeaderEO.VESSEL_ID,
xxtlCheckListHeaderEO.PROJECT_ID,
xxtlCheckListHeaderEO.CL_SURVEY_TYPE_ID,
xxtlCheckListHeaderEO.CL_PERIOD_ID,
xxtlCheckListHeaderEO.SURVEY_REPORT_ID,
XCL.CL_NUMBER,
XCL.CL_DESC,
XCL.CL_LOOKUP_ID,
XCL.CL_LOOKUP_DETAIL_ID,
(XCL.CL_CODE_LETTER || ' - ' || XCL.CL_DESC) CODEDESC,
('RenderEnabled') RENDER_ENABLED
FROM XXDENIZ.XXDP_CL_SURVEY xxtlCheckListHeaderEO,
XXDENIZ.XXDP_CL_SETUP XCL
WHERE XCL.CL_SETUP_ID =xxtlCheckListHeaderEO.CL_SETUP_ID
AND VESSEL_ID = :2) QRSLT WHERE (CL_LOOKUP_DETAIL_ID = :1)
ORA-01008 : Not all variables bound
Thanks. -
Neat query to create a tree?
Hi all,
If i have these in a table:
Step Dependent_Step
100 0
140 100
200 100
200 140
250 100
Can anyone suggest a query that would create a nice tree showing dependencies? (not sure if it is possible)
In this example:
100 is not dependent on any steps
140 is dependent on 100
200 is dependent on 100 and 140
250 is dependent on 100create table tree (
father integer ,
son integer
4 );
Table created.
insert into tree values (100, NULL);
1 row created.
insert into tree values (100, 140);
1 row created.
insert into tree values (100, 200);
1 row created.
insert into tree values (140, 200);
1 row created.
SQL> insert into tree values (100, 250);
1 row created.
SQL>
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> select son||' is dependent on '|| father from tree
2 connect by prior father = son;
SON||'ISDEPENDENTON'||FATHER
140 is dependent on 100
200 is dependent on 100
200 is dependent on 140
140 is dependent on 100
250 is dependent on 100
is dependent on 100
6 rows selected.
SQL> -
How to convert a flat/hierarchical data (which I get from Excel as 2D Array) to XML format in Flex. The following is my Hierarchical Data:(Table form)
Asia
India
Chennai
TN
Category1
Product1
100
Asia
India
Mumbai
MH
Category1
Product1
100
Asia
India
Calcutta
CT
Category1
Product1
100
Asia
India
Calcutta
CT
Category2
Product2
200
EMEA
UK
London
LN
Category3
Product1
122
EMEA
UK
London
LN
Category3
Product2
201
EMEA
UK
Reading
RN
Category1
Product1
123
EMEA
UK
Reading
RN
Category1
Product2
455
I need to format/convert this to XML format so that I can populate that resulting xml as dataprovider to a Tree control.
I need to populate the above data into Tree component such that I get the following output:
Asia
India
Chennai
TN
Category1
Product1
100
Mumbai
MH
Category1
Product1
100
.............goes on till last numerical data of above tableTry this into json then to xml. I did similar one using PHP and JSON.
-
hi, i was wondering if someone could give me tips or pointer or even the solution :). all help is appreciated
if you know of a tutorial besides the basic java one that would be gr8 too
(2) Write a class named my_SortedTree with three methods.
(i) Given a sequence of numbers (total number of numbers will be the full tree size 2n-1), sort them in an increasing order.
(ii) Store the sorted sequence in a full binary tree so that use the �in order� traverse algorithm can print them in an increasing order. Note that your tree MUST be a full tree.
For example, given �14 23 13 18 11 26 16� as input, your program should sort them first, so that the sequence is �11 13 14 16 18 23 26�, then insert those seven numbers into tree structure one by one, it should be 1623181311 1426
(iii) Use the level-order traverse algorithm to print all of them.hi, i was wondering if someone could give me tips or
pointer or even the solution :). all help is
appreciated
if you know of a tutorial besides the basic java one
that would be gr8 too
(2) Write a class named my_SortedTree with three
methods.
(i) Given a sequence of numbers (total number of
numbers will be the full tree size 2n-1), sort them
in an increasing order.
(ii) Store the sorted sequence in a full binary tree
so that use the �in order� traverse algorithm can
print them in an increasing order. Note that your
tree MUST be a full tree.
For example, given �14 23 13 18 11 26 16� as input,
your program should sort them first, so that the
sequence is �11 13 14 16 18 23 26�, then insert those
seven numbers into tree structure one by one, it
should be 1623181311 1426
(iii) Use the level-order traverse algorithm to print
all of them.
Here is a link to a pretty good tutorial example of ADT's in Java.
It covers stacks, queues, Binary Search Trees, and much more...
IMHO I would work through some of the examples and even diagram each step in the areas that are tough to visualize.
JJ -
[TreeNodeType] Keeping expended items (children) when tree reload
Hi all,
My page with context is:
-TREE (node)
---TREENODE (node; data is load by Supply Function)
CHILDNODE (node; data is load by Supply Function)
name (attribute)
value (attribute)
I mapped this context into TREE as below:
-TREE (element type: TREE; dataSource : TREE)
---TNT_NODE (element type: TreeNodeType; dataSource: TREENODE; hasChildren: TRUE )
---TNT_CHILDNODE (element type: TreeNodeType; dataSource: CHILDNODE; hasChildren: FALSE)
It runs ok, but my request is:
Keep items (children) of TNT_NODE expand (open) when tree reload or Load and expand current node automatically when tree is reloaded.
Please give me your advice.
Regards,
KenHi,
I am not sure wether you have binded the prperties like 'Is child', 'Expanded', "Parent Key ', 'Key', or not . If you have binded these values then when the child elements are loaded then when u are loading the child elements then you can append the value as expanded 'abap_true' or as ' X' that means when u try to upload the child elements then the the child elements will be expanded defaultly.
Hope this may help you.
Have A Good Day.
Regards,
Sana. -
Dynamically Loading xml in tree control
Hi I am new to flex i need to load the following xml into tree
<?xml version="1.0" encoding="utf-8" ?>
- <catalog>
- <product>
<name>laptop3</name>
<price>"1256"</price>
<qty>"45"</qty>
</product>
- <product>
<name>"CAR"</name>
<price>"45000"</price>
<qty>"7"</qty>
</product>
- <product>
<name>"Laptop2"</name>
<price>"450011"</price>
<qty>"7022888"</qty>
</product>
- <product>
<name>"Laptop"</name>
<price>"45000"</price>
<qty>"70"</qty>
</product>
- <product>
<name>"Laptop2"</name>
<price>"45000"</price>
<qty>"7022"</qty>
</product>
- <product>
<name>"Laptop2"</name>
<price>"45000"</price>
<qty>"7022888"</qty>
</product>
</catalog>
I am unable to load the exact xml structure ...
Please help me
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:HTTPService id="srv" url="http://localhost:8080/SampleWebApp/test.jsp"/>
<mx:DataGrid dataProvider="{srv.lastResult.catalog.product}" width="100%" height="100%"/>
<mx:Tree labelField="@val" width="201" height="100%" showRoot="true"
showInAutomationHierarchy="true" id="machineTree" dataProvider="{srv.lastResult.catalog.product}"></mx:Tree>
<mx:Button label="Get Data" click="srv.send()"/>
</mx:Application>
I am able to load into data grid , but not in tree help meThe same as you have but with embeded XML.
<mx:XML id="tstData">
<catalog>
<product>
<name>laptop3</name>
<price>"1256"</price>
<qty>"45"</qty>
</product>
<product>
<name>"CAR"</name>
<price>"45000"</price>
<qty>"7"</qty>
</product>
<product>
<name>"Laptop2"</name>
<price>"450011"</price>
<qty>"7022888"</qty>
</product>
<product>
<name>"Laptop"</name>
<price>"45000"</price>
<qty>"70"</qty>
</product>
<product>
<name>"Laptop2"</name>
<price>"45000"</price>
<qty>"7022"</qty>
</product>
<product>
<name>"Laptop2"</name>
<price>"45000"</price>
<qty>"7022888"</qty>
</product>
</catalog>
</mx:XML>
<mx:Tree labelFunction="treeLabel" width="201" height="100%" showRoot="true"
showInAutomationHierarchy="true" id="machineTree" dataProvider="{tstData.product}">
But it doesn't matter.
try to debug. Add this
[Bindable]
private var treeData:XMLListCollection;
public function onResult(event:ResultEvent):void
treeData = new XMLListCollection(XML(event.result).product); // debug here to see what you get and what is a type for this data
<mx:HTTPService id="srv" url="http://localhost:8080/SampleWebApp/test.jsp" result="onResult(event)"/>
And treeData as a dataSource for Tree.
Maybe you are looking for
-
Declaring an internal table in smartform
hi, can anyone tell how to declare internal table in smartform. the internal table contains fields from 2 or more data dictionary tables(eg.kna1 and adrc). after this from the print program(internal table containing data in print progr
-
Validating a text field that has date in the format mm/dd/yyyy
How can I validate a text field such that it should be in the format mm/dd/yyyy and it should not be greater that a particular date. for example the date I enter should not be greater than 01/01/2007
-
i would like to know how to upload a file (image, text, exe, etc.) to a database. i have trying a sample code in a book called Java Servlet Programming by Jason Hunter & William Crawford, published by O'Reilly....i have problem when compile that sour
-
Creative Cloud has Hijacked Mission Control.
I'm running OSX 10.9.4 and have the latest Adobe Creative Cloud software installed. I recently noticed that Mission Control shows no open applications in the desktops displayed there. The current desktop (the largest one shown) says Creative Cloud on
-
Hi all, I am having a problem with the DAS application (oiddas.ear)in Oracle9IAS. I am able to deploy the ear file and view web pages, however I am unable to log on using a username/password combo that works in the Oracle Internet Directory managemen