Hierarchical tree

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Post Reply
NiNo
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 62
Joined: Mon, 11 Jul 2005 2:03 pm
Location: são Paulo
NiNo
Developer

Hello to all,

I'm back with a problem I solved about 3 years, but I lost the source, but let's go ...
I have a self-related table, I did a query using the "Start with" with "Connect BY Prior", works perfectly on SQL +. So far so good, but I created a new forms with a "non base table" block and, in this block, I created a "hierarchical tree"; In the "Data Query" property I put the query I created, I compiled the forms and does not appear anything in the "hierarchical tree", I have tried to create a "Record Group", with the same query and the result was the same. There is an example for popular "Hierarchical Tree", but in the company where I work, I can not download it. I need help finding where I am "sinning", being that, I can not download anything.
Thank you all who help me.

Thanks!
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

In this link has an example: http://en.glufke.net/oracle/download/Forms_Tree.zip
Since you can not download, do you have any email there that I can send you this file?

: -O
NiNo
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 62
Joined: Mon, 11 Jul 2005 2:03 pm
Location: são Paulo
NiNo
Developer

Yes, almir.jg @ ********
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

OK, sent ...

I edited your email and put *** for your email not to be visible to spammers !!! :-O
NiNo
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 62
Joined: Mon, 11 Jul 2005 2:03 pm
Location: são Paulo
NiNo
Developer

cara, I received your email, I looked at the example, I thought it was perfect. Exemplifies as well as popular to the window node, not to mention other controls.
But what I'm needing now is just for a prototype, so I want to use the component in its simplest form, that is, create the object in a canvas and popular it through Record_Group or Query, using the " Connect By Prior "at Query. From what I remember, there is a simple way to do this, this way I am having some difficulty.
valeu
tomgmf
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 17
Joined: Mon, 10 Apr 2006 5:00 pm
Location: Guarujá - SP

Good morning

I tried to run this test file, but gave the following error below:

Select all

FRM-30162: Inconsistent relationship between window NAVIGATOR and its vertical toolbar . 
Window NAVIGATOR
has how to help me please !!!!

Thanks
tomgmf
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 17
Joined: Mon, 10 Apr 2006 5:00 pm
Location: Guarujá - SP

Hi guys, it worked, yes, now I'm trying to introduce the code to exist another knot ... but I can not get it, if someone can help me I'd really appreciate it !!!

Even more ... I am waiting,


Cleiton_Ramos
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Thu, 01 Jun 2006 8:22 pm
Location: são paulo

Create this package in the forms (Speaking)

Select all

PACKAGE PKG_TREE IS 
 
RG_AREA      RECORDGROUP; -- NOME DO RECORD GROUP QUE SERÁ CRIADO 
RG_NAME      VARCHAR2(30) := 'TREE_RG'; 
V_STATE      GROUPCOLUMN;  
V_LEVEL      GROUPCOLUMN; 
V_LABEL      GROUPCOLUMN; 
V_ICON       GROUPCOLUMN; 
V_VALUE      GROUPCOLUMN; 
TREE_ID      ITEM := FIND_ITEM('MENU.DS_MENU'); 
 
------------------------------------ 
--- Rotina que Inicia o Processo --- 
------------------------------------ 
  PROCEDURE  START_TREE; 
   
----------------------------------------------------------- 
--- Rotina que Lê os dados para serem adicionados no RG --- 
----------------------------------------------------------- 
  FUNCTION LOAD_TREE RETURN BOOLEAN; 
   
----------------------------------------- 
--- Rotina que Define o RG (estrutura) -- 
----------------------------------------- 
  PROCEDURE DEFINE_RG; 
   
------------------------------------------------- 
--- Rotina que Adiciona dados no Record Group --- 
------------------------------------------------- 
  PROCEDURE ADD_NODE (NODENUM   IN NUMBER,   -- NUMERO DA LINHA 
                      NODESTATE IN NUMBER,    
                      NODELEVEL IN NUMBER,    
                      NODELABEL IN VARCHAR2, 
                      NODEICON  IN VARCHAR2, 
                      NODEVALUE IN VARCHAR2); 
