How to highlight/indicate particular tree Node in Tree UI element
Hi All
Can anybody let us know how to highlight/indicate specific node in a tree struture.
currently i am able to display the tree struture with all the nodes & elements but it is always tasking firstnode as highlighted one or indicated one.
if i want to highlight specific node in a tree struture...what was the procedure or any sample code then it would be great help to us.
Thanks
Trisha rani
Hi Krishna
Thanks for your reply
I displayed the tree structure and i want to highlight specific parent node/child element , what was the sample code??
for example my tree was displayed in the below struture and at the runtime specific child node i wanted to be highlighted i want to make selectable particular nodeType......
Can you pls send sample codee code??
my requirement
A
A1
A2
A3
B
B1
B2
B3
B4
B5
now i want to make selectable or highlighted B4,B5 etc or A2,A3 at runtime.
The other guy who replied for this thread it is working for Parent nodes to make highlighted like it is working for parent nodes which is have child nodes. i am able to hightlight at runtime for Nodes A,B etc .
Now i want to highlight or make selected one for B4,A3 etc, pls provide sample code??
it would be great help to us
Thanks
Trisha Rani
Similar Messages
-
How to select more than one node in tree
Hi
plz any one know how to select multi nodes in tree components ??
i wana select two employees or more from tree in order to know their informations how can i do that
10nx for helpi can select them from different parents that depends on what i want to select Like:
Admin-Sam
-Dinda
Users-David
-Marylinn
-Sandra
for ex: i wana choose Sam , Sandra & David to view thier times and OT on selecting them -
How can i add and delete node in tree in run time
i want to know the method that let me select tree node to delete it and another to input upon user inputs
Hello,
why don't you just enter "add tree node" in the Search Forum search box ?
There are plenty of samples.
Francois -
How to highlight all child items in a tree control?
I have a tree control and a boolean button. I want to use the button to select all (highlight) the child items in the tree control. I've seen CVI functions where you can set the active items, but such a function/method does not appear in LabVIEW.
Any clues?Hi settles,
Once you have all the children, you just need to set the value of the tree control to be an array of all the child tags. Here's a screenshot of a VI that does this:
First I get all the tags, then I get the parent of each tag. If the parent is a non-empty string, I add it to an array. Then I write that array value to a local variable of the tree control. Let me know if you have any questions on this method. I believe the "All Tags" property I'm using was added in LabVIEW 8.0.
-D
Message Edited by Darren on 08-20-2008 10:58 AM
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman
Attachments:
select_all_children_in_tree.PNG 34 KB -
Select tree node in tree component
hi,
i am developing a web site which has a site map as a tree component, the sitemap is a inserted in a page fragment, users could click tree nodes to go to corresponding pages. also on other pages, i have next and previous buttons which allow users to navigate through pages. the question is how can i update the tree component when users navigate using the next and previous buttons so that the correct tree node is highlighted?
i tried to use the selected property for the tree component, but it does not do anything.
thanks,
leeHi,
Duplicate thread of
http://swforum.sun.com/jive/thread.jspa?threadID=64518
MJ -
Display Checkbox along Tree node and its child elements
Experts,
I want to display a checkbox in front of the Tree displayed in the view. This is used for me to select the child item value for my selection condition.
let say if the user selects the node, all the child elements will be used for search condition.
Otherwise, if the node is expanded, then the checkbox selected in the child element will be used for search condition...
Can u ppl suggest me how to design it, if possible can u share some sample code or procedure to customize the Tree as per the requirement...
thanx in advance,
James...hi
please go through this
<a href="http://integration of a tree structure in a web dynpro table">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef543ce</a>
Thanks
Smitha -
Hi,
I have tree on page and would like to deselect selected node without selecting any other node in the tree i.e. no node selected in tree.
Any suggestion, how can it be achieved.
Thanks.Hi Thanks for your replay.
you wrote:
"As I have observed the TreeSelectionListener will respond when first time the node is clicked and then mouse listener.Later on any number of clicks on same node,mouse listener will listen."
my questions:
when we implement both mouse listener and TreeSelectionListener
they will both respond when we select the node.
my mission will be here to stopped mouse to respond .
first question:
how can i do it????
when the node already select and i clicked it again than only mouse will respond so this is not a problem because only the mouse will respond.
i hope i make it clear.
TIA -
How to highlight cell in a tree programatically when mouse arrow is moved over it
Hi
I would like to highlight a particular cell in a tree when a mouse arrow is moved over it. Similar to wndows drop down menu. Can anybody help me on these.
Regards
Bharath
Solved!
Go to Solution.But I find an issue with this. When there are items with same values in the tree, it always points to the first matched value (even if I set the active item tag to the one where I want to point to). For example, if I have a tree with values "Hello, Hi, Bye, Hello" and then I set the value to "Hello", it points to the first "Hello" even if I set the tag to the second yellow. Do you know any easy work around for this? Thank you!
jcarmody wrote: -
Tree Nodes has White Outline/Border
Hi,
I'm using an ADF tree located inside a panelGroupLayout.
The panelGroupLayout has the background color "light blue".
At runtime each tree node is displayed with a surrounding white outline and that can only appear when you have a background color different than white (in my case the panelGroupLayout is "light blue").
Does anybody knows how to remove that outline? or to change its color?
Thanks,
Alain.Here are the skin seletors
tr:tree Component
Icon Selectors
Name Description
af|tree::expanded-icon This icon is displayed before the expanded tree node.
af|tree::collapsed-icon This icon is displayed before the collapsed tree node.
af|tree::no-children-icon This icon is displayed instead of the expanded/collapsed icon, when the node has no children
af|tree::line-icon This icon is used as a vertical line between the nodes.
af|tree::line-middle-icon This icon is used as the horizontal line in the background of the expand/collapse icon of the node, in the case the node is not the last sibling of its parent node.
af|tree::line-last-icon This icon is used as the horizontal line in the background of the expand/collapse icon of the node, in the case the node is the last sibling of its parent node.
af|tree::node-icon This icon selector is used in the case the Node class has a getNodeType() method that returns the node type as string. The nodetype gets added to this selector, separated by a ':'. If the node is a container (has children) the following suffixes get added depending on the expanded/collapsed state: '-expanded' / '-collapsed'. e.g. "af|tree::node-icon:container-collapsed", "af|tree::node-icon:container-expanded", "af|tree::node-icon:noncontainer".
Trinidad properties
Name Description
-tr-show-lines Valid values are true or false (default true). Determines whether the tree lines are displayed or not. e.g., af|tree {-tr-show-lines:false} will not show the lines of the tree.Timo -
How to highlight Tree node with a diff color
I have created tree node and want to highlight Selected node with a different background color. Any Ideas how can we achieve that? -R
It's an item on page 4 of the application that the blog example is taken from. The tree query:
SELECT EMPLOYEE_ID AS ID
, MANAGER_ID AS PID
, CASE
WHEN EMPLOYEE_ID = :P4_EMPLOYEE_ID THEN
'<span style="color:white;background-color:blue;">'||
LAST_NAME||
'</span>'
ELSE
LAST_NAME
END AS NAME
, 'f?p=&APP_ID.:4:'||:SESSION||'::NO::P4_EMPLOYEE_ID:'||EMPLOYEE_ID AS LINK
, NULL AS A1
, NULL AS A2
FROM #OWNER#.EMPLOYEESgenerates leaf nodes that link to page 4, setting the value of P4_EMPLOYEE_ID. When page 4 is rendered, P4_EMPLOYEE_ID contains the ID of the clicked node, the page displays details of the employee with this ID, and the case expression in the tree query causes the corresponding display value to be highlighted.
See the sections Managing Session State Values and Using f?p Syntax to Link Pages in the documentation to understand how to set session state values using URLs.
http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm -
How to highlight a tree node programmatically
Problem
=====
Just like a typical management software, I have a navigation tree presenting a list of objects (let's say toasters) on the left panel. The content panel on the right side presents the details of a toaster, when the user selects the toaster on the navigation tree. On the toaster details panel, I would like to have a hyper link referring to another toaster - associated to the selected toaster. On clicking on the hyperlink, I would like to display the details of the associated toaster and the navigation tree node for the associated toaster being highlighted.
For example, BUI presents the following now:
+ Toasters | Toaster 1 Details [Refresh]
+ <toaster1> |
+ toaster2 | ... toaster3
+ toaster3 |
toaster1 is selected on the navigation tree. The contents panel displays Toaster 1 details, which has a hyper link for toaster3.
When the user click on toster3 on the contents panel, I would like to see the following
+ Toasters | Toaster 3 Details [Refresh]
+ toaster1 |
+ toaster2 | ...
+ <toaster3> |
My Trial
=====
ADF Rich Client 11.1.2.3 is used for my development.
Jspx code for the navigation tree looks like this:
<af:tree id="navTree" ...>
<f:facet name="nodeStamp">
<af:panelGroupLayout id="nodePgl">
<af:switcher facetName="#{stamp.outcome!=null?'actnode':'noactnode'}" ...>
<f:facet name="actnode">
<af:commandLink id="leafLink" text="#{stamp.label}" action="#{stamp.actionOutcome}">
<af:setActionListener from="#{stamp.key}" to="#{treeHandler.selectedMenuItem}"/>
</af:commandLink>
</f:facet>
<f:facet name="noactnode">
<af:outputText id="notLeafText" value="#{stamp.label}"/>
</f:facet>
</af:switcher>
</af:panelGroupLayout>
</f:facet>
</af:tree>
The hyper link on the contents panel looks like this:
<af:iterator var="toaster" value="#{toastData.toasters}">
<af:commandLink text="#{toaster}" action="#{toasterHandler.goToToaster}">
<f:param name="toasterId" value="#{toaster}"/>
<af:setActionListener from="#{toaster}" to="#{treeHandler.selectedToaster}"/>
</af:commandLink>
</af:iterator>
I got some tips from this forum (cannot find thread at the moment) and implemented the treeHandler.selectedToaster method as follows:
// getSelectionState returns selStat, which is instantiated like the following:
// RowKeySet selStat = new RowKeySetTreeImpl();
// TreeModel model = (TreeModel) menuModel.getWrappedData();
// selStat.setCollectionModel(model);
// selStat.setContained(true);
RowKeySet rowKeySet = getSelectionState();
rowKeySet.removeAll();
// synthesize the rowKey for the selected toaster
// if the toaster found in the toaster node list,
// rowKey should look like [0, <rowIdx of toaster>]
ArrayList<Integer> rowKey = new ArrayList<Integer>();
rowKey.add(0);
rowKey.add(new Integer(rowIdx));
TreeModel model = (TreeModel) menuModel.getWrappedData();
model.setRowKey(rowKey);
model.setRowIndex(rowIdx);
rowKeySet.add();
This seems to work most of times except when I refresh the contents details panel using partial page rendering.
I get NullPointerException on the call to rowKeySet.removeAll().
Caused by: java.lang.NullPointerException
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._selectAll(RowKeySetTreeImpl.java:459)
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.removeAll(RowKeySetTreeImpl.java:146)
In my observation, this NPE happens when rowKeySet.size() returns 1 but rowKeySet.iterator() does not return any entries.
I suspect this is a bug on RowKeySetTreeImpl but not sure.
Help Need
=======
1. What is the reasonably right way to highlight the tree node for my problem?
2. If my trial is one way to do it, how can I get around the NPE? I cannot change ADF Rich Client library at this point.
Any help/suggestion/advise would be appreciated.
Thanks,
JeongtaeI did this, to programmatically expand a tree node, you can try the same and set the row key to highlight.
private RowKeySet disclosedTreeRowKeySet = new RowKeySetImpl();
public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent)
Iterator added = rowDisclosureEvent.getAddedSet().iterator();
if (added!=null)
while (added.hasNext())
Object rowKey = added.next();
//disclosedTreeRowKeySet.clear();
List path = (List)rowKey;
for( int i=0; i< path.size(); i++ )
List<Object> nodePath = new ArrayList<Object>();
for( int j=0; j<i; j++ )
nodePath.add( path.get( j ) );
disclosedTreeRowKeySet.add( nodePath );
disclosedTreeRowKeySet.add( rowKey );
System.out.println( "disclosed Keys...... " + disclosedTreeRowKeySet );
private void expandSelectedNode(RowKeySet addedObj) {
if (sourceTreeTable != null) {
Iterator added = (Iterator)addedObj.iterator();
if (added!=null)
while (added.hasNext())
Object rowKey = added.next();
List path = (List)rowKey;
for( int i=0; i< path.size(); i++ )
List<Object> nodePath = new ArrayList<Object>();
for( int j=0; j<i; j++ )
nodePath.add( path.get( j ) );
disclosedTreeRowKeySet.add( nodePath );
disclosedTreeRowKeySet.add( rowKey );
sourceTreeTable.setDisclosedRowKeys(disclosedTreeRowKeySet);
} -
Af:tree - how do I highlight the selected tree node?
af:tree
I checked the generated CSS file. I found that when a tree node is selected, the related CSS attribute is:
.xj:link{
font-family:Arial,Helvetica,Geneva,sans-serif;
font-size:10pt;
font-weight:normal;
color:#663300
I created a customized CSS attribute, but then all of the links have the customized CSS attributes.
How do I just highlight the selected tree node link?
Thanks,
--Toddtry doing the onclick javascript method
you have to place it on the node element and id must be made dynamic
for this use 'this.id'
by which the current id of the node is passed
and by capturing the id name in a var
use the same for invoking its selected property and make it true
like this
var currentid = this.id;
this.form.currentid.selected = true; -
How to select a particular node in a tree?-want suggestions urgent
i've to make a tree showing "c:\" folder structure of the system. Initially i'm adding the folders in c:\ only tothe tree. And i'm adding the subfolders when ever i select a particular folder. I'm opening the subfolders and inner subfolders of it and so inside like that. now i'm closing the window . i want the tree to reopen with the previously opened level when ever i again run the program. On closing i'm storing the last selected node using tree.getMaxSelectionPath() . And on reopen i'm setting it as tree.setSelectionPath(tree.getMaxSelectionPath()).
But it is not opening the entire path. it is opening uptop one level only. what to do. Needs suggestion urgently.
Thnaks for suggestons.Hi again,
I am sorry, I cannot help in another way than looking at the documentation, because I have currently no JDK available here. If expandPath(...) doesn't work, you can try to get all the nodes of that path and expand them from the root node downwards, perhaps that will work.
greetings Marsian -
How to run a form using tree node selection??
hi...
i have populated a tree with all the form name.There is a particular id for every form.i want to show a form using tree node selection.What i did...i write a trigger in button's click event when the tree node is selected then i get a id.if id=1 then open_form('test.fmx').when i want to execute this code then it is showing the same form 2 times.Can anyone help me to solve my problem?If so plz tell me what code i have to write to show a form using node selection?.I've done the same thing, and i think it works fine.
Check this code (Sorry for the long post, but i cannot find how to attach files.
PACKAGE menu_pk IS
--Initialization of the menu.
procedure Init;
--Called from WHEN-TREE-NODE-EXPANDED
procedure Expanded;
--Called from WHEN-TREE-NODE-ACTIVATED
procedure ExecuteCommand;
END;
PACKAGE BODY menu_pk IS
MENU_NAME constant varchar2(30) := 'menu.menu';
cursor c_menu(pRoot in varchar2) is
select apm_code, apm_parcode, apm_descr, decode(apm_type, 0, Ftree.EXPANDED_NODE, Ftree.LEAF_NODE) apm_type,
decode(apm_type, 0, 'menu', 1, 'form', 2, 'report') || '.ico' apm_icon
from app_menu
where apm_parcode = pRoot
order by apm_code asc;
procedure Init is
new_node ftree.node;
begin
for i in c_menu('root')
loop
new_node := Ftree.add_tree_node(MENU_NAME, FTree.ROOT_NODE,
Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
end loop;
end;
procedure FillNode(pNode in FTree.Node) is
new_node ftree.node;
begin
for i in c_menu(FTree.get_tree_node_property(MENU_NAME, pNode, FTree.NODE_VALUE))
loop
new_node := Ftree.add_tree_node(MENU_NAME, pNode,
Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
end loop;
end;
procedure DeleteNodeChilds is
node FTree.NODE;
begin
loop
node := FTree.Find_Tree_Node(MENU_NAME, '',
FTree.FIND_NEXT_CHILD, FTree.NODE_VALUE,
name_in('system.trigger_node'), name_in('system.trigger_node'));
exit when Ftree.ID_NULL(node);
FTree.delete_tree_node(MENU_NAME, node);
end loop;
end;
procedure Expanded is
begin
if (FTree.GET_TREE_NODE_PROPERTY(MENU_NAME, :system.trigger_node, FTree.Node_State) = FTree.EXPANDED_NODE) then
menu_pk.FillNode(name_in('system.trigger_node'));
else
menu_pk.DeleteNodeChilds;
end if;
end;
procedure ExecuteCommand is
cursor c_command(pCode in varchar2) is
select apm_form, apm_type
from app_menu
where apm_code = pCode;
fCommand c_command%rowtype;
fMenuCode varchar2(20);
begin
-- if it is as menu node then exit.
if (not FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_STATE) = FTree.LEAF_NODE) then
return;
end if;
fMenuCode := FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_VALUE);
open c_command(fMenuCode);
fetch c_command into fCommand;
close c_command;
if (fCommand.apm_type = 1) and (fCommand.apm_form is not null) then
globals.Set_MenuChoice(fMenuCode);
OPEN_FORM(fCommand.apm_form);--, ACTIVATE, SESSION);
end if;
end;
END;
The menu table definition follows.
create table APP_MENU
APM_CODE VARCHAR2(10) not null,
APM_PARCODE VARCHAR2(10) not null,
APM_DESCR VARCHAR2(40) not null,
APM_TYPE NUMBER(1) not null,
APM_FORM VARCHAR2(50)
alter table APP_MENU
add constraint APP_MENU_PRI primary key (APM_CODE);
Hope this helps -
Highlight node in tree in apex 4
Hello!
The tree has nodes. Node name can include the number in brackets, for example "Messages (1)". Requires such nodes in the tree is highlighted in red, regardless of whether a node is selected or not. At the same time a tree node can be at different levels, not necessarily at the root or leaf.
I made javascript, but it does not work correctly, API tree is not very clear.
The script highlights only the first level and all children, and that is not true.
treeData = window [tree.attr ('id'). replace (/ ^ tree (\ d +)$/, 'l $ 1Data')] [0]. children;
for (var i = 0; i <treeData.length; i + +)
try {
if (/ \ S + \ (\ d + \) $ /. test (treeData . data.title))
{apex.jQuery ('li [id =' + treeData [i]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold'); }} catch (err) {}
for (var j = 0; j <treeData [i]. children.length; j + +)
try {if (/ \ S + \ (\ d + \) $ /. test (treeData [i]. children [j]. data.title)
{apex.jQuery ('li [id =' + treeData [i]. children [j]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold');}} catch (err) {}
Help please!
[Not correctly work: http://files.mail.ru/FHON5H|http://files.mail.ru/FHON5H]It can be used static ID for node
In sql:
case when msg_count>0 then 'TreeRed_' || rownum
else 'TreeBlack_' || rownum
end as value,
In js:
$('[id^="TreeRed_"]').children('a').css('color', 'red').css('font-weight', 'bold');
How can I highlight node without renaming ID, couse I need ID for links?
Maybe you are looking for
-
How do i sync my iphone with a new computer without losing all of my apps
I bought a new macbook pro and want to sync my iphone and ipad with itunes on the new computer. I don't want to lose all of my apps (photos and music are already transfered). I am pretty sure that all of the apps that I have bought are in itunes, but
-
Error while starting CICS Runtime Server
Hi , I am trying the rehost the STFILEORA sample applcation that is provided with Tuxedo workbench . I followed all the steps and deployed the application. After that I did . ./setenv and ksh ./setup.sh under CICS_RT which worked okay. But when I tri
-
IMovie temporary files; importing fails on network home directory
Hi all, I work in a laboratory and manage a bunch of Macs. We have a 2x2.5GHZ G5 with 4G of memory and iMovie 6. The mac has two 300 GB disks that are in a concatenated raid group, so the system has about 450GB of free disk. The mac is bound to an Op
-
Everytime I try I try to update the software to IOS 7.0.2 ON my third generation IPAD, i keep getting a "download error" message
-
How to use OData Date filter query to filter data from OData NetWeaver Gateway Service?
Hello, I am trying to use the OData Filter query. to filter data records from the OData Service, using Date range for filters. Please check the below URL for the SAP's sample OData Service, with filter option. Service Query URL : https://sapes1.sapde