@ -12,12 +12,13 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "subcategoria" ,
"nome" : "subcategoria" ,
"sequence" : "subcategoria_seq" ,
"sequence" : "subcategoria_seq" ,
"idTabela" : "CODIGO",
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "DESCRICAO" ],
"camposTable" : ["CODIGO", "DESCRICAO" ]
"campos" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ],
"camposTable" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ]
},
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["DESCRICAO","idDescricao","String"]
["DESCRICAO","idDescricao","String"] ,
["CODIGO_CATEGORIA","idCategoria","Number"]
] ,
] ,
"validacaoExclusao" : [ ["SELECT 0 AS CONTAR FROM CATEGORIA WHERE CODIGO = ", "Existem registros ligados a esta tabela"],
"validacaoExclusao" : [ ["SELECT 0 AS CONTAR FROM CATEGORIA WHERE CODIGO = ", "Existem registros ligados a esta tabela"],
["SELECT count(chave_subcategoria) AS CONTAR FROM CONTROLE_DESPESAS_OPERACIONAIS WHERE CHAVE_SUBCATEGORIA = ", "Existem registros ligados a esta tabela"]
["SELECT count(chave_subcategoria) AS CONTAR FROM CONTROLE_DESPESAS_OPERACIONAIS WHERE CHAVE_SUBCATEGORIA = ", "Existem registros ligados a esta tabela"]
@ -60,6 +61,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
var config = engine.getGlobalVariable('config');
var config = engine.getGlobalVariable('config');
var lib = libService.loadScript('lib_cadastro_padrao');
var lib = libService.loadScript('lib_cadastro_padrao');
var retorno = lib.fncLimpaCampos(config);
var retorno = lib.fncLimpaCampos(config);
engine.getField('idCategoria')['setValue(java.lang.Object)'](null);
};
};
var habilitaCampos = function(lHabilita){
var habilitaCampos = function(lHabilita){
@ -97,7 +99,11 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
habilitaCampos(true);
habilitaCampos(true);
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idCategoria')['setValue(java.lang.Object)'](null);
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
engine.getField('idChave').focus();
@ -209,11 +215,12 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "subcategoria" ,
"nome" : "subcategoria" ,
"sequence" : "subcategoria_seq" ,
"sequence" : "subcategoria_seq" ,
"idTabela" : "CODIGO",
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "DESCRICAO" ],
"camposTable" : ["CODIGO", "DESCRICAO" ]
"campos" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ],
"camposTable" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ]
},
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["DESCRICAO","idDescricao","String"]
["DESCRICAO","idDescricao","String"],
["CODIGO_CATEGORIA","idCategoria","Number"]
] ,
] ,
"validacaoExclusao" :
"validacaoExclusao" :
@ -325,6 +332,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<column name= "CODIGO" caption= "Código" />
<column name= "CODIGO" caption= "Código" />
<column name= "DESCRICAO" caption= "Descrição" />
<column name= "DESCRICAO" caption= "Descrição" />
</columns>
</columns>
</DBTable>
</DBTable>
</VerticalLayout>
</VerticalLayout>
@ -377,6 +385,17 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<HorizontalLayout width= "100%" spacing= "true" >
<HorizontalLayout width= "100%" spacing= "true" >
<TextField id= "idChave" type= "string" caption= "Código" width= "100%" expandRatio= "0.08" />
<TextField id= "idChave" type= "string" caption= "Código" width= "100%" expandRatio= "0.08" />
<TextField id= "idDescricao" text-transform= "uppercase" type= "string" caption= "Nome" required= "true" width= "100%" expandRatio= "1" />
<TextField id= "idDescricao" text-transform= "uppercase" type= "string" caption= "Nome" required= "true" width= "100%" expandRatio= "1" />
<DBComboBox type= "number" required= "true" id= "idCategoria" allowNullSelection= "true" caption= "Categoria" description= "Selecione a categoria que será vinculada" width= "100%" expandRatio= "0.4" >
<datasource >
<freeQuery connection-key= "vitruvio" >
< ![CDATA[
Select c.codigo, c.descricao from categoria c
]]>
</freeQuery>
</datasource>
<key-field > CODIGO</key-field>
<caption-field > DESCRICAO</caption-field>
</DBComboBox>
</HorizontalLayout>
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</Tab>
</Tab>