END; 
 
Criar o corpo da package : 
PACKAGE BODY PKG_TREE IS 
------------------------------------ 
--- Rotina que Inicia o Processo --- 
------------------------------------ 
  PROCEDURE START_TREE IS 
   BEGIN 
   	-- SE O RECORD GROUP FOI CARREGADO, ATRIBUI O RG AO ITEM DS_MENU 
   	IF (PKG_TREE.LOAD_TREE) THEN 
    	FTREE.SET_TREE_PROPERTY(TREE_ID,FTREE.RECORD_GROUP,RG_AREA); 
    END IF;	 
   	 
   END; 
----------------------------------------- 
--- Rotina que Define o RG (estrutura) -- 
----------------------------------------- 
  PROCEDURE DEFINE_RG IS 
   BEGIN 
    RG_AREA := FIND_GROUP(RG_NAME); 
    -- CRIA O GROUP -- 
    RG_AREA := CREATE_GROUP (RG_NAME); 
    
    -- MONTA A ESTRUTURA DO RECORD GROUP -- 
    V_STATE      := ADD_GROUP_COLUMN(RG_AREA,'INIT_STATE',NUMBER_COLUMN) ;   
    V_LEVEL      := ADD_GROUP_COLUMN(RG_AREA,'V_LEVEL'   ,NUMBER_COLUMN) ;  
    V_LABEL      := ADD_GROUP_COLUMN(RG_AREA,'LABEL'     ,CHAR_COLUMN,90) ; 
    V_ICON       := ADD_GROUP_COLUMN(RG_AREA,'ICON'      ,CHAR_COLUMN,50) ; 
    V_VALUE      := ADD_GROUP_COLUMN(RG_AREA,'VALUE'     ,CHAR_COLUMN,15) ;  
  END; 
 
------------------------------------------------- 
--- Rotina que Adiciona dados no Record Group --- 
------------------------------------------------- 
  PROCEDURE ADD_NODE (NODENUM   IN NUMBER,   -- NUMERO DA LINHA 
                      NODESTATE IN NUMBER,    
                      NODELEVEL IN NUMBER,    
                      NODELABEL IN VARCHAR2, 
                      NODEICON  IN VARCHAR2, 
                      NODEVALUE IN VARCHAR2) 
   IS 
    BEGIN 
      ADD_GROUP_ROW        (PKG_TREE.RG_AREA,NODENUM);	 
      SET_GROUP_NUMBER_CELL(V_STATE         ,NODENUM,NODESTATE); -- (1 MENU EXPANDIDO) (-1 MENU NÃO EXPANDIDO)   
 	    SET_GROUP_NUMBER_CELL(V_LEVEL         ,NODENUM,NODELEVEL); 
 	    SET_GROUP_CHAR_CELL  (V_LABEL         ,NODENUM,NODELABEL); 
 	    SET_GROUP_CHAR_CELL  (V_ICON          ,NODENUM,NODEICON ); 
 	    SET_GROUP_CHAR_CELL  (V_VALUE         ,NODENUM,NODEVALUE);	  
    END;                    
 
