refactor: add Nota Média field and improve form layout in cadastro_jogos desktop XML
davinTI/jogos_matheus/pipeline/head There was a failure building this commit
davinTI/jogos_matheus/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<panel-form xmlns="http://www.davinti.com.br/vitruvio/form/panel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbucket.org/davinTI/vitruvio-xds/raw/master/vitruvio-panel-form.xsd">
|
<panel-form xmlns="http://www.davinti.com.br/vitruvio/form/panel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbucket.org/davinTI/vitruvio-xds/raw/master/vitruvio-panel-form.xsd">
|
||||||
<form width="100%" height="100%" target="DEFAULT" formKey="formTeste">
|
<form width="100%" height="100%" formKey="formTeste">
|
||||||
<description></description>
|
<description></description>
|
||||||
<initScript language="JavaScript">
|
<initScript language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
'GENERO',
|
'GENERO',
|
||||||
'ANO_LANCAMENTO',
|
'ANO_LANCAMENTO',
|
||||||
'PRODUTORA',
|
'PRODUTORA',
|
||||||
|
'NOTA_MEDIA',
|
||||||
'DESCRICAO'
|
'DESCRICAO'
|
||||||
],
|
],
|
||||||
camposTable: [
|
camposTable: [
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
'GENERO',
|
'GENERO',
|
||||||
'ANO_LANCAMENTO',
|
'ANO_LANCAMENTO',
|
||||||
'PRODUTORA',
|
'PRODUTORA',
|
||||||
|
'NOTA_MEDIA',
|
||||||
'DESCRICAO'
|
'DESCRICAO'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -37,6 +39,7 @@
|
|||||||
['GENERO', 'cbbGenero', 'String'],
|
['GENERO', 'cbbGenero', 'String'],
|
||||||
['ANO_LANCAMENTO', 'txfAnoLancamento', 'Number'],
|
['ANO_LANCAMENTO', 'txfAnoLancamento', 'Number'],
|
||||||
['PRODUTORA', 'txfProdutora', 'String'],
|
['PRODUTORA', 'txfProdutora', 'String'],
|
||||||
|
['NOTA_MEDIA', 'txfNotaMedia', 'Number'],
|
||||||
['DESCRICAO', 'txaDescricao', 'String']
|
['DESCRICAO', 'txaDescricao', 'String']
|
||||||
],
|
],
|
||||||
validacaoExclusao: [],
|
validacaoExclusao: [],
|
||||||
@@ -103,7 +106,7 @@
|
|||||||
engine.getField("txfEmail").setValue("");
|
engine.getField("txfEmail").setValue("");
|
||||||
engine.getField("txfComentario").setValue("");
|
engine.getField("txfComentario").setValue("");
|
||||||
engine.getField("dcfNota").setValue("");
|
engine.getField("dcfNota").setValue("");
|
||||||
engine.getField("dtfDataAvaliacao").setValue(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetPanelGames(){
|
function resetPanelGames(){
|
||||||
@@ -116,7 +119,6 @@
|
|||||||
engine.getField("txfNotaMedia").setValue("");
|
engine.getField("txfNotaMedia").setValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function organizeRequiredFields(whichForm, isToRequest) {
|
function organizeRequiredFields(whichForm, isToRequest) {
|
||||||
var fields = [];
|
var fields = [];
|
||||||
if(whichForm === "jogos"){
|
if(whichForm === "jogos"){
|
||||||
@@ -140,6 +142,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
function showTableReviews(gameId) {
|
function showTableReviews(gameId) {
|
||||||
if(!gameId) {
|
if(!gameId) {
|
||||||
var lib_msg = libService.loadScript("messages");
|
var lib_msg = libService.loadScript("messages");
|
||||||
@@ -192,37 +195,13 @@
|
|||||||
caption="Comentário" required="true" />
|
caption="Comentário" required="true" />
|
||||||
<DecimalField width="100%" id="dcfNota" type="decimal"
|
<DecimalField width="100%" id="dcfNota" type="decimal"
|
||||||
caption="Nota (0 a 10)"
|
caption="Nota (0 a 10)"
|
||||||
required="true">
|
required="true" />
|
||||||
<validation>
|
|
||||||
<script language="JavaScript">
|
|
||||||
<![CDATA[
|
|
||||||
function validator(){
|
|
||||||
this.getMessage = function(){
|
|
||||||
return "A nota deve ser um número entre 0 e 10.";
|
|
||||||
};
|
|
||||||
this.isValid = function(){
|
|
||||||
if(!engine.getField("dcfNota").isRequired()){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var value = engine.getField("dcfNota").getValue();
|
|
||||||
if(value === null || value === ""){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return value >= 0 && value <= 10;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
var script = new validator();
|
|
||||||
]]>
|
|
||||||
</script>
|
|
||||||
</validation>
|
|
||||||
</DecimalField>
|
|
||||||
<ButtonWidget id="btnSalvarAvaliacao" caption="Salvar" defaultIcon="SAVE"
|
<ButtonWidget id="btnSalvarAvaliacao" caption="Salvar" defaultIcon="SAVE"
|
||||||
style="BLUE">
|
style="BLUE">
|
||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
function run() {
|
function run() {
|
||||||
engine.getGlobalVariable("organizeRequiredFields")("jogos", false);
|
engine.getGlobalVariable("organizeRequiredFields")("jogos", false);
|
||||||
|
|
||||||
engine.getField("txfCodigoJogo").setValue(engine.getField("dbtJogos").getValue());
|
engine.getField("txfCodigoJogo").setValue(engine.getField("dbtJogos").getValue());
|
||||||
|
|
||||||
var hoje = new Date();
|
var hoje = new Date();
|
||||||
@@ -230,14 +209,16 @@
|
|||||||
engine.getField("dtfDataAvaliacao").setValue(javaDate);
|
engine.getField("dtfDataAvaliacao").setValue(javaDate);
|
||||||
|
|
||||||
if(engine.isValid()){
|
if(engine.isValid()){
|
||||||
|
|
||||||
|
engine.getField("txfCodigoJogo").setValue(engine.getField("dbtJogos").getValue());
|
||||||
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
||||||
var lib = libService.loadScript("lib_cadastro_padrao");
|
var lib = libService.loadScript("lib_cadastro_padrao");
|
||||||
var lib_msg = libService.loadScript("messages");
|
|
||||||
var id = engine.getField("txfCodigoAvaliacao").getValue();
|
var id = engine.getField("txfCodigoAvaliacao").getValue();
|
||||||
var retorno = lib.fncGravarRegistro(config_avaliacoes, id);
|
var retorno = lib.fncGravarRegistro(config_avaliacoes, id);
|
||||||
engine.getField("dbtJogos").refresh();
|
engine.getField("dbtJogos").refresh();
|
||||||
|
|
||||||
if (retorno) {
|
if (retorno) {
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
engine.getField("txfCodigoAvaliacao").setValue(retorno);
|
engine.getField("txfCodigoAvaliacao").setValue(retorno);
|
||||||
engine.getField("dbtAvaliacoes").refresh();
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
lib_msg.showNotification({
|
lib_msg.showNotification({
|
||||||
@@ -246,16 +227,11 @@
|
|||||||
msg: "Avaliação foi salva com sucesso!",
|
msg: "Avaliação foi salva com sucesso!",
|
||||||
position: lib_msg.notificationPosition.bottom_right,
|
position: lib_msg.notificationPosition.bottom_right,
|
||||||
});
|
});
|
||||||
engine.getLayout("wltCriarAvaliacoes").closeWindow();
|
}
|
||||||
engine.getLayout("wltListaAvaliacoes").showWindow();
|
engine.getLayout("wltCriarAvaliacoes").closeWindow();
|
||||||
} else {
|
engine.getLayout("wltListaAvaliacoes").showWindow();
|
||||||
lib_msg.showNotification({
|
engine.getGlobalVariable("organizeRequiredFields")("jogos", true);
|
||||||
type: lib_msg.notificationType.tray,
|
|
||||||
caption: "Erro!",
|
|
||||||
msg: "Não foi possível salvar a avaliação.",
|
|
||||||
position: lib_msg.notificationPosition.bottom_right,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
@@ -270,7 +246,7 @@
|
|||||||
<VerticalLayout spacing="true" margin="true" height="100%">
|
<VerticalLayout spacing="true" margin="true" height="100%">
|
||||||
<Label id="lblTitle"><value>Avaliações</value></Label>
|
<Label id="lblTitle"><value>Avaliações</value></Label>
|
||||||
<DBTable id="dbtAvaliacoes" type="string" width="100%"
|
<DBTable id="dbtAvaliacoes" type="string" width="100%"
|
||||||
gridSelectable="true" selectable="false" height="100%"
|
gridSelectable="true" selectable="true" height="100%"
|
||||||
expandRatio="0.2" showRowCount="true">
|
expandRatio="0.2" showRowCount="true">
|
||||||
<datasource>
|
<datasource>
|
||||||
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
|
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
|
||||||
@@ -279,10 +255,7 @@
|
|||||||
var sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES ORDER BY CODIGO";
|
var sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES ORDER BY CODIGO";
|
||||||
var id_jogo = engine.getField("dbtJogos").getValue();
|
var id_jogo = engine.getField("dbtJogos").getValue();
|
||||||
if(id_jogo != null){
|
if(id_jogo != null){
|
||||||
id_jogo = parseInt(id_jogo, 10);
|
sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES WHERE ID_JOGO = " + id_jogo + " ORDER BY CODIGO";
|
||||||
if(!isNaN(id_jogo)){
|
|
||||||
sqlBase = "SELECT * FROM TB_MATHEUS_MEDEIROS_AVALIACOES WHERE ID_JOGO = " + id_jogo + " ORDER BY CODIGO";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return sqlBase;
|
return sqlBase;
|
||||||
}
|
}
|
||||||
@@ -300,55 +273,63 @@
|
|||||||
<generated name="EDITAR" caption="EDITAR" align="CENTER">
|
<generated name="EDITAR" caption="EDITAR" align="CENTER">
|
||||||
<scriptColumnGenerator language="JavaScript">
|
<scriptColumnGenerator language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
function Generator() {
|
function Generator() {
|
||||||
var comp = libService.loadScript("vaadinComponents");
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
this.generate = function (itemId, columnId, item, container) {
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
var btn = comp.buttonIcon("Editar", function () {
|
var btn = comp.buttonIcon("Editar", function () {
|
||||||
engine.getField("txfCodigoAvaliacao").setValue(itemId);
|
var id = itemId;
|
||||||
if (itemId != null) {
|
engine.getField("txfCodigoAvaliacao").setValue(id);
|
||||||
engine.getLayout("wltCriarAvaliacoes").showWindow();
|
if (id != null) {
|
||||||
engine.getLayout("wltListaAvaliacoes").closeWindow();
|
engine.getLayout("wltCriarAvaliacoes").showWindow();
|
||||||
var config_avaliacoes = engine.getGlobalVariable('config_avaliacoes');
|
engine.getLayout("wltListaAvaliacoes").closeWindow();
|
||||||
var lib = libService.loadScript('lib_cadastro_padrao');
|
var config_avaliacoes = engine.getGlobalVariable('config_avaliacoes');
|
||||||
lib.fncCarregarCampos(config_avaliacoes, itemId);
|
var lib = libService.loadScript('lib_cadastro_padrao');
|
||||||
}
|
var sql = lib.fncCarregarCampos(config_avaliacoes, id);
|
||||||
}, "pencil");
|
}
|
||||||
return btn;
|
}, "pencil");
|
||||||
}
|
|
||||||
}
|
return btn;
|
||||||
var script = new Generator();
|
}
|
||||||
|
}
|
||||||
|
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() {
|
function Generator() {
|
||||||
var comp = libService.loadScript("vaadinComponents");
|
var comp = libService.loadScript("vaadinComponents");
|
||||||
this.generate = function (itemId, columnId, item, container) {
|
this.generate = function (itemId, columnId, item, container) {
|
||||||
var btn = comp.buttonIcon("Excluir", function () {
|
var btn = comp.buttonIcon(
|
||||||
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
"Excluir",
|
||||||
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
function () {
|
||||||
var registro = itemId + " - " + item.getItemProperty("NOME");
|
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
||||||
var msg = "Tem certeza de que deseja excluir o comentário " + registro + "?";
|
var config_avaliacoes = engine.getGlobalVariable("config_avaliacoes");
|
||||||
var lib_msg = libService.loadScript("messages");
|
var registro = itemId + " - " + item.getItemProperty("nome");
|
||||||
lib_msg.confirmationBox({
|
var msg = "Tem certeza de que deseja excluir o comentário " + registro + "?";
|
||||||
icon: lib_msg.confirmationIcon.question,
|
var lib_msg = libService.loadScript("messages");
|
||||||
caption: "Confirmar operação",
|
lib_msg.confirmationBox(
|
||||||
msg: msg,
|
{
|
||||||
actions: lib_msg.confirmationControls.yes_no
|
icon: lib_msg.confirmationIcon.question,
|
||||||
}, function(action) {
|
caption: "Confirmar operação",
|
||||||
if(action.yes()) {
|
msg: msg,
|
||||||
lib.fncDeletarRegistro(config_avaliacoes, itemId);
|
actions: lib_msg.confirmationControls.yes_no,
|
||||||
engine.getField("dbtAvaliacoes").refresh();
|
},
|
||||||
engine.getField("dbtJogos").refresh();
|
function(action) {
|
||||||
}
|
if(action.yes()) {
|
||||||
});
|
lib.fncDeletarRegistro(config_avaliacoes, itemId);
|
||||||
}, "trash");
|
engine.getField("dbtAvaliacoes").refresh();
|
||||||
return btn;
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
var script = new Generator();
|
},
|
||||||
|
"trash",
|
||||||
|
);
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var script = new Generator();
|
||||||
]]>
|
]]>
|
||||||
</scriptColumnGenerator>
|
</scriptColumnGenerator>
|
||||||
</generated>
|
</generated>
|
||||||
@@ -376,14 +357,18 @@
|
|||||||
</WindowLayout>
|
</WindowLayout>
|
||||||
|
|
||||||
<CrudPanel id="pnlListaJogos" width="100%" height="100%" visible="true">
|
<CrudPanel id="pnlListaJogos" width="100%" height="100%" visible="true">
|
||||||
<Header>
|
<Header backgroundColor="ORANGE">
|
||||||
<Caption>Lista de jogos</Caption>
|
<Caption>Cadastro de Jogos</Caption>
|
||||||
<SubCaption>Cadastro de jogos</SubCaption>
|
<SubCaption>Cadastro de jogos</SubCaption>
|
||||||
</Header>
|
</Header>
|
||||||
<Section height="100%" width="100%" caption="Jogos" subCaption="Veja todos os jogos" id = "secJogos">
|
<Section height="100%" caption="Jogos" subCaption="Veja todos os jogos"
|
||||||
<VerticalLayout height="100%" width="100%" align="MIDDLE_CENTER" spacing="true">
|
id="secDadosJogo">
|
||||||
<HorizontalLayout width="100%" spacing="true">
|
<VerticalLayout width="100%" height="100%" align="MIDDLE_CENTER"
|
||||||
<TextField id="txfPesquisa" expandRatio="0.8" width="100%" caption="Pesquisar jogo" type="string" immediate="true">
|
spacing="true">
|
||||||
|
<HorizontalLayout width="100%" spacing="true">
|
||||||
|
<TextField expandRatio="0.8" width="100%" id="txfPesquisa"
|
||||||
|
caption="Pesquise pelo nome do jogo" type="string"
|
||||||
|
immediate="true">
|
||||||
<events>
|
<events>
|
||||||
<valueChange>
|
<valueChange>
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
@@ -407,7 +392,7 @@
|
|||||||
</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" selectable="true">
|
||||||
<datasource>
|
<datasource>
|
||||||
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
|
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
@@ -417,8 +402,7 @@
|
|||||||
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";
|
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) {
|
if (txfPesquisa) {
|
||||||
var safe = ("" + txfPesquisa).replace(/'/g, "''");
|
sqlBase += " WHERE UPPER(J.TITULO) LIKE UPPER('%" + txfPesquisa + "%')";
|
||||||
sqlBase += " WHERE UPPER(J.TITULO) LIKE UPPER('%" + safe + "%')";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlBase += " GROUP BY J.CODIGO, J.TITULO, J.GENERO, J.ANO_LANCAMENTO, J.PRODUTORA, J.DESCRICAO";
|
sqlBase += " GROUP BY J.CODIGO, J.TITULO, J.GENERO, J.ANO_LANCAMENTO, J.PRODUTORA, J.DESCRICAO";
|
||||||
@@ -492,7 +476,7 @@
|
|||||||
function () {
|
function () {
|
||||||
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
var lib = engine.getGlobalVariable("lib_cadastro_padrao");
|
||||||
var config_jogos = engine.getGlobalVariable("config_jogos");
|
var config_jogos = engine.getGlobalVariable("config_jogos");
|
||||||
var registro = itemId + " - " + item.getItemProperty("TITULO");
|
var registro = itemId + " - " + item.getItemProperty("titulo");
|
||||||
var msg = "Tem certeza de que deseja excluir o jogo " + registro + "?";
|
var msg = "Tem certeza de que deseja excluir o jogo " + registro + "?";
|
||||||
var lib_msg = libService.loadScript("messages");
|
var lib_msg = libService.loadScript("messages");
|
||||||
lib_msg.confirmationBox(
|
lib_msg.confirmationBox(
|
||||||
@@ -526,7 +510,6 @@
|
|||||||
<onClickScript language="JavaScript">
|
<onClickScript language="JavaScript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
function run (){
|
function run (){
|
||||||
engine.getGlobalVariable("resetPanelGames")();
|
|
||||||
engine.getGlobalVariable("changeCrudPanel")("cadastroJogo");
|
engine.getGlobalVariable("changeCrudPanel")("cadastroJogo");
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
@@ -554,12 +537,12 @@
|
|||||||
</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="pnlDadosJogo" width="100%" expandRatio="0.7" 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"/>
|
||||||
<TextField id="txfTitulo" caption="Título" type="string" width="100%" required="true" minLength="3"/>
|
<TextField id="txfTitulo" caption="Título" type="string" width="100%" required="true" minLength="3"/>
|
||||||
<ComboBox id="cbbGenero" type="string" caption="Gênero" width="100%" required="true">
|
<ComboBox id="cbbGenero" type="string" caption="Gênero" updatable="false" allowNullSelection="true" width="100%" required="true">
|
||||||
<entry key="ACAO" value="Ação"/>
|
<entry key="ACAO" value="Ação"/>
|
||||||
<entry key="AVENTURA" value="Aventura"/>
|
<entry key="AVENTURA" value="Aventura"/>
|
||||||
<entry key="RPG" value="RPG"/>
|
<entry key="RPG" value="RPG"/>
|
||||||
@@ -597,10 +580,10 @@
|
|||||||
</validation>
|
</validation>
|
||||||
</TextField>
|
</TextField>
|
||||||
<TextField id="txfProdutora" caption="Produtora" type="string" width="100%" required="true" maxLength="50"/>
|
<TextField id="txfProdutora" caption="Produtora" type="string" width="100%" required="true" maxLength="50"/>
|
||||||
<TextArea id="txaDescricao" caption="Descrição" type="string" width="100%" required="true" maxLength="500"/>
|
<TextArea id="txaDescricao" caption="Descrição" type="string" width="100%" maxLength="500"/>
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
</Panel>
|
</Panel>
|
||||||
<HorizontalLayout align="MIDDLE_RIGHT" expandRatio="0.3" 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[
|
||||||
@@ -629,10 +612,10 @@
|
|||||||
if(engine.isValid()){
|
if(engine.isValid()){
|
||||||
var config_jogos = engine.getGlobalVariable("config_jogos");
|
var config_jogos = engine.getGlobalVariable("config_jogos");
|
||||||
var lib = libService.loadScript("lib_cadastro_padrao");
|
var lib = libService.loadScript("lib_cadastro_padrao");
|
||||||
var lib_msg = libService.loadScript("messages");
|
|
||||||
var id = engine.getField("txfCodigo").getValue();
|
var id = engine.getField("txfCodigo").getValue();
|
||||||
var retorno = lib.fncGravarRegistro(config_jogos, id);
|
var retorno = lib.fncGravarRegistro(config_jogos, id);
|
||||||
if (retorno) {
|
if (retorno) {
|
||||||
|
var lib_msg = libService.loadScript("messages");
|
||||||
engine.getField("dbtJogos").refresh();
|
engine.getField("dbtJogos").refresh();
|
||||||
engine.getGlobalVariable("resetPanelGames")();
|
engine.getGlobalVariable("resetPanelGames")();
|
||||||
engine.getGlobalVariable("changeCrudPanel")("listaJogos");
|
engine.getGlobalVariable("changeCrudPanel")("listaJogos");
|
||||||
@@ -642,14 +625,7 @@
|
|||||||
msg: "O jogo foi gravado com sucesso!",
|
msg: "O jogo foi gravado com sucesso!",
|
||||||
position: lib_msg.notificationPosition.bottom_right,
|
position: lib_msg.notificationPosition.bottom_right,
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
lib_msg.showNotification({
|
|
||||||
type: lib_msg.notificationType.tray,
|
|
||||||
caption: "Erro!",
|
|
||||||
msg: "Não foi possível gravar o jogo.",
|
|
||||||
position: lib_msg.notificationPosition.bottom_right,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
@@ -664,4 +640,4 @@
|
|||||||
|
|
||||||
</components>
|
</components>
|
||||||
</form>
|
</form>
|
||||||
</panel-form>
|
</panel-form>
|
||||||
|
|||||||
Reference in New Issue
Block a user