refactor: update sequences in cadastro_jogos desktop XML
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
tabela:
|
tabela:
|
||||||
{
|
{
|
||||||
conexao : 'vitruvio',
|
conexao : 'vitruvio',
|
||||||
nome : '',
|
nome : 'TB_MATHEUS_MEDEIROS_JOGOS',
|
||||||
sequence : '',
|
sequence : 'TB_MATHEUS_MEDEIROS_JOGOS_SEQ',
|
||||||
idTabela : 'CODIGO',
|
idTabela : 'CODIGO',
|
||||||
campos: [
|
campos: [
|
||||||
'CODIGO',
|
'CODIGO',
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
var config_avaliacoes = {
|
var config_avaliacoes = {
|
||||||
tabela: {
|
tabela: {
|
||||||
conexao : 'vitruvio',
|
conexao : 'vitruvio',
|
||||||
nome : '',
|
nome : 'TB_MATHEUS_MEDEIROS_AVALIACOES',
|
||||||
sequence : '',
|
sequence : 'TB_MATHEUS_MEDEIROS_AVALIACOES_SEQ',
|
||||||
idTabela : 'CODIGO',
|
idTabela : 'CODIGO',
|
||||||
campos: [
|
campos: [
|
||||||
'CODIGO',
|
'CODIGO',
|
||||||
@@ -172,8 +172,183 @@
|
|||||||
|
|
||||||
</initScript>
|
</initScript>
|
||||||
<components>
|
<components>
|
||||||
<VerticalLayout width="100%" height="100%" >
|
<VerticalLayout width="100%" height="100%" align="MIDDLE_RIGHT">
|
||||||
<CrudPanel width="100%" height="100%" visible="true">
|
|
||||||
|
<WindowLayout id="wltCriarAvaliacoes" windowModal="true" windowHeight="70%"
|
||||||
|
windowWidth="80%" windowTitle="Nova avaliação">
|
||||||
|
<VerticalLayout width="100%" height="100%" spacing="true" margin="true">
|
||||||
|
<TextField width="100%" id="txfCodigoAvaliacao" type="number"
|
||||||
|
caption="Código"
|
||||||
|
required="false" enabled="false" visible="false" />
|
||||||
|
<DateField caption="Data da avaliação"
|
||||||
|
required="false" enabled="false" width="100%" visible="false"
|
||||||
|
id="dtfDataAvaliacao" format="dd/MM/yyyy"
|
||||||
|
type="date" />
|
||||||
|
<TextField width="100%" id="txfCodigoJogo" type="number"
|
||||||
|
caption="Código do jogo"
|
||||||
|
required="true" enabled="false" visible="false" />
|
||||||
|
<TextField width="100%" id="txfNome" type="string" caption="Nome"
|
||||||
|
required="true" />
|
||||||
|
<TextField width="100%" id="txfEmail" type="email" caption="E-mail"
|
||||||
|
required="true" />
|
||||||
|
<TextField width="100%" id="txfComentario" type="string"
|
||||||
|
caption="Comentário" required="true" />
|
||||||
|
<DecimalField width="100%" id="dcfNota" type="decimal"
|
||||||
|
caption="Nota (0 a 10)"
|
||||||
|
required="true" />
|
||||||
|
<ButtonWidget id="btnSalvarAvaliacao" caption="Salvar" defaultIcon="SAVE"
|
||||||
|
style="BLUE">
|
||||||
|
<onClickScript language="JavaScript">
|
||||||
|
<![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getGlobalVariable("organizeRequiredFields")("avaliacoes", false);
|
||||||
|
engine.getField("txfCodigoJogo").setValue(engine.getField("dbtJogos").getValue());
|
||||||
|
|
||||||
|
var hoje = new Date();
|
||||||
|
var javaDate = new java.util.Date(hoje.getTime());
|
||||||
|
engine.getField("dtfDataAvaliacao").setValue(javaDate);
|
||||||
|
|
||||||
|
if(engine.isValid()){
|
||||||
|
|
||||||
|
engine.getField("txfCodigoJogo").setValue(engine.getField("dbtJogos").getValue());
|
||||||
|
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
||||||
|
var lib = libService.loadScript("lib_cadastro_padrao");
|
||||||
|
var id = engine.getField("txfCodigoAvaliacao").getValue();
|
||||||
|
var retorno = lib.fncGravarRegistro(config_avaliacoes, id);
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
|
||||||
|
if (retorno) {
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
|
engine.getField("txfCodigoAvaliacao").setValue(retorno);
|
||||||
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
|
lib_msg.showNotification({
|
||||||
|
type: lib_msg.notificationType.tray,
|
||||||
|
caption: "Sucesso!",
|
||||||
|
msg: "Avaliação foi salva com sucesso!",
|
||||||
|
position: lib_msg.notificationPosition.bottom_right,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
engine.getLayout("wltCriarAvaliacoes").closeWindow();
|
||||||
|
engine.getLayout("wltListaAvaliacoes").showWindow();
|
||||||
|
engine.getGlobalVariable("organizeRequiredFields")("avaliacoes", true);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</onClickScript>
|
||||||
|
</ButtonWidget>
|
||||||
|
</VerticalLayout>
|
||||||
|
</WindowLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<WindowLayout id="wltListaAvaliacoes" windowModal="true" windowHeight="80%"
|
||||||
|
windowWidth="80%">
|
||||||
|
<VerticalLayout spacing="true" margin="true" height="100%">
|
||||||
|
<Label id="lblTitle"><value>Avaliações</value></Label>
|
||||||
|
<DBTable id="dbtAvaliacoes" type="string" width="100%"
|
||||||
|
gridSelectable="true" selectable="false" height="100%"
|
||||||
|
expandRatio="0.2" showRowCount="true">
|
||||||
|
<datasource>
|
||||||
|
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
|
||||||
|
<![CDATA[
|
||||||
|
function buildSQL(_){
|
||||||
|
var sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES ORDER BY CODIGO";
|
||||||
|
var id_jogo = engine.getField("dbtJogos").getValue();
|
||||||
|
if(id_jogo != null){
|
||||||
|
sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES WHERE ID_JOGO = " + id_jogo + " ORDER BY CODIGO";
|
||||||
|
}
|
||||||
|
return sqlBase;
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</sqlBuilderDataSource>
|
||||||
|
</datasource>
|
||||||
|
<key-field>CODIGO</key-field>
|
||||||
|
<columns>
|
||||||
|
<column name="CODIGO" caption="ID" />
|
||||||
|
<column name="NOME" caption="NOME" />
|
||||||
|
<column name="EMAIL" caption="E-MAIL" />
|
||||||
|
<column name="COMENTARIO" caption="COMENTÁRIO" />
|
||||||
|
<column name="NOTA" caption="NOTA" />
|
||||||
|
<column name="DATA_AVALIACAO" caption="DATA DE AVALIAÇÃO" />
|
||||||
|
<generated name="EDITAR" caption="EDITAR" align="CENTER">
|
||||||
|
<scriptColumnGenerator language="JavaScript">
|
||||||
|
<![CDATA[
|
||||||
|
function Generator() {
|
||||||
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
|
var btn = comp.buttonIcon("Editar", function () {
|
||||||
|
engine.getField("txfCodigoAvaliacao").setValue(itemId);
|
||||||
|
if (itemId != null) {
|
||||||
|
engine.getLayout("wltCriarAvaliacoes").showWindow();
|
||||||
|
engine.getLayout("wltListaAvaliacoes").closeWindow();
|
||||||
|
var config_avaliacoes = engine.getGlobalVariable('config_avaliacoes');
|
||||||
|
var lib = libService.loadScript('lib_cadastro_padrao');
|
||||||
|
lib.fncCarregarCampos(config_avaliacoes, itemId);
|
||||||
|
}
|
||||||
|
}, "pencil");
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
|
]]>
|
||||||
|
</scriptColumnGenerator>
|
||||||
|
</generated>
|
||||||
|
<generated name="EXCLUIR" caption="EXCLUIR" align="CENTER">
|
||||||
|
<scriptColumnGenerator language="JavaScript">
|
||||||
|
<![CDATA[
|
||||||
|
function Generator() {
|
||||||
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
|
var btn = comp.buttonIcon("Excluir", function () {
|
||||||
|
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
||||||
|
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
||||||
|
var registro = itemId + " - " + item.getItemProperty("NOME");
|
||||||
|
var msg = "Tem certeza de que deseja excluir o comentário " + registro + "?";
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
|
lib_msg.confirmationBox({
|
||||||
|
icon: lib_msg.confirmationIcon.question,
|
||||||
|
caption: "Confirmar operação",
|
||||||
|
msg: msg,
|
||||||
|
actions: lib_msg.confirmationControls.yes_no
|
||||||
|
}, function(action) {
|
||||||
|
if(action.yes()) {
|
||||||
|
lib.fncDeletarRegistro(config_avaliacoes, itemId);
|
||||||
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, "trash");
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
|
]]>
|
||||||
|
</scriptColumnGenerator>
|
||||||
|
</generated>
|
||||||
|
</columns>
|
||||||
|
</DBTable>
|
||||||
|
<HorizontalLayout spacing="true" align="MIDDLE_RIGHT">
|
||||||
|
<ButtonWidget id="btnVoltarAvaliacoes" style="BLACK" caption="Voltar" defaultIcon="BACK">
|
||||||
|
<onClickScript language="JavaScript"><![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getLayout("wltListaAvaliacoes").closeWindow();
|
||||||
|
}
|
||||||
|
]]></onClickScript>
|
||||||
|
</ButtonWidget>
|
||||||
|
<ButtonWidget id="btnAdicionarAvaliacoes" style="GREEN" caption="Nova Avaliação" defaultIcon="ADD">
|
||||||
|
<onClickScript language="JavaScript"><![CDATA[
|
||||||
|
function run (){
|
||||||
|
engine.getGlobalVariable("resetPanelReviews")();
|
||||||
|
engine.getLayout("wltCriarAvaliacoes").showWindow();
|
||||||
|
engine.getLayout("wltListaAvaliacoes").closeWindow();
|
||||||
|
}
|
||||||
|
]]></onClickScript>
|
||||||
|
</ButtonWidget>
|
||||||
|
</HorizontalLayout>
|
||||||
|
</VerticalLayout>
|
||||||
|
</WindowLayout>
|
||||||
|
|
||||||
|
<CrudPanel id="pnlListaJogos" width="100%" height="100%" visible="true">
|
||||||
<Header>
|
<Header>
|
||||||
<Caption></Caption>
|
<Caption></Caption>
|
||||||
<SubCaption>Cadastro de jogos</SubCaption>
|
<SubCaption>Cadastro de jogos</SubCaption>
|
||||||
@@ -181,12 +356,14 @@
|
|||||||
<Section height="100%" width="100%" caption="Jogos" subCaption="Veja todos os jogos" id = "secJogos">
|
<Section height="100%" width="100%" caption="Jogos" subCaption="Veja todos os jogos" id = "secJogos">
|
||||||
<VerticalLayout height="100%" width="100%" align="MIDDLE_CENTER" spacing="true">
|
<VerticalLayout height="100%" width="100%" align="MIDDLE_CENTER" spacing="true">
|
||||||
<HorizontalLayout width="100%" spacing="true">
|
<HorizontalLayout width="100%" spacing="true">
|
||||||
<TextField id="txfPesquisaJogo" expandRatio="0.8" width="100%" caption="Pesquisar jogo" type="string" immediate="true">
|
<TextField id="txfPesquisa" expandRatio="0.8" width="100%" caption="Pesquisar jogo" type="string" immediate="true">
|
||||||
<events>
|
<events>
|
||||||
<valueChange>
|
<valueChange>
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
}
|
||||||
]]>
|
]]>
|
||||||
</script>
|
</script>
|
||||||
</valueChange>
|
</valueChange>
|
||||||
@@ -194,14 +371,34 @@
|
|||||||
</TextField>
|
</TextField>
|
||||||
<ButtonWidget id="btnPesquisar" caption="Pesquisar" defaultIcon="SEARCH" style="BLACK">
|
<ButtonWidget id="btnPesquisar" caption="Pesquisar" defaultIcon="SEARCH" style="BLACK">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
<DBTable id="dbtJogos" align="MIDDLE_CENTER" width="100%" height="100%" type="string" expandRatio="0.5" showRowCount="true" drawRefreshButton="true" gridSelectable="true" >
|
<DBTable id="dbtJogos" align="MIDDLE_CENTER" width="100%" height="100%" type="string" expandRatio="0.5" showRowCount="true" drawRefreshButton="true" gridSelectable="true" >
|
||||||
<datasource>
|
<datasource>
|
||||||
<sqlBuilderDataSource connection-key="" language="JavaScript">
|
<sqlBuilderDataSource connection-key="" language="JavaScript">
|
||||||
|
<![CDATA[
|
||||||
|
function buildSQL(_){
|
||||||
|
var txfPesquisa = engine.getField("txfPesquisa").getValue();
|
||||||
|
|
||||||
|
var sqlBase = "SELECT J.CODIGO, J.TITULO, J.GENERO, J.ANO_LANCAMENTO, J.PRODUTORA, COALESCE(ROUND(AVG(A.NOTA), 2), 0) AS NOTA_MEDIA, J.DESCRICAO FROM TB_MATHEUS_MEDEIROS_JOGOS J LEFT JOIN TB_MATHEUS_MEDEIROS_AVALIACOES A ON J.CODIGO = A.ID_JOGO";
|
||||||
|
|
||||||
|
if (txfPesquisa) {
|
||||||
|
sqlBase += " WHERE UPPER(J.TITULO) LIKE UPPER('%" + txfPesquisa + "%')";
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlBase += " GROUP BY J.CODIGO, J.TITULO, J.GENERO, J.ANO_LANCAMENTO, J.PRODUTORA, J.DESCRICAO";
|
||||||
|
sqlBase += " ORDER BY J.CODIGO";
|
||||||
|
|
||||||
|
return sqlBase;
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</sqlBuilderDataSource>
|
</sqlBuilderDataSource>
|
||||||
</datasource>
|
</datasource>
|
||||||
<key-field>
|
<key-field>
|
||||||
@@ -217,17 +414,81 @@
|
|||||||
<column name="DESCRICAO" caption="DESCRIÇÃO" />
|
<column name="DESCRICAO" caption="DESCRIÇÃO" />
|
||||||
<generated name="AVALIACOES" caption="AVALIAÇÕES" align="CENTER">
|
<generated name="AVALIACOES" caption="AVALIAÇÕES" align="CENTER">
|
||||||
<scriptColumnGenerator language="JavaScript">
|
<scriptColumnGenerator language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function Generator() {
|
||||||
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
|
var btn = comp.buttonIcon("Avaliações", function () {
|
||||||
|
engine.getField("dbtJogos").setValue(itemId);
|
||||||
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
|
engine.getGlobalVariable("showTableReviews")(itemId);
|
||||||
|
}, "star");
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
|
]]>
|
||||||
</scriptColumnGenerator>
|
</scriptColumnGenerator>
|
||||||
</generated>
|
</generated>
|
||||||
<generated name="EDITAR" caption="EDITAR" align="CENTER">
|
<generated name="EDITAR" caption="EDITAR" align="CENTER">
|
||||||
<scriptColumnGenerator language="JavaScript">
|
<scriptColumnGenerator language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function Generator() {
|
||||||
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
|
var btn = comp.buttonIcon("Editar", function () {
|
||||||
|
var id = itemId;
|
||||||
|
engine.getField("txfCodigo").setValue(id);
|
||||||
|
if (id != null) {
|
||||||
|
engine.getGlobalVariable("changeCrudPanel")("cadastroJogo");
|
||||||
|
var config_jogos = engine.getGlobalVariable('config_jogos');
|
||||||
|
var lib = libService.loadScript('lib_cadastro_padrao');
|
||||||
|
lib.fncCarregarCampos(config_jogos, id);
|
||||||
|
}
|
||||||
|
}, "pencil");
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
|
]]>
|
||||||
</scriptColumnGenerator>
|
</scriptColumnGenerator>
|
||||||
</generated>
|
</generated>
|
||||||
<generated name="EXCLUIR" caption="EXCLUIR" align="CENTER">
|
<generated name="EXCLUIR" caption="EXCLUIR" align="CENTER">
|
||||||
<scriptColumnGenerator language="JavaScript">
|
<scriptColumnGenerator language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function Generator() {
|
||||||
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
|
var btn = comp.buttonIcon(
|
||||||
|
"Excluir",
|
||||||
|
function () {
|
||||||
|
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
||||||
|
var config_jogos = engine.getGlobalVariable("config_jogos");
|
||||||
|
var registro = itemId + " - " + item.getItemProperty("TITULO");
|
||||||
|
var msg = "Tem certeza de que deseja excluir o jogo " + registro + "?";
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
|
lib_msg.confirmationBox(
|
||||||
|
{
|
||||||
|
icon: lib_msg.confirmationIcon.question,
|
||||||
|
caption: "Confirmar operação",
|
||||||
|
msg: msg,
|
||||||
|
actions: lib_msg.confirmationControls.yes_no,
|
||||||
|
},
|
||||||
|
function(action) {
|
||||||
|
if(action.yes()) {
|
||||||
|
lib.fncDeletarRegistro(config_jogos, itemId);
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
"trash",
|
||||||
|
);
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
|
]]>
|
||||||
</scriptColumnGenerator>
|
</scriptColumnGenerator>
|
||||||
</generated>
|
</generated>
|
||||||
</columns>
|
</columns>
|
||||||
@@ -235,12 +496,22 @@
|
|||||||
<HorizontalLayout align="MIDDLE_RIGHT" spacing="true">
|
<HorizontalLayout align="MIDDLE_RIGHT" spacing="true">
|
||||||
<ButtonWidget id="btnNovoJogo" caption="Novo Jogo" defaultIcon="ADD" style="GREEN">
|
<ButtonWidget id="btnNovoJogo" caption="Novo Jogo" defaultIcon="ADD" style="GREEN">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run (){
|
||||||
|
engine.getGlobalVariable("changeCrudPanel")("cadastroJogo");
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
<ButtonWidget id="btnVerAvaliacoes" caption="Ver Avaliações" defaultIcon="STAR" style="BLUE">
|
<ButtonWidget id="btnVerAvaliacoes" caption="Ver Avaliações" defaultIcon="STAR" style="BLUE">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run (){
|
||||||
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
|
var idJogoSelecionado = engine.getField("dbtJogos").getValue();
|
||||||
|
engine.getGlobalVariable("showTableReviews")(idJogoSelecionado);
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
@@ -254,7 +525,7 @@
|
|||||||
</Header>
|
</Header>
|
||||||
<Section caption="Cadastro de novo Jogo" subCaption="Insira os dados do jogo" width="100%" height="100%" >
|
<Section caption="Cadastro de novo Jogo" subCaption="Insira os dados do jogo" width="100%" height="100%" >
|
||||||
<VerticalLayout width="100%" height="100%" align="MIDDLE_CENTER" spacing="true">
|
<VerticalLayout width="100%" height="100%" align="MIDDLE_CENTER" spacing="true">
|
||||||
<Panel id="pnlCadastroJogo" width="100%" height="100%" margin="true" >
|
<Panel id="pnlDadosJogo" width="100%" height="100%" margin="true" >
|
||||||
<VerticalLayout caption="Dados do Jogo" width="100%" spacing="true">
|
<VerticalLayout caption="Dados do Jogo" width="100%" spacing="true">
|
||||||
<TextField id="txfCodigo" caption="Código" type="number" width="100%" enabled="false" visible="false"/>
|
<TextField id="txfCodigo" caption="Código" type="number" width="100%" enabled="false" visible="false"/>
|
||||||
<NumericField id="txfNotaMedia" caption="Nota Média" type="number" width="100%" enabled="false" visible="false"/>
|
<NumericField id="txfNotaMedia" caption="Nota Média" type="number" width="100%" enabled="false" visible="false"/>
|
||||||
@@ -290,17 +561,49 @@
|
|||||||
<HorizontalLayout align="MIDDLE_RIGHT" spacing="true" >
|
<HorizontalLayout align="MIDDLE_RIGHT" spacing="true" >
|
||||||
<ButtonWidget id="btnVoltar" caption="Voltar" defaultIcon="BACK" style="BLACK">
|
<ButtonWidget id="btnVoltar" caption="Voltar" defaultIcon="BACK" style="BLACK">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getGlobalVariable("changeCrudPanel")("listaJogos");
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
<ButtonWidget id="btnLimpar" caption="Limpar" defaultIcon="REMOVE" style="BLUE">
|
<ButtonWidget id="btnLimpar" caption="Limpar" defaultIcon="REMOVE" style="BLUE">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run(){
|
||||||
|
var config_jogos = engine.getGlobalVariable('config_jogos');
|
||||||
|
var lib = libService.loadScript('lib_cadastro_padrao');
|
||||||
|
var retorno = lib.fncLimpaCampos(config_jogos);
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
<ButtonWidget id="btnSalvarJogo" caption="Salvar" defaultIcon="SAVE" style="GREEN">
|
<ButtonWidget id="btnSalvarJogo" caption="Salvar" defaultIcon="SAVE" style="GREEN">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[ ]]>
|
<![CDATA[
|
||||||
|
function run() {
|
||||||
|
engine.getGlobalVariable("organizeRequiredFields")("jogos", false);
|
||||||
|
if(engine.isValid()){
|
||||||
|
var config_jogos = engine.getGlobalVariable("config_jogos");
|
||||||
|
var lib = libService.loadScript("lib_cadastro_padrao");
|
||||||
|
var id = engine.getField("txfCodigo").getValue();
|
||||||
|
var retorno = lib.fncGravarRegistro(config_jogos, id);
|
||||||
|
if (retorno) {
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
|
engine.getField("dbtJogos").refresh();
|
||||||
|
engine.getGlobalVariable("resetPanelGames")();
|
||||||
|
engine.getGlobalVariable("changeCrudPanel")("listaJogos");
|
||||||
|
lib_msg.showNotification({
|
||||||
|
type: lib_msg.notificationType.tray,
|
||||||
|
caption: "Sucesso!",
|
||||||
|
msg: "O jogo foi gravado com sucesso!",
|
||||||
|
position: lib_msg.notificationPosition.bottom_right,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]>
|
||||||
</onClickScript>
|
</onClickScript>
|
||||||
</ButtonWidget>
|
</ButtonWidget>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user