Home » Developer & Programmer » Forms » Need help for My Tree Node icons and where the icon files are located (Oracle Forms 6i)
Need help for My Tree Node icons and where the icon files are located [message #548245] Wed, 21 March 2012 01:27 Go to next message
rizwanproject
Messages: 3
Registered: March 2012
Location: Pakistan
Junior Member

I need a help about Tree node icons. I created a table named TEMP_USER_MENU and contains the following structure

USER_ID VARCHAR2(15) N
MENU_ID NUMBER(15) N
MENU_DESC VARCHAR2(150) N
FILE_NAME VARCHAR2(100) N
GEN_DET VARCHAR2(1) N
SHOW_IN_MENU NUMBER(1) N 1
PARENT_MENU_ID NUMBER(12) Y
MODULE_TYPE VARCHAR2(2) N
TRN_CODE VARCHAR2(4) Y

Im populating this table with the help of a procedure then fetching data from this query

select -1, level,INITCAP(t.menu_desc),DECODE(T.FILE_NAME, '0' , 'OPEN', 'NEW') NODE_ICON ,t.menu_id
from TEMP_USER_MENU t
start with t.parent_menu_id is null
connect by prior t.menu_id = t.parent_menu_id

Now all i wanted is to change each node icon. This query just make the parent nodes icon to OPEN folder like icon and the leaf node to FILE. You can see the decode query up there. It just chose the icons from the File_Name field when it founds 0 then it shows it's a parent node it makes it icon to OPEN else it make it to NEW.

Fist thing i want to know that from where the form builder is fetching these icons? i.e. from which path and what format it looks like a .png file ? .ico or a .jpeg file. I have searched a lot online but all in vain.

Second thing if i want to add unique icons in my menu tree on each node. Is there any possibility ? if yes. Then where should i keep my icons files and in which format?

Kindly provide any solution to this problem. I shall b very thankful to U.

Regards,

Rizwan.
Re: Need help for My Tree Node icons and where the icon files are located [message #548389 is a reply to message #548245] Wed, 21 March 2012 15:27 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
I think you didn't checked this forum this is common question anyway your form deployed on a web if yes then

Oracle Forms: Jar Icon Images
Oracle web forms uses image files for icons, by default forms will get each image individually, wasting time and bandwidth.

If you add the images to a jar file they are compressed and are loaded at startup, so each form wouldn't need to load the images each time. It also seems like a neater solution.

This code is a windows command script for creating the icon jar file.
The three parameters need to be set for each system.
·	oh = Oracle home
·	id = Icon directory
·	jf = Jar filename
@ECHO OFF


TITLE Jar Icons

SET oh="C:\Oracle\DS10"
SET id="C:\MyApp\icons"
SET jf="C:\MyApp\icons.jar"

CD /D %id%

%oh%\jdk\bin\jar -cvf %jf% *.*

TITLE Jar Icons Complete

PAUSE


You then need to place the jar file on to your web server, so the web server can access them via a URL.
If you placed the jar file in the forms/java directory you wouldn't need a path, however mixing application and forms files isn't best practice.
The URL path to the jar file needs to be added to the archive parameter in forms/server/formsweb.cfg file, so for example:
archive=frmall.jar,myIconPath/icons.jar


or in the archive_jini parameter, if you use JInitiator
archive_jini=frmall_jinit.jar,myIconPath/icons.jar


You also need to set the imagebase parameter

imagebase=codebase


You can then reference the icons by name inside the form and they should then be displayed.



--------------Otherwise--------------------

  DECLARE
         htree ITEM;
         top_node FTREE.NODE ;
         new_node FTREE.NODE ;
         child_node FTREE.NODE ;
         child_node1 FTREE.NODE ;
         item_value VARCHAR2(30);
         --dummy VARCHAR2(30);
                cursor prime_cur is SELECT RE,NAME FROM MANUE WHERE LENGTH (RE) = 2 ;
                 cursor child_cur(T varchar2) is SELECT RE ,NAME FROM MANUE WHERE LENGTH(RE)=4 AND SUBSTR(RE,1,2)=T;
                   cursor child_cur1(t1 varchar2) is SELECT RE,NAME FROM MANUE WHERE LENGTH(RE)=6 AND SUBSTR(RE,1,4)=t1;
     BEGIN
     
         --Find the tree itself.
             htree := Find_Item('tmp.tree4');
            for dummy in prime_cur 
            loop 
                   	  new_node := Ftree.Add_Tree_Node
                   	  (htree,ftree.root_node,
                   	  Ftree.PARENT_OFFSET,
	                    Ftree.LAST_CHILD,
	                    Ftree.EXPANDED_NODE,
	                    dummy.name,
	                    'c:\ICONS\a',
	                    dummy.RE);
          	
           for child in child_cur(dummy.RE) loop 
		                child_node := Ftree.Add_Tree_Node
		                (htree,new_node,
		                Ftree.PARENT_OFFSET,
		                Ftree.LAST_CHILD,
		                Ftree.EXPANDED_NODE,
		                child.name,
		                'f:\ICONS\GO',child.RE);
        		for child1 in child_cur1(child.RE) loop
        			
   	              child_node1 := 
                                      Ftree.Add_Tree_Node
			              (htree,CHILD_NODE,
			              Ftree.PARENT_OFFSET,
			              Ftree.LAST_CHILD,
			              Ftree.EXPANDED_NODE,
               			      child1.name,
                                     'f:\ICONS\GO',
                                      child1.RE);
                    
               	end loop;
                    	end loop;
            end loop;
            exception when others then 
           message(sqlerrm(sqlcode));
      END;



Hope everything is cleared


[EDITED by LF: removed superfluous empty lines]

[Updated on: Thu, 22 March 2012 01:13] by Moderator

Report message to a moderator

Re: Need help for My Tree Node icons and where the icon files are located [message #548402 is a reply to message #548389] Thu, 22 March 2012 00:00 Go to previous messageGo to next message
rizwanproject
Messages: 3
Registered: March 2012
Location: Pakistan
Junior Member

Dear Awais,

Thanks for your reply, but im not working on web forms. I'm just developing an application in Oracle runtime. it's just a form of menu which contains Tree like structure. Can you guide me how can I add icons of my own in oracle runtime application or it is the same as you mentioned above for web forms.

Thanks.

Rizwan.
Re: Need help for My Tree Node icons and where the icon files are located [message #548450 is a reply to message #548402] Thu, 22 March 2012 05:34 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
I think you did not read my post properly just see above full of structer of tree menu you can create with icons. Just make one table insert some data as per given detail in above code copy this code in when-new-form-instance ok i give u table structure


create table manue(re varchar2(9),
                  (name varchar2(25),
                  (manue_name varchar2(25))
/ 


------otherwise post------------above-------------

hope u got it this time



Thanks

[Updated on: Thu, 22 March 2012 05:35]

Report message to a moderator

Re: Need help for My Tree Node icons and where the icon files are located [message #574574 is a reply to message #548450] Sun, 13 January 2013 05:38 Go to previous message
rizwanproject
Messages: 3
Registered: March 2012
Location: Pakistan
Junior Member

Thank you very much Awais.

Regards,
Rizwan Aslam
Previous Topic: Dynamic list from one table and insert into another
Next Topic: sequence in form
Goto Forum:
  


Current Time: Thu Aug 28 02:52:31 CDT 2014

Total time taken to generate the page: 0.11393 seconds