----------------------------------------------------------- 
--- Rotina que Lê os dados para serem adicionados no RG --- 
----------------------------------------------------------- 
  FUNCTION LOAD_TREE RETURN BOOLEAN IS 
  -- SELECT QUE DEFINE A HIERARQUIA A SER CONSTRUIDA -- 
  CURSOR C_MENU IS 
   SELECT LEVEL,  
          CD_MENU,  
          initcap(DS_MENU)DS_MENU 
     FROM MENUS 
  CONNECT BY PRIOR CD_MENU = ITEM_CD_MENU 
  START WITH ITEM_CD_MENU IS NULL; 
  
  
 V_LINHA     INTEGER; 
 V_CONTA_REG INTEGER; 
  
 BEGIN 
 	 -- MONTA A ESTRUTURA DO RECORD GROUP --   
   PKG_TREE.DEFINE_RG; 
    
   V_LINHA     := 1; 
   V_CONTA_REG := 0; 
    
   FOR C_REG IN C_MENU LOOP 
   	 -- ADICIONA UMA LINHA NO RECORD GROUP -- 
   	 PKG_TREE.ADD_NODE(V_LINHA,-1,C_REG.LEVEL,C_REG.DS_MENU,NULL,NULL);  
  	 -- SOMA 1 LINHA 
  	 V_LINHA := V_LINHA  + 1; 
  	 V_CONTA_REG := 1; 
  END LOOP; 
   
  -- RETORNA 'True' SE O CURSOR RETORNOU REGISTROS E CARREGOU O RECORD GROUP -- 
  IF (V_CONTA_REG = 1) THEN 
  	RETURN(TRUE); 
  ELSE 
  	RETURN(FALSE); 
  END IF; 
 END ;  
END pkg_tree;
Create a canvas with a block (Menu) and a Hierarchical Tree item with the name DS_MENU


In the form instance, place the call to Start_Tree.

I hope I have helped.
User avatar
TBou
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 136
Joined: Thu, 05 Aug 2004 9:33 am
Location: Campo Grande - MS
Thiago Bourscheidt
thiago.info@apoiorural.com.br
Analista de Sistemas

I believe that what you want is this:
I have a contact plan that I use this mounting form for the tree. See example:

