Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Próxima revisión
Revisión previa
wiki:2.-desarrollo-app:2.3.-codigo:c.-eventos:33.-onclick:start [2019/05/17 12:52]
127.0.0.1 editor externo
wiki:2.-desarrollo-app:2.3.-codigo:c.-eventos:33.-onclick:start [2020/08/24 10:13] (actual)
ary [Prop type=”B”]
Línea 1: Línea 1:
  
 {{indexmenu_n>1}} {{indexmenu_n>1}}
-===== keyPressed  =====+===== onclick  =====
 \\ \\
  
-==== Prop type=”T” ====+==== Prop type=”B” ====
 \\ \\
 +
  
 |< 80% 10% 10% - >|  |< 80% 10% 10% - >|
 ^ **Evento         ** ^ **Propiedad** ^ **Descripción**  ^ ^ **Evento         ** ^ **Propiedad** ^ **Descripción**  ^
-keyPressed| type="T**Invocado cuando pierde o gana foco el campo, en el parámetro isFocusedParámetros: target, objItem, isFocused**  | +onclick   | type="B | Invocado cuando se pulsa un botón.  |
  
 +Aquí definiremos que sucederá en nuestra aplicación al presionar el botón previamente diseñado.
  
 +<note tip>En nuestras aplicaciones por defecto cuando se presiona un botón se muestra un mensaje de proceso, pero podemos quitarlo poniendo en el nodo a ejecutar show-wait-dialog="false". Si queremos quitarlo a nivel de app para que no se muestre nunca lo definimos de la siguiente forma:  (load-wait="false" show-wait-dialog="false") y en el momento que queramos usarlo por script lo definimos de la siguiente forma donde lo necesitemos (ui.showWaitDialog("Conectando...");) y para quitarlo pones esto (ui.hideWaitDialog();)</note>
 +\\
 +\\
 +Ejemplos:
  
 <code javascript> <code javascript>
  
 +<prop name="MAP_LAST" type="B" img="last.png" title="Anterior" onclick="javascript:prev(self,'ir'); ui.refresh('MAP_LAST', 'MAP_NEXT', 'MAP_LAST_EMPTY');
 +" methodx="ExecuteNode(anterior)" forecolor="#FFFFFF" width="45%" height="80%" labelwidth="1" imgsel="last-sel.png" disablevisible="MAP_GROUP=1" />
  
  
 +<prop name="BTACEPTARVOZ" type="B" img="verlistado.png" class="propBTInferiorPerfil forecolorW fuente4" fontbold="true" tmargin="1%" width="90%" height="15%" keep-aspect-ratio="false" title="ACEPTAR MANUALMENTE" onclick="javascript:self.MAP_ISRECORDING=0;self.MAP_VOZ=0;ui.getView(self).refresh('flotantevoz');ui.stopRecognizeSpeech();ui.sleep(2);app.conducir(self,'AH');" />
 +
 +</code>
 +
 +<code javascript>
 +
 +<onchange refresh="false">
 +        <field name="MAP_FECHA">
 +          <action name="runscript">
 +            <script language="javascript"> 
 +                try {
 +                    let coll=self.getContents('CuentaClienteBuscar');
 +                    ui.showWaitDialog("Mostrando datos...");
 +                    let mes=0;
 +                    mes =self.MAP_FECHA.getMonth() + 1; 
 +                    coll.setMacro("##MACROFILTER1##","c.USUARIO='" + user.MAP_USER + "' AND DAY(c.FECHA_INI_SYS)=" + self.MAP_FECHA.getDate()  + " AND MONTH(c.FECHA_INI_SYS)=" +mes.toString()  + " AND YEAR(c.FECHA_INI_SYS)=" + self.MAP_FECHA.getFullYear());
 +                    coll.setMacro("##MACROFILTER2##","c.USUARIO='" + user.MAP_USER + "' AND DAY(c.FECHA)=" + self.MAP_FECHA.getDate() + " AND MONTH(c.FECHA)=" + mes.toString() + " AND YEAR(c.FECHA)=" + self.MAP_FECHA.getFullYear());
 +                    
 +                    coll.unlock();
 +                    coll.loadAll();
 +                    coll.lock();
 +                    ui.getView(self).refresh('CuentaClienteBuscar');
 +                    ui.hideWaitDialog();
 +                } catch(e) {
 +                    ui.hideWaitDialog();
 +                    showPregunta('P0',self);
 +                }
 + </script>
 +          </action>
 +        </field>
 +        <field name="MAP_PROPMODIFYPREG1">
 +          <action name="runscript">
 +            <script language="javascript"> 
 +                try {
 +                    // ui.showWaitDialog("Mostrando datos...");
 +                    sugerenciaBuscar(self,1);
 +                    // ui.hideWaitDialog();
 +                } catch(e) {
 +                    // ui.hideWaitDialog();
 +                    showPregunta('P0',self);
 +                }
 + </script>
 +          </action>
 +        </field>
 +        <field name="MAP_PROPMODIFYPREG2">
 +          <action name="runscript">
 +            <script language="javascript"> 
 +                try {
 +                    ui.showWaitDialog("Mostrando datos...");
 +                    sugerenciaBuscar(self,2);
 +                    ui.hideWaitDialog();
 +                } catch(e) {
 +                    ui.hideWaitDialog();
 +                    showPregunta('P0',self);
 +                }
 + </script>
 +          </action>
 +        </field>
 +    </onchange>
 </code> </code>