Explorer tree structure for website
i have all the top level datas and sub-levels in the database..i want to create a explorer type navigation using javascript dynamically from database and display it in JSP page
Can any one help..
Very Urgent..
Else give some reference site
Do a Yahoo/Google search for javascript treeview.
There are lots of examples out there. Most are free.
Here is a staring point:
http://developer.netscape.com/viewsource/smith_menu/smith_menu.html
http://www.treemenu.com/
http://www.webreference.com/dhtml/hiermenus/instructions/noframes/step1.html
http://webreference.com/dhtml/dynomat/hiermenus3/ie/index.html
http://www.bratta.com/dhtml/scripts.asp?url=scripts/scripts.asp?id=28&ac=7&order=created
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
http://www.ivanpeters.com/
Similar Messages
-
How to create Tree Structure for given data?
Hi,
I have to create a tree structure of Folders and the contents in the Folder.
I have a XML, it contains data for the tree structure to display. How can I create a tree structure which would look like below
Parent
Child
Supporting Views
Raw eInfotree Table Views
Background Calculations
QC Data Views
Calculation Views
Unit Operation Views
Cell Culture Views
Purification Views
MFR Views
Personal Views
All the nodes should have folder Icon.
Please find the XML as
<?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3"><Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="TK" SQLDataType="4" SourceColumn="TK"/><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="TYPE" SQLDataType="1" SourceColumn="TYPE"/><Column Description="" MaxRange="1" MinRange="0" Name="PK" SQLDataType="4" SourceColumn="PK"/></Columns>
<Row><TK>1</TK><NAME>Parent</NAME><TYPE>F</TYPE><PK>0</PK></Row>
<Row><TK>2</TK><NAME>Child</NAME><TYPE>F</TYPE><PK>1</PK></Row>
<Row><TK>3</TK><NAME>Supporting Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>4</TK><NAME>Raw eInfotree Table Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>5</TK><NAME>Background Calculations</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>6</TK><NAME>QC Data Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>7</TK><NAME>Calculation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>8</TK><NAME>Unit Operation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>9</TK><NAME>Cell Culture Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>10</TK><NAME>Purification Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>11</TK><NAME>MFR Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>12</TK><NAME>Personal Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
</Rowset>
</Rowsets>Vishal,
If you structure your data with two columns, the first being the Node name and the second being the Parent node name (see your information below), the iBrowser applet will make a nice data driven tree with all of the SelectionEvent or navigational capabilities you want.
<?xml version="1.0" encoding="UTF-8"?>
<Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3">
<Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="PARENT" SQLDataType="1" SourceColumn="PARENT"/></Columns>
<Row><NAME>Parent</NAME><PARENT></PARENT></Row>
<Row><NAME>Child</NAME><PARENT>Parent</PARENT></Row>
<Row><NAME>Supporting Views</NAME><PARENT>Child</PARENT></Row>
<Row><NAME>Calculation Views</NAME><PARENT>Child</PARENT></Row>
<Row><NAME>Unit Operation Views</NAME><PARENT>Child</PARENT></Row>
<Row><NAME>Personal Views</NAME><PARENT>Child</PARENT></Row>
<Row><NAME>Raw eInfotree Table Views</NAME><PARENT>Supporting Views</PARENT></Row>
<Row><NAME>Background Calculations</NAME><PARENT>Supporting Views</PARENT></Row>
<Row><NAME>QC Data Views</NAME><PARENT>Supporting Views</PARENT></Row>
<Row><NAME>Cell Culture Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
<Row><NAME>Purification Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
<Row><NAME>MFR Views</NAME><PARENT>Unit Operation Views</PARENT></Row>
</Rowset>
</Rowsets>
Regards,
Jeremy -
t:tree component is not rendering tree structure for my page
Dear dudes,
I want to create a simple tree structure in my jsf page backed by a backing bean.
But my jsf page is getting executed but my tree is not getting displayed.
my jsf page:<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
<f:view>
<html>
<body>
<h:form>
<t:tree id="tree" value="#{mytreeBean.myTree}" styleClass="tree"
nodeClass="treenode" selectedNodeClass="treenodeSelected"
>
</t:tree>
</h:form>
</body>
</html>
</f:view>
</ui:composition>Mybacking bean:
package org.test.tree;
import java.util.Iterator;
import java.util.List;
import org.apache.myfaces.custom.tree.DefaultMutableTreeNode;
import org.apache.myfaces.custom.tree.model.DefaultTreeModel;
import com.srit.framework.web.BasePage;
import com.srit.healthcare.common.lookupentity.repository.ILookupRepository;
import com.srit.healthcare.common.tree.domain.RcareTree;
public class MyTreebean {
private DefaultTreeModel myTree;
public DefaultTreeModel getMyTree() {
return myTree=getTreeModel();
public void setMyTree(DefaultTreeModel myTree) {
this.myTree = myTree;
/*public MyTreebean() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
root.insert(a);
DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
root.insert(b);
DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
root.insert(c);
DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
a.insert(node);
node = new DefaultMutableTreeNode("a2 ");
a.insert(node);
node = new DefaultMutableTreeNode("b ");
b.insert(node);
a = node;
node = new DefaultMutableTreeNode("x1");
a.insert(node);
node = new DefaultMutableTreeNode("x2");
a.insert(node);
myTree = new DefaultTreeModel(root);
public DefaultTreeModel getTreeModel() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
root.insert(a);
DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
root.insert(b);
DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
root.insert(c);
DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
a.insert(node);
node = new DefaultMutableTreeNode("a2 ");
a.insert(node);
node = new DefaultMutableTreeNode("b ");
b.insert(node);
a = node;
node = new DefaultMutableTreeNode("x1");
a.insert(node);
node = new DefaultMutableTreeNode("x2");
a.insert(node);
return myTree = new DefaultTreeModel(root);
}Also i've configured my tomahawk-taglib file in my web.xml .
My backing bean is configured in my faces-config.xml
But i'm not able to get my tree structure in my page .
Any help would be appreciated.
RegardsDear akash,
yes i'm seeing the jsf tags <t:tree>
But when i modify my jsf page , in my configuration files i'm getting the following errors:
In web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
</web-app>
error message: cannot find the declaration of element web-apps
error message: failed to read schema document http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd because 1) couldnot find the document 2) the document could not be read 3) the root element of the document is not <xsd:schema>In another configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
Error: cannot find the declaration of element 'beans'I'm a novice to JSF technology and plz guide me properly. -
Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data
Expected output in Xml:
<?xml version="1.0" encoding="utf-8" ?>
- <TopRoot>
- <Root id="1" Name="Department">
- <Type id="2" Name="IT">
- <SubType id="3" Name="Technology">
<SubSubType id="4" Name="Sharepoint" />
<SubSubType id="5" Name="ASP.NET" />
<SubSubType id="6" Name="HTML 5" />
</SubType>
</Type>
</Root>
</TopRoot>
List Details:
list details for storing category / sub category data and code to build tree structure for the same.
1.Create Custom List named “CategoryDetails”:
2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
3.Create column “Parent Category” of type lookup. under Additional Column Settings.
Get information dropdown, select “CategoryDetails”.
4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
In this column dropdown, select “Category Name”:
Referance:
http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data -fine but don't want tree view just generate xml string
i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
Expected Result:
My ultimate goal is to generate xml string like above format without building tree view.
I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
I developed some code but its not working to generate xml /string.
My modified Code:
public const string DYNAMIC_CAML_QUERY =
"<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
"<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
string TreeViewStr= BuildTree();
Literal1.Text = TreeViewStr;
StringBuilder sbRoot= new StringBuilder();
protected string BuildTree()
SPList TasksList;
SPQuery objSPQuery;
StringBuilder Query = new StringBuilder();
SPListItemCollection objItems;
string DisplayColumn = string.Empty;
string Title = string.Empty;
string[] valueArray = null;
try
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb web = site.OpenWeb())
TasksList = SPContext.Current.Web.Lists["Service"];
if (TasksList != null)
objSPQuery = new SPQuery();
Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
objSPQuery.Query = Query.ToString();
objItems = TasksList.GetItems(objSPQuery);
if (objItems != null && objItems.Count > 0)
foreach (SPListItem objItem in objItems)
DisplayColumn = Convert.ToString(objItem["Title"]);
Title = Convert.ToString(objItem["Title"]);
int rootId=objItem["ID"].ToString();
sbRoot.Append("<Root id="+rootId+"
Name="+Title+">");
string SRAndSUBSRTpe = CreateTree(Title, valueArray,
null, DisplayColumn, objItem["ID"].ToString());
sbRoot.Append(SRAndSUBSRTpe);
SRType.Clear();//make SRType Empty
strhtml.Clear();
SRType.Append("</Root>");
catch (Exception ex)
throw ex;
return SRType.ToString();
StringBuilder strhtml = new StringBuilder();
private string CreateTree(string RootNode, string[] valueArray,
List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
try
strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
catch (Exception ex)
throw ex;
return strhtml;
StringBuilder SRType = new StringBuilder();
private string GetSRType(string RootNode,
string[] valueArray, List<SPListItem> objListItemColn)
SPQuery objSPQuery;
SPListItemCollection objItems = null;
List<SPListItem> objNodeListItems = new List<SPListItem>();
objSPQuery = new SPQuery();
string objNodeTitle = string.Empty;
string objLookupColumn = string.Empty;
StringBuilder Query = new StringBuilder();
SPList objTaskList;
SPField spField;
string objKeyColumn;
string SrTypeCategory;
try
objTaskList = SPContext.Current.Web.Lists["Service"];
objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
Query.Append(String.Format
(DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
objSPQuery.Query = Query.ToString();
objItems = objTaskList.GetItems(objSPQuery);
foreach (SPListItem objItem in objItems)
objNodeListItems.Add(objItem);
if (objNodeListItems != null && objNodeListItems.Count > 0)
foreach (SPListItem objItem in objNodeListItems)
RootNode = Convert.ToString(objItem["Title"]);
objKeyColumn = Convert.ToString(objItem["ID"]);
objNodeTitle = Convert.ToString(objItem["Title"]);
SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
if(SrTypeCategory =="SRtYpe")
SRType.Append("<Type id="+objKeyColumn+" Name="+RootNode+ ">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SRSubTYpe")
SRType.Append("<SRSubType id="+objKeyColumn+" Name="+RootNode+
">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SubSubTYpe")
SRType.Append("<SubSubType id="+objKeyColumn+" Name="+RootNode +"
></SubSubType");
SRType.Append("</SubType>");
SRType.Append("</Type>");
catch (Exception ex)
throw ex;
return SRType.ToString();
// Call method again (recursion) to get the child itemsHi,
According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
For example, to create or delete the ECB menu for a list item in
"Site Content and Structure", we can follow the steps below:
To add the “My Like” menu, we can add the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemLike"
runat="server"
Text="My Like"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickNavigateUrl="https://www.google.com.hk/"
/>
To remove the “Delete” menu, we can comment the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemDelete"
runat="server"
Text="<%$Resources:cms,SmtDelete%>"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickScript="%SmtObjectDeleteScript%"
/>
The result is as below:
More information:
MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
F4 search help as tree structure in a module for one field
hi experts,
i have created a z module by copying standard module SAPMV23N of vbg1/2/3 transaction and i have added one tab in vbg1/2/3. the 5th tab is working. i am calling a subscreen using 5 tabstrip. there are one field MAKTL i want to use a F4 search as tree structure for that MAKTL field.
in code for displaying tree structure i am using function module RS_TREE***
please help meHi,
Please study this search help, there is a search help exit in which the hierarchy part it written,
Search Help: PRCTH
Search help exit: K_F4IF_SHLP_STANDARD_HIERARCHY
Hope this helps you,
Regards,
Abhijit G. Borkar -
Hi Friends,
How to Create a tree structure for org. unit in web dynpro ABAP
and call the tree in F4 Help of a input box.Good advice there guys.
I myself just finished such an implementation at one of my customers. It took 2 days to complete. I can't give you the solution as the customer retains the immaterial rights for the solution but I thought I would tell you the steps involved to get you on the right track.
1. Context. Build a context node that on the top level has the orgunit, it's attributes (such as otype, objid, stext, etc) and the recursive node that points to the orgunit node. Inside the orgunit create a node for the position. Inside the node place the attributes for the position (like before) and a recursive node that points to the position node. Finally inside the position node place a node for the person and it's attributes (like before), but no recursion node this time.
2. Layout: Place a tree element in your view. Inside the tree element insert two node types and one item type. First node is for orgunit, second one is for position. The only item is for the person. You might want to add respective icons, to get nicer UI. Add the load children action for orgunit and position. Depending on what you want to select from the tree, add a select action for either orgunit, position or person.
3. Code #1: as Chris points out, use RH_STRUC_GET to get the organization tree. I myself used O_S_P. You might want to create a FM that returns all 3 itabs returned by RH_STRUC_GET to the WDA. Create a freely programmed value help as suggested in many threads, it's pretty straight forward. In the WDA utilizing the VH, mark one or more items in the context as freely programmed VH and connect to your implementation.
4. Code #2: At start up, for example in the WDDOINIT method, create only the root node and call it for example "All organization units". Then create one action that is called when children nodes have to be loaded, one method for figuring out what do when a child is being requested (and what kind of child: orgunit, position or person) and finally a method for actually creating the node.
5. Code #3: The magic comes from RH_STRUC_GET. Use the STRUC itab at runtime to find the objects at certain levels and to determine their parent(s) and children. The most important values in the STRUC itab in this case are LEVEL, OTYPE, OBJID and PUP.
Pretty straight forward and the solution is quite nice indeed. I'm sorry if I forgot something, I wrote this without access to the system. -
Tree Structure Implementation in Java.
1>
How should i implement a "Tree Structure" in Java Based application.?How would i map the entries to the database table?how many tables will i require for this implementation.?
List records<String> = new ArrayList<String>();
records.add("null");
records.add("Product");
records.add("Category");
records.add("P1");
records.add("P2");
records.add("P3");
records.add("C1");
records.add("C2");
records.add("C3");
so how should i implement a Tree Structure for the above record set.
//P1,P2,P3 belong to Parent {Product}
//C1,C2,C3 belong to Parent {Category}
Sample code provided will be helpfulHow should i implement a "Tree Structure" in Java Based application.?The quotes suggest you don't know what a tree structure is, regardless of the development language. Fix that first (your understanding of what a tree structure is). [url http://en.wikipedia.org/wiki/Tree_structure]Here is probably a good start.
How would i map the entries to the database table?how many tables will i require for this implementation.?It depends on what your tree structure represents, in particular it depends on whether the leaves and intermediate nodes of the trees have are homogeneous (e.g. have a common interface). There is no general rule.
I suggest you start by looking in the Java API at all the classes whose names start with 'Tree' (TreeSet and TreeMap are probably the best ones to start with) and read the documentation carefully. Then try to write some code that uses one and come back if/when you have any problems.(sorry Winston) I think this is a very bad advice.
These classes are particular implementations, respectively of a set (in the mathematical sense) and of a map (associative table), which happen to use a "tree structure" for their internal business. Their API doesn't help building a custom "tree structure" (they may be used that way, but it's certainly not the easiest nor even a particular handy way to build tree structures).
Maybe their implementation may be a good example of how to build a Tree structure, but they use a particular type of tree (+red-black tree), not a general one. This may or may not be the OP's case, I wouldn't bet on it.
OP you're welcome to come back with more specific questions and details. Good luck with Java.
Edited by: jduprez on Oct 16, 2010 2:45 PM
Edited by: jduprez on Oct 16, 2010 2:49 PM
After checking the Javadoc: indeed TreeSet only uses a TreeMap for its implementation, so the only one out of the two which does directly uses a tree structure in its implementation is TreeMap.
Edited by: jduprez on Oct 16, 2010 2:51 PM
And, to reiterate, I stand by my claim that TreeMap is not a good example of a general Tree structure: in particular it uses a tree to map keys to values, its main business is the "mapping" part, not the tree as a storage medium. Neither the keys nor the values know anything about their "children". -
How to develop tree structure using webdynpro
hi everybody,
I want to develop a sample tree structure for an object in webdynpro.can u help how to develop that one.Hi Srinivas,
Here are links...
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/47ce9b90-0201-0010-59b5-f70826824eee
http://help.sap.com/saphelp_nw04/helpdata/en/33/af0abb4559424dad802cbc7e31eaf2/content.htm
Hope it helps.
Regards,
Maheswaran.B
Message was edited by:
Maheswaran B -
Tree structure like in win explorer?
Hello everybody,
I need in my program a structure like the tree structure in the windows explorer. Is is possible to program something like this in LabWindows/CVI 6.0 ?
The program have to simulate an equipment. The tree is for a better finding of the "events", the equipment can do.
The last "file" in the tree should I took to some buttons to simulate the event. But this I think is not the problem.
thx for solving my problem ;-)Check AL S's response here for how to do this. CVI 6.0 does not have a native Tree control. This was introduced with CVI 7.0.
Bilal Durrani
NI -
How to get Text for nodes in Tree Structure
Hi Friends,
How to get Text for nodes in Tree Structure
REPORT YFIIN_REP_TREE_STRUCTURE no standard page heading.
I N I T I A L I Z A T I O N
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
ID 'YFIINICD' FIELD SY-TCODE.
IF SY-SUBRC NE 0.
MESSAGE I000(yFI02) with SY-TCODE .
LEAVE PROGRAM.
ENDIF.
class screen_init definition create private.
Public section
public section.
class-methods init_screen.
methods constructor.
Private section
private section.
data: container1 type ref to cl_gui_custom_container,
container2 type ref to cl_gui_custom_container,
tree type ref to cl_gui_simple_tree.
methods: fill_tree.
endclass.
Class for Handling Events
class screen_handler definition.
Public section
public section.
methods: constructor importing container
type ref to cl_gui_custom_container,
handle_node_double_click
for event node_double_click
of cl_gui_simple_tree
importing node_key .
Private section
private section.
endclass.
*& Classes implementation
class screen_init implementation.
*& Method INIT_SCREEN
method init_screen.
data screen type ref to screen_init.
create object screen.
endmethod.
*& Method CONSTRUCTOR
method constructor.
data: events type cntl_simple_events,
event like line of events,
event_handler type ref to screen_handler.
create object: container1 exporting container_name = 'CUSTOM_1',
tree exporting parent = container1
node_selection_mode =
cl_gui_simple_tree=>node_sel_mode_multiple.
create object: container2 exporting container_name = 'CUSTOM_2',
event_handler exporting container = container2.
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = ' '. "system event, does not trigger PAI
append event to events.
call method tree->set_registered_events
exporting events = events.
set handler event_handler->handle_node_double_click for tree.
call method: me->fill_tree.
endmethod.
*& Method FILL_TREE
method fill_tree.
data: node_table type table of abdemonode,
node type abdemonode.
types: begin of tree_node,
folder(50) type c,
tcode(60) type c,
tcode1(60) type c,
tcode2(60) type c,
text(60) type c,
text1(60) type c,
text2(60) type c,
end of tree_node.
data: wa_tree_node type tree_node,
t_tree_node type table of tree_node.
wa_tree_node-folder = text-001.
wa_tree_node-tcode = text-002.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-003.
wa_tree_node-text1 = 'GR/IR aging'.
wa_tree_node-tcode2 = text-004.
wa_tree_node-text2 = 'Bank Balance'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-005.
wa_tree_node-tcode = text-006.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-007.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-008.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-009.
wa_tree_node-tcode = text-010.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-011.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-012.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
node-hidden = ' '. " All nodes are visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder,
node-expander = ' '. " have no '+' sign forexpansion.
loop at t_tree_node into wa_tree_node.
at new folder.
node-isfolder = 'X'. " a folder,
node-node_key = wa_tree_node-folder.
clear node-relatkey.
clear node-relatship.
node-text = wa_tree_node-folder.
node-n_image = ' '.
node-exp_image = ' '.
append node to node_table.
endat.
at new tcode .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode.
node-text = wa_tree_node-text .
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
endat.
append node to node_table.
at new tcode1 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode1.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text1.
endat.
append node to node_table.
at new tcode2 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode2.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text2.
endat.
append node to node_table.
endloop.
call method tree->add_nodes
exporting table_structure_name = 'ABDEMONODE'
node_table = node_table.
endmethod.
endclass.
*& Class implementation
class screen_handler implementation.
*& Method CONSTRUCTOR
method constructor.
create object: HTML_VIEWER exporting PARENT = CONTAINER,
LIST_VIEWER exporting I_PARENT = CONTAINER.
endmethod.
*& Method HANDLE_NODE_DOUBLE_CLICK
method handle_node_double_click.
case node_key(12).
when 'Creditors'.
submit YFIIN_REP_CREADITORS_AGING via selection-screen and return.
when 'Vendor'.
submit YFIIN_REP_VENDOR_OUTSTANDING via selection-screen and return.
when 'Customer'.
submit YFIIN_REP_CUSTOMER_OUTSTANDING via selection-screen and
return.
when 'GR/IR'.
submit YFIIN_REP_GRIR_AGING via selection-screen and return.
when 'Acc_Doc_List'.
submit YFIIN_REP_ACCOUNTINGDOCLIST via selection-screen and return.
when 'Bank Bal'.
submit YFIIN_REP_BANKBALANCE via selection-screen and return.
when 'Ven_Cus_Dtl'.
submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
when 'G/L_Open_Bal'.
submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
when 'Usr_Authn'.
submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
endcase.
endmethod.
endclass.
Program execution ************************************************
load-of-program.
call screen 9001.
at selection-screen.
Dialog Modules PBO
*& Module STATUS_9001 OUTPUT
text
module status_9001 output.
set pf-status 'SCREEN_9001'.
set titlebar 'TIT_9001'.
call method screen_init=>init_screen.
endmodule. " STATUS_9001 OUTPUT
Dialog Modules PAI
*& Module USER_COMMAND_9001 INPUT
text
module user_command_9001 input.
endmodule. " USER_COMMAND_9001 INPUT
*& Module exit_9001 INPUT
text
module exit_9001 input.
case sy-ucomm.
when 'EXIT'.
set screen 0.
endcase.
endmodule.
exit_9001 INPUTyou can read the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
Regards,
Gopi .
Reward points if helpfull. -
Query for spesific children in a tree structure
Hi,
My data is organized in a tree structure.
I need a sql statement that returns a parent that
have a set of children corresponding to some demands.
I provide a very simplified description of my data, but it covers my problem.
Can anyone please help me write a select statement that gives me all featureids
that have a GID attribute with children GNR=123 AND BNR=456?
Regards
gv
create table attributetype( id number, name varchar2(8), parentid number );
insert into attributetype( id, name ) values ( 1, 'GIDLIST' );
insert into attributetype( id, name, parentid ) values ( 2, 'GID', 1 );
insert into attributetype( id, name, parentid ) values( 3, 'GNR', 2 );
insert into attributetype( id, name, parentid ) values ( 4, 'BNR', 2 );
create table attribute( featureid number, id number, parentid number, atttypeid number, intvalue number );
--attributes for feature1
insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 1, 0, 1 );
insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 2, 1, 2 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 3, 2, 3, 123 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 4, 2, 4, 456 );
insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 5, 1, 2 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 6, 5, 3, 12 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 7, 5, 4, 456 );
--attributes for feature 2
insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 8, 0, 1 );
insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 9, 8, 2 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 10, 9, 3, 678 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 11, 9, 4, 456 );
insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 12, 8, 2 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 13, 12, 3, 876 );
insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 14, 12, 4, 456 );
commit;
column name format a15
select a.featureid featureid, lpad(' ', (level - 1) * 2) || b.name name, a.id attid, a.parentid parentid, a.intvalue
from attribute a, attributetype b
where a.atttypeid=b.id
connect by prior a.id=a.parentid
start with a.parentid=0;
FEATUREID NAME ATTID PARENTID INTVALUE
1 GIDLIST 1 0
1 GID 2 1
1 GNR 3 2 123
1 BNR 4 2 456
1 GID 5 1
1 GNR 6 5 12
1 BNR 7 5 456
2 GIDLIST 8 0
2 GID 12 8
2 GNR 13 12 876
2 BNR 14 12 456
2 GID 9 8
2 GNR 10 9 678
2 BNR 11 9 456Hi,
Thanks for providing the CREATE TABLE and INSERT statements; that helps a lot.
You want featureids that meet three criteria:
(1) there is a GID attribute
(2) the GID attribute has a GNR child with intvalue=123
(3) the GID attribute has a BNR child with intvalue=456
Since you're looking for immediate children, not distant descendants, it's easiest to do this with a non-hierarrchical query that finds one of these criteria, and does EXISTS sub-queries to test for the other two.
For example:
WITH aat AS
( -- Begin aat: join of attribute and attributetype
SELECT a.featureid
, a.id
, a.parentid
, a.intvalue
, t.name
FROM attribute a
JOIN attributetype t ON a.atttypeid = t.id
) -- End aat: join of attribute and attributetype
SELECT DISTINCT featureid
FROM aat m -- m for main
WHERE name = 'GID'
AND EXISTS ( -- Begin EXISTS sub-query for GNR=123
SELECT NULL
FROM aat
WHERE parentid = m.id
AND name = 'GNR'
AND intvalue = 123
) -- End EXISTS sub-query for GNR=123
AND EXISTS ( -- Begin EXISTS sub-query for BNR=456
SELECT NULL
FROM aat
WHERE parentid = m.id
AND name = 'BNR'
AND intvalue = 456
) -- End EXISTS sub-query for BNR=456
;Alternatively, you could do a three-way self join, and skip the EXISTS sub-queries.
If you were looking for GNR and BNR descendants, any number of levels below the same GID node, it's easy to modify the query above. Just re-write the EXISTS sub-queries to CONNECT BY queries that "START WITH parentid = m.id".
It looks like this application will have a lot of use for a view like aat, above. If you don't already have a permanent view like that, you should create one. -
WDA: Tree structure in web dynpro for ABAP
Hi,
I am trying to build a tree structure with information something like the following:
Country
State
City
I used the UI Element "Tree" and I was successful in building it. The only problem is that it supports only one column in each row like name.
I need multiple columns in each row like Name and population.
1) Is there any solution for this using UI element "Tree" only?
2)I checked that there is Table tree UI element, but I could not figure out how I could use it for hierarchial structure like that of my requirement? Can I use it? Is there any example application with hierarchial structure?
3)For tree UI element, any node that is not directly below context node has to be non-singleton. It will lead to adverse performance. Is there any solution for this?
Thanks in advance.
Regards,
Srini.Hi Srinivasa,
In the context, please create a node DATA with the following fields:
KEY type string
PARENT type string
LOCATION type string
POPULATION type string (or "I" if you happen to have numbers only without a unit like "k" for "thousand").
Then please create a table with a TreeByKeyTableColumn namde LOCATION and an additional TableColumn called POPULATION. Now please add a TextView cell editor to both and bind the text value of each of them to the attributes LOCATION and POPULATION of the context node DATA. Last step is to bind the attribtues rowKey and parentRowKey(?) to the KEY and the PARENT attributes. This concludes the design time part.
Next step is to fill the node DATA with actual data. Just use a supply function and do it like this:
First entry:
KEY = 'WORLD'.
PARENT = ''.
LOCATION = 'World'.
POPULATION = '4 billion'.
Second entry:
KEY = 'DE'.
PARENT = 'WORLD'.
LOCATION = 'Germany'.
POPULATION = '80 million'.
You should now see a table with a tree at the left column that looks like:
<pre>
World 4 billion
->Germany 80 million
</pre>
Kind regards,
Thomas
Message was edited by: Thomas Szuecs -
F4 Help for Training Event -Tree structure like in PSV2
Hi,
There is any function module to give the F4 help in custome development for Training Event like Tree structure in PSV2.Check AL S's response here for how to do this. CVI 6.0 does not have a native Tree control. This was introduced with CVI 7.0.
Bilal Durrani
NI -
Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"
Hi,
I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
Now I wanted to insert a check and give message when the user opens the last node in my structure.
I checked the events available in the class , but there in none which gets trigered when we try to open a node.
Please guide me with this scenario.
Thanks & Regards,
Omkar M.Hello Omkar
The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
Copy this report and make the following changes:
class lcl_tree_event_receiver definition.
public section.
methods:
on_expand_no_children " new event handler method
for event expand_no_children of cl_gui_column_tree
importing NODE_KEY, " class = CL_GUI_COLUMN_TREE !!!
on_add_hierarchy_node
for event on_add_hierarchy_node of cl_gui_alv_tree_simple
importing grouplevel
index_outtab.
endclass.
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD on_expand_no_children.
BREAK-POINT.
ENDMETHOD. "on_expand_no_children
FORM register_events.
* define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
* define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND l_event TO lt_events.
CALL METHOD tree1->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
* set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->on_add_hierarchy_node
FOR tree1. " CL_GUI_ALV_TREE_SIMPLE
SET HANDLER l_event_receiver->on_expand_no_children
FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
ENDFORM. " register_events
As soon as you open a node in the ALV tree the report will stop at the break-point.
Now you need to check if there are still children nodes to be displayed.
If not then trigger your special coding.
Regards
Uwe -
Creating a tree structure like Windows file explorer using Jdev
Hi All,
Is it possible to develop a tree structure like windows in JDEV and then same page I want to move to oracle apps.
This tree I am creating for Showing Employee information. Like Parents & childs under it. i.e. Managers and employee reporting to managers.
Please let me know if it is possible, if yes how , what is method of doing this.
Thanks
Ganesh ManeYes. This possible with ADF Faces RC, which provides an af:tree component. Have a look at the Fusion Order Demo, which uses the tree to implement a similar usecase to the one you describe.
http://www.oracle.com/technology/products/jdev/samples/fod/index.html
Regards,
RiC
Maybe you are looking for
-
Images Browser Dialog gets OutOfMemoryError no stack trace available
Hello all. I am writing a dialog to list the image by showing their thumbnail, which like the style of ACDSee or CoffeeCup Free Viewer Plus. For this, I build 3 objects(thumbCanvas,thumbPanel,testingfrm). thumbCanvas - displays the thumbnail with asp
-
Regional Settings on Lumia 710
Dear friends, I am based out of India, Problem - I bought a Lumia 710 in London, I want to change the regional setting to India but there is no option to select India, it shows many countries but not my country. I wanted to buy something through the
-
I made a spry drop down menu in dreamweaver CS4 and placed it in a template. But on ipad it doesn't work. On pc it works properly. What to do to make it work on a tablet too? site: www.lourdeshofstade.net
-
Labview crashes when building 1d digital waveform
Hello, I don't know if it is something about my machine or if I am missing something.... When I run the VI attached below with "# of digital lines=32" Labview hangs up and I have to kill the process using the Window Task manager. If I run it with 16
-
Safari freezes my computer!!!
It's happening more often!! While using safari, it suddenly freezes (beach ball of dead) and then the whole Mountain Lion freezes. The only option is to press the power button for some seconds so it turns off. Anyone has any idea about this!?