Select all

 
RG_EMPS := Create_Group_From_Query('rg_emps', 
           ' SELECT -1, LEVEL, CD_CONTACONTABIL||'' - ''||NM_CONTACONTABIL, ''PROXIMO'', CD_CONTACONTABIL  
               FROM PLANOCONTABIL 
            CONNECT BY PRIOR CD_CONTACONTABIL = CD_CTACTBMAE 
              START WITH CD_CTACTBMAE IS NULL 
              ORDER BY CD_CLASSIFCONTABIL'); 
v_ignore := Populate_Group(rg_emps); 
    
Ftree.Set_Tree_Property('CONSULTAPLANO.ARVORE', Ftree.RECORD_GROUP, rg_emps); 

Vejan Some record group

Select all

 
-1         LEVEL      CD_CONTACONTABIL||'-'||NM_CONTACONTABIL                                          'PROXIM CD_CONTACO 
---------- ---------- -------------------------------------------------------------------------------- ------- ---------- 
        -1          1 100009 - ATIVO                                                                   PROXIMO     100009 
        -1          2 110000 - CIRCULANTE                                                              PROXIMO     110000 
        -1          3 110015 - DISPONIBILIDADES                                                        PROXIMO     110015 
        -1          4 110020 - DISPONIBILIDADES                                                        PROXIMO     110020 
        -1          5 110034 - CAIXA GERAL                                                             PROXIMO     110034 
        -1          6 110049 - CAIXA                                                                   PROXIMO     110049 
        -1          6 111164 - CAIXA-SEMEADOR                                                          PROXIMO     111164 
        -1          6 110825 - TRANSACOES FINANCEIRAS - MATRIZ/FILIAIS                                 PROXIMO     110825 
        -1          6 110051 - TESOURARIA                                                              PROXIMO     110051 
        -1          5 110053 - BANCOS C/ MOVIMENTO                                                     PROXIMO     110053 
        -1          6 110119 - BANCO BOA VISTA S/A                                                     PROXIMO     110119 
        -1          6 110072 - BANCO BRADESCO S/A                                                      PROXIMO     110072 
 
User avatar
TBou
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 136
Joined: Thu, 05 Aug 2004 9:33 am
Location: Campo Grande - MS
Thiago Bourscheidt
thiago.info@apoiorural.com.br
Analista de Sistemas

IXXX .... Let me take the waits a little

Select all

 
-1         LEVEL      CD_CONTACONTABIL||'-'||NM_CONTACONTABIL  'PROXIM CD_CONTACO 
---------- ---------- ---------------------------------------- ------- ---------- 
        -1          1 100009 - ATIVO                           PROXIMO     100009 
        -1          2 110000 - CIRCULANTE                      PROXIMO     110000 
        -1          3 110015 - DISPONIBILIDADES                PROXIMO     110015 
        -1          4 110020 - DISPONIBILIDADES                PROXIMO     110020 
        -1          5 110034 - CAIXA GERAL                     PROXIMO     110034 
        -1          6 110049 - CAIXA                           PROXIMO     110049 
        -1          6 111164 - CAIXA-SEMEADOR                  PROXIMO     111164 
        -1          6 110825 - TRANSACOES FINANCEIRAS - MATRIZ PROXIMO     110825 
        -1          6 110051 - TESOURARIA                      PROXIMO     110051 
        -1          5 110053 - BANCOS C/ MOVIMENTO             PROXIMO     110053 
        -1          6 110119 - BANCO BOA VISTA S/A             PROXIMO     110119 
        -1          6 110072 - BANCO BRADESCO S/A              PROXIMO     110072 
User avatar
Toad
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 253
Joined: Fri, 18 Nov 2005 2:14 pm
Location: Seattle, WA
Contact:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c

I have the following problem:

I need to get the value of one of the lines of the trees, so it is selected to pick up the value and use as the WHERE condition of another block.

I am using the following code, in the trigger when-tree-node-selected:


only that he always brings the value of the first and main line.

Thus:

Select all

 
 
135 
...132 
...133 
...134 
.....135 
.....135 
.....137 
...138 

and independent of which line I click, he always selects 135.

What am I doing wrong ??

Thanks!
User avatar
Toad
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 253
Joined: Fri, 18 Nov 2005 2:14 pm
Location: Seattle, WA
Contact:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c

Personal, I solved the problem by changing the way the Tree sought the data. I changed RecordGroup to Data Query Text.
: D
User avatar
Toad
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 253
Joined: Fri, 18 Nov 2005 2:14 pm
Location: Seattle, WA
Contact:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c

Ah clear, the code used for this:

Select all

 
 
PROCEDURE refresh_trees IS 
 
   V_ID_MASTER number := :GLOBAL.V_CLI; 
    
   v_query varchar2(4000); 
   
 
begin 
	 SET_APPLICATION_PROPERTY(CURSOR_STYLE,'BUSY'); 
	 message('Carregando Rede de Clientes...'); 
   -- 
   IF (GET_APPLICATION_PROPERTY(USER_INTERFACE) = 'WEB' ) THEN 
   	 
   	   v_query := 'select DECODE(LEVEL, 1,1, 
                     					      2,1, 
                     					      3,1, 
                     						    -1 ) state, level lvl,  
                  (id_cli||'' - ''||nm_cli) displ_val, null icn, id_cli val 
                  from cliente 
                  connect by prior id_cli = id_cli_pai 
                  start with id_cli = '||V_ID_MASTER;   	   
   ELSE 
   	   v_query := 'select 1 state, level lvl, (id_cli||'' - ''||nm_cli) displ_val, null icn, id_cli val 
                  from cliente 
                  connect by prior id_cli = id_cli_pai 
                  start with id_cli = '||V_ID_MASTER; 
   END IF;                
                
    ftree.set_tree_property('navigator.nav_display', ftree.QUERY_TEXT, v_query); 
    SET_APPLICATION_PROPERTY(CURSOR_STYLE,'DEFAULT'); 
end; 
 
User avatar
Toad
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 253
Joined: Fri, 18 Nov 2005 2:14 pm
Location: Seattle, WA
Contact:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c

Person, to trying to implement a progress bar that grows according to the filling of the tree.

Is there any trigger that is activated when a node is added to the tree?

The idea was to count the total of us added until then, and go making the bar grow up to 100% (total of us expected in the Tree, previously calculated).

Does anyone know any way to go running this process at the same time as the tree is filled?

:?::
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

Topic under translation. Come back later. (This is an automatic message)
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Topic under translation. Come back later. (This is an automatic message)
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest