Problem refreshing the Tree Component icons
Hello,
I'm using the Tree, adding the nodes dinamically, following the example: http://www.netbeans.org/kb/55/vwp-databasetree.html
This Tree shows the access permissions from the users, and show a red icon on the itens without permissions and a green icon on the itens with permissions.
In the nodes, I add an action that change this permissions when the user click.
If the permission is Ok on the clicked item, the action remove this permission and vice-versa.
The action is working fine, but the problem is the refresh of the tree after click. The icons stay like before the click. It is refreshed only if I navigate to another page and return after. Then the icons are showed correct.
In the method that add the nodes, I select the node icons like this:
if (havePermissionModulo(grupo, modulo)){
moduloNode.setImageURL(imgPermissaoOk);
}else{
moduloNode.setImageURL(imgPermissaoNegada);
Where imgPermissaoOk and imgPermissaoNegada have the path to the images.
Sorry by my english :)
It is hard to tell
When the user clicks on an icon, is the page submitted to the server and the page redisplaying itself?
Is the tree's clientSide property cleared (that is, false).
Is the browser caching the images? What if you hit a Shift-Reload?
Similar Messages
-
How do you change the Tree Component Icons?
Hi,
I have been trying to get to grips with the tree component. I
want to
customise it so that I can have a different icon for each
different link.
E.g. a QT logo for a video etc. If no valuse is found for the
'icon'
attribute it will just display the default.
Within my XML file I have created a new attribute for each
link called
'icon' and has a value of 'movie.gif' or something similar.
In my flash file, I have created the following code:
theTree.iconFunction = function (node:XMLNode) {
var iconNode:String = item.attributes.icon;
if (iconNode != undefined) {
return iconNode;
However, it does not seem to work. My knowledge of
ActionScript is pretty
poor so I assume I have made a mistake in there somewhere.
Can anyone help
me with this?
Thanks!Check out the Component Reference... you change the icon for
a single node, as far as I know there's no automated process beyond
that. So assuming your tree component instance is named "theTree"
you might do this to change the icon of the first node:
theTree.dataProvider = yourXML; // make sure you don't try to
change the icon before you load data into the tree
var theNode = theTree.getTreeNodeAt(0); // the first node in
your tree
theTree.setIcon(theNode,'myIcon'); // set the icon
Where "myIcon" is a MovieClip you have in your library that
you have set the "linkage identifier" as "myIcon".
That iconFunction doesn't make a whole lot of sense to me,
because first of all I don't know why it would be attached to
theTree, and second it's referring to "item" which is not defined,
and third its taking the parameter "node" and not doing anything
with it. But perhaps there is some cool way to make a single
function which handles icons for your entire tree automatically,
that would certainly be nice.
However, like I said, as far as I know that function will do
nothing without calling tree.setIcon() in some way. I just made a
function which might do what you want -- it recursively loops
through an entire tree and sets it's icon based on the XML
attribute "icon":
function setAllIcons(branch){
for(var i in branch.childNodes){
var node = branch.getTreeNodeAt(i);
theTree.setIcon(node,node.attributes['icon']);
if(node.hasChildNodes){
setAllIcons(node);
So basically, you run setAllIcons(theTree.dataProvider) after
you have loaded and applied the XML. -
I'm using the tree component for a little Windows Parody I'm making. In my .fla, There's a tree component that loads an external XML file. I can't figure out how to add custom icons to my component, though.
I know it's possible to set the icons for just the default folder and file icons, but since it's a Windows Parody, there'll be different icons for different file types, folder types, etc.
In other words, I'd like to have a different icon for every item in my Tree component.
How can I do this?
Here are the contents of my XML file:
<node>
<node label="Desktop">
</node>
<node label="Documents">
<node label="Pictures" isBranch="true" />
<node label="Movies" isBranch="true" />
<node label="Games" isBranch="true" />
<node label="Video" isBranch="true" />
</node>
<node label="Computer">
<node label="Local Disk (C:)" isBranch="true" />
<node label="Local Disk (D:)" isBranch="true" />
<node label="DVD-RAM Drive (E:)" isBranch="true" />
<node label="DVD/CD-RW Drive (F:)" isBranch="true" />
</node>
<node label="Readme.txt" isBranch="true" />
</node>
And the code on the first frame of my .fla file. The Tree's name is "fileTree", and the XML file is "doors_explorerXML.xml".
//Tree
var fileDP:XML = new XML();
fileDP.ignoreWhite = true;
fileDP.load("doors_explorerXML.xml");
fileDP.onLoad = function() {
fileTree.dataProvider = this.firstChild;
Also, I don't need to have an XML file loaded. If there's an easy way that does it all within Flash, please tell me. I just need to be able to handle events from the Tree.Im having the same issue. I dont know how to change the tree icons separately with the xml. Is there anyone who knows how to do it?
This is what I got so far. However, i can only get my first branch to show custom icons. I tried ALOT, but i guess I´m doing something completely wrong.
Here is the code for my tree so far:
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("tree.xml");
my_xml.onLoad = function(){
myTree.dataProvider = this.firstChild;
var folders = my_xml.firstChild.firstChild;
var docs = folders.childNodes;
for (var i=0; i < docs.length; i++){
currDoc = docs[i];
trace(docs[i]);
var docIcon = currDoc.attributes.pic;
switch(docIcon){
case "pdf":
myTree.setIcon(currDoc, "pdfIcon");
break;
case "word":
myTree.setIcon(currDoc, "wordIcon");
break;
case "excel":
myTree.setIcon(currDoc, "excelIcon");
break;
case "ie":
myTree.setIcon(currDoc, "ieIcon");
break;
}//switch
} //for
};//onLoad
And here is the XML I used:
<node label="» Dokument typer">
<node label="» links - document">
<node label="test.url" url="http://www." pic="ie" info="test text" />
<node label="test.doc" url="test.doc" pic="word" info="test text" />
<node label="test.excel" url="test.xls" pic="excel" info="test text" />
<node label="test.pdf" url="test.pdf" pic="pdf" info="test text." />
</node>
<node label="» Links - document">
<node label="test URL" url="http://www." pic="ie" info="test text." />
<node label="test URL" url="http://www." pic="ie" info="test text." />
</node>
</node> -
Change the Tree Component background
Does anyone know how can i change the Tree Component
background ?
PLS HELPCheck out the Component Reference... you change the icon for
a single node, as far as I know there's no automated process beyond
that. So assuming your tree component instance is named "theTree"
you might do this to change the icon of the first node:
theTree.dataProvider = yourXML; // make sure you don't try to
change the icon before you load data into the tree
var theNode = theTree.getTreeNodeAt(0); // the first node in
your tree
theTree.setIcon(theNode,'myIcon'); // set the icon
Where "myIcon" is a MovieClip you have in your library that
you have set the "linkage identifier" as "myIcon".
That iconFunction doesn't make a whole lot of sense to me,
because first of all I don't know why it would be attached to
theTree, and second it's referring to "item" which is not defined,
and third its taking the parameter "node" and not doing anything
with it. But perhaps there is some cool way to make a single
function which handles icons for your entire tree automatically,
that would certainly be nice.
However, like I said, as far as I know that function will do
nothing without calling tree.setIcon() in some way. I just made a
function which might do what you want -- it recursively loops
through an entire tree and sets it's icon based on the XML
attribute "icon":
function setAllIcons(branch){
for(var i in branch.childNodes){
var node = branch.getTreeNodeAt(i);
theTree.setIcon(node,node.attributes['icon']);
if(node.hasChildNodes){
setAllIcons(node);
So basically, you run setAllIcons(theTree.dataProvider) after
you have loaded and applied the XML. -
A question about the Tree Component
I have try to use the tree component i a flash page, and
it´s going allright until I´ll want to link the content
to a page... WHY??
I have tried a lot of different codes here are those I tried:
<tree>
<folder label="Mine own">
<link label="My page" url="
http://www.mickesei.se" />
</folder>
</tree>
Nr2:
<tree>
<folder label="Mine own">
<link label="My page" link="
http://www.mickesei.se" />
</folder>
</tree>
nr3:
<tree>
<folder label="Mine own">
<link label="My page" href="
http://www.mickesei.se" />
</folder>
</tree>
nr4:
<tree>
<folder label="Mine own">
<link label="My page" get URL="
http://www.mickesei.se" />
</folder>
</tree>
But nothing seems to work, when I go mouse over it still a
arrow should it?
HELP ME PLEASE!!! MickeThanx Jeanne,
You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
Dennis -
Problem with the "Total By" icon
Hi.
Working with Answer I've a problem with the "Total By" icon when the fact displayed is semi-additive.
I try to explain better:
1) my fact table has the following dimensions
Time (year granularity)
City
Type of contracts
2) the fact table contains the fact "Number of Active Contracts"
this fact is additive by City and Type but not by Year.
The "Number of Active Contracts" is calculated usign 2 existing logical columns
Sum (of Number Of Contracts (at base granularity)) / Count Distinct ( of Years )
This fact express an average when more than year is involed in the aggregation,
but express the exact number of contracts if the year is displayed as an output column of the report.
This fact works well changing the aggregation in reports, but when I click on the "Total By" icon to show
the totals its behaviour is different from expected.
consider the report with the following columns:
Yearm City, Number of Active Contracts
Click her to view it: http://yfrog.com/euerrtotaliconj
The "Total By" icon Instead of the sum divided by ditinct years involed, i.e. 1, shows the sum divided by the number of Cities.
It seem it is counting 5 tiimes (= number of cities) the same year.
But If make a report with
Year, Number of Active Contracts
Click her to view it: http://yfrog.com/mjoktotalj
it works as expected !
Many thanks,
Andrea
Edited by: aromani on 17-nov-2010 8.06Philipp is right to tell the developer that the toolbar is automatically disappearing after customizing the add-on on the toolbar. I tried it, and it looks like it gets attached to the Bookmark Tool bar. It may help to make sure all the Toolbars are visible in '''View> Toolbars. '''
It may also be because I have too many extensions on my toolbar ( Too many favorites :-)) -
Problem refreshing the classes
I have problem refreshing the class with Tomcat 4.1 Server. I make changes in my class and they just don't reflect unless I restart the server. I don't want to refresh the server all the time. Is there any setting by which I can tell the server not to the version ffrom the memory. I even deleted that class from the classes directory but still the server would not know it.
Thank youOop's I am sorry. I did some terrible mistake. I am really sorry.
Please Ignore this question -
Do any one know how to make the tree component transparent?
I´ve tried a lot of different things but it doesn´t seem
to work. I´ve tried to make it to a moviclip and drag the
Alpha to 0 but then it doesn´t work at all. You can´t see
the nodes..
Please..
[email protected]I have achieved this by placing the tree and data components
within a container movie clip, and then changing the alpha of that
container.
It worked for me. -
Master table / detail table: Problem refreshing the content
Hi,
I have a Master table/detail table on my page. When I add a new row to the master or detail table, the new row is inserted in the database, but not shown in the ADF Tables on the page. After restarting the OC4J the ADF Tables show the correct data, including the new rows.
While dropping the collection on my page there were one methodIterator and two accessorIterators created.
In several tutorials the solution for the refresh problem is to change the chacheResult parameter of the methodIterator to false. But this causes in "No row found for rowKey:null" errors.
An other solution should be to create a new invokeAction with the id "tableRefresh" and the corresponding RefreshConditions. This doesn't helps, too.
So how could I solve this problem? I want to update/refresh the master and detail table, after I inserted a new row.
Thanks,
ThomasHi,
thanks for your answer.
Sorry, but I forgot to say, that I am using Jdev 10.1.3.1, Toplink, ADF and EJB3.
I think I will give some further informations about the scenario. I created the m/d table by drag-and-droping the object out of the data control palette on site A. Each row stores a goLink item, which navigates to a new page B. After creating and saving the new entry the user navigates back to the page with the m/d table (page A). Storing the new entry is handled by an action in the page B managed bean.
Now the question: How could I re-execute in page B backing bean the iterator which is stored in page A? Could this be handled by an invokeAction? Or is it possible to get access to the iterator used and stored on another page (definition)?
Thanks,
Thomas -
Problem with the PNG file icon
Hello. This is the first time I'm posting something here, so please be merciful. :) Yesterday I saw that the file icons of the PNG files are not the blue ones (like we all know them, after installing Photoshop CS3), but the default Windows (I'm using Windows XP SP3) icons. I mean like when I don't have a program to open a given file, that is how it looks like. But when I double click on the PNG file it opens right away, so in my eyes there is a problem, of some kind, with the ICO file itself. The strangest thing is that this ICO file is not missing, deleted or moved! This happened only with the PNG files. All other Photoshop related files are ok and have their respective icons. Can someone tell me how to change the PNG file icon, so I can choose manually the ICO file.
@roshlioto This is a windows issue NOT Photoshops. So wrong place on the Internet.
However, you right click on the shortcut/icon whatever, (in Windows) and choose the icon/app you wish to associate with a given file. -
Customizing the Tree Component inn ADF Faces..
HI,
I am using the ADF Faces Tree Component and was wondering wheteher we
can use a specific theme instead of the default one..
The scenario's i am looking at are
1) Changing the Style of the Selected Node
2) Programatically can i assign a different styling for a Specific
Node (Previously Selected) in the Tree ??
3) And any info reg Enabling the Drag and Drop functionality ?? As of
now i don't think it is supported. Are there any plans of it being
supported in the furture releases??
Thanks
SateeshHi,
1) See tree skin selectors: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
2) You can reference a managed bean for providing the inline style sheet on a component. This however only works when the tree is re-drawn and not dynamically
3) Drag and drop doesn't work in 10.1.3.x. In 11 this may work - havent tested yet - using a client listener component
Frank -
Using the Tree component of ADF
Hi!
I am wondering if someone could show me a small example of a tree component with pre-defined columns.
Thank you in advance for your assistance!Would you be able to provide an example or a couple of links to resources about how to do so?
I've looked at http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_table.htm#CIADBJCJ, but it doesn't quite explain enough for me.
The example of a treemodel provided there is:
List<TreeNode> root = new ArrayList<TreeNode>();
for(int i = 0; i < firstLevelSize; i++)
List<TreeNode> level1 = new ArrayList<TreeNode>();
for(int j = 0; j < i; j++)
List<TreeNode> level2 = new ArrayList<TreeNode>();
for(int k=0; k<j; k++)
TreeNode z = new TreeNode(null, _nodeVal(i,j,k));
level2.add(z);
TreeNode c = new TreeNode(level2, _nodeVal(i,j));
level1.add(c);
TreeNode n = new TreeNode(level1, _nodeVal(i));
root.add(n);
ChildPropertyTreeModel model = new ChildPropertyTreeModel(root, "children");
private String _nodeVal(Integer... args)
StringBuilder s = new StringBuilder();
for(Integer i : args)
s.append(i);
return s.toString();
}Is a TreeNode a custom class that contains the fields for the tree? -
Customizing the Tree Component
Is there a way to set different font sizes and colors for
different levels of the tree menu?I am guessing that you are using AS2 components, as there is
not a default Tree component for AS3...
I don't know about font sizes, but you can set depth colors
for the AS2 Tree.
The following will set the background colors to black, medium
grey, lighter grey for the Tree that is named "myTree":
var colorArray:Array = new Array();
colorArray.push(0x000000);
colorArray.push(0x555555);
colorArray.push(0x999999);
myTree.setStyle( "depthColors", colorArray );
Note that this is based on the depth. IE for the node
structure:
<node label="First Level">
<node label="Second Level">
<node label="Third Level">
</node>
</node>
</node>
First Level with have a black background, Second Level will
have a medium grey background and Third Level will have a lighter
grey background. -
Problem refreshing the parent page when closing a modal window.
I have page that opens a modal window from a report link column. In the modal window I want to be able to make my changes and press an Apply button so that the modal window is closed and the parent page is refreshed to show the modified details in the report. In Firefox all works well but in IE I get the error message ‘Window.opener.location is null or not an object’ .
When I comment out window.opener.location.href=window.opener.location.href; the modal window closes without error but I want to refresh the parent page with changes made in the modal window.
I’m afraid my java script is very limited (the code is based on other peoples examples.)
Parent Page I call this function from a report link column to display a modal window. Sets the hidden SAVE_STATUS field in destination page to ‘N’
function modalWin(pshow)
var url;
url='f?p=&APP_ID.:'+pshow+':&SESSION.::::SAVE_STATUS:N';
if (window.showModalDialog) {
window.showModalDialog(url,"name","dialogWidth:650px;dialogHeight:700px"); }
else {
window.open(url,"name","height=700,width=650,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
Destination page (modal window)
HTML Header.
The function closeWindow should refresh the parent page and close the modal window.
<base target=_self>
<script language="JavaScript" type="text/javascript">
<!--
htmldb_delete_message='"DELETE_CONFIRM_MSG"';
function closeWindow() {
if ( document.getElementById("SAVE_STATUS").value == 'Y' )
window.opener.location.href=window.opener.location.href;
window.close();
//-->
</script>
Html Body attribute.
onLoad="closeWindow();"
P_UPDATE_DATE process called from the Apply changes button. Sets the SAVE_STATUS flag to ‘Y’ for the onload in the html body.
UPDATE event
SET event_date = :P5001_EVENT_DATE
WHERE contract_reference = :P330_EVD_CONTRACT
AND event_number = :P330_EVD_EVENT_NUMBER;
:SAVE_STATUS := 'Y';
Thanks in advance, I will have a look when back in the office on Monday.
Cheers PeteHi Chris,
Thanks for your help. I think I've sorted it using your first suggestion doing a refresh in the parent page, I just didn't know how at the time.
What I've got in the parent window after the call to the modal window is the reload window.location.reload(); and in the modal window I close it using window.close(); The down side being the refresh happens if I use my 'Apply changes' or 'Cancel' button but I can live with that for now.
It seems to work in IE and firefox but as I say most of what I'm doing is cobbling together using other peoples code without really understanding exactly what it does. Anyway thanks for your help, sound like I should look into JQUERY when I have time.
Thanks Pete
Parent window call to modal
function modalWin(pshow)
var url;
url='f?p=&APP_ID.:'+pshow+':&SESSION.::::SAVE_STATUS:N';
if (window.showModalDialog) { window.showModalDialog(url,"name","dialogWidth:650px;dialogHeight:700px"); }
else {
window.open(url,"name","height=700,width=650,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
window.location.reload();
Modal Window Close.
window.close(); -
Problem Extending the Dialog component from Flex
I'm trying to extend the flex Dialog component () for usage in Xcelcius, I can package my component successfully and add it to the add-ons in Xcelsius. The problem is that if I try to drag and drop the component to the Xcelsius workspace, the component appears blank and halts the IDE a bit. Does anyone have an idea what I might be doing wrong?
my code is as follows:
package com.component.xcelsius.component
import flash.text.TextFormatAlign;
import mx.containers.TitleWindow;
import mx.controls.Label;
import mx.core.ScrollPolicy;
[CxInspectableList ("title", "showTitle")]
public class ErrorMessageHandler extends TitleWindow
private var _titleChanged:Boolean = true;
private var _valueChanged:Boolean = true;
private var _titleText:String = "My Own";
private var _showTitle:Boolean = true;
private var _visible:Boolean = true;
public function ErrorMessageHandler()
super();
[Inspectable(defaultValue="Title", type="String")]
public override function get title():String
return _titleText;
public override function set title(value:String):void
if (value == null) value = "";
if (_titleText != value)
_titleText = value;
_titleChanged = true;
invalidateProperties();
override protected function createChildren():void
super.createChildren();
// Allow the user to make this component very small.
this.minWidth = 200;
this.minHeight= 25;
// turn off the scroll bars
this.horizontalScrollPolicy = ScrollPolicy.OFF;
this.verticalScrollPolicy = ScrollPolicy.OFF;
override protected function commitProperties():void
super.commitProperties();
if (this._titleChanged)
this.title = _titleText;
this.visible = true;
this.showCloseButton = true;
invalidateDisplayList(); // invalidate in case the titles require more or less room.
_titleChanged = false;
if (this._valueChanged)
// Override updateDisplayList() to update the component
// based on the style setting.
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);Hi,
First of all make sure you compile your Flex project with Flex SDK 2.0.1 Hotfix 3?
In the Add-on Packager carefully check your classname (the full class path + class name) because Xcelsius creates an instance of that class when you drag the add-on onto the canvas, so if it doesn't create anything usually it means your classname is wrong in the packager.
In your case:
com.component.xcelsius.component.ErrorMessageHandler
If none of that works try extending from VBox as the top-level add-on class instead and see if that works (I have never tried with a TitleWindow).
Regards
Matt
Maybe you are looking for
-
Ajuda com Iphone 3GS IOs 5.01
Prezados, Preciso de uma ajuda urgente... Tenho um Iphone 3GS com IOs 5.01 que trava a todo momento e desliga sozinho. Não sei mais o que fazer, poderiam me ajudar? Obrigada Poliana
-
Turned on Mac mini and cannot get rid of the word definition page and get to my home page. What is the problem?
-
Maximum file size of 2 GB exceeded please choose a shorter bounce time
I have done a thorough search online (w/google) trying several combinations of words but I seem to be the only person on the planet with this error. I guess I will try to remake the project but I don't think it will fix the problem. I also will updat
-
Shared Devices Don't Drop After Disconnect
I fixed a double NAT issue by sacrificing my WNDR3700 router and turning it into nothing but an Access Point behind my Westell 9100em FiOS MOCA modem (LAN to LAN). The problem is that now, *shared devices are hanging on the the network after they dis
-
Face time will ring when cover is closed
Face time will not ring on the iPad when the cover is closed. There is no notification of a missed call. Face time works normally when the cover is open.