Bonjour, je débute sur java et j'essai de combiner 2 textbox en une seul.
J'ai 'ctrlEspesorNEW' dans mon exemple ou j'essai d'avoir comme resultat W5.
Donc j'ai m'a combobox ctrlProducto qui est la suivante
Si je sélectionne Wagon j'ai comme résultat W
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 ctrlProducto_tipo.on ('change', function(e){ if (this.getValue()== 'Haut'){ var strProducto = 'H';} if (this.getValue()== 'Secu'){ var strProducto = 'S';} if (this.getValue()== 'Retour'){ var strProducto = 'R';} if (this.getValue()== 'Wagon'){ var strProducto = 'W';}
Puis j'ai une fonction qui est la suivante pour une textbox ctrlEspesor
Si je met 5 j'ai comme resultat 5
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 ctrlEspesor.on ('keyup', function(e){ if (this.getValue()!== ''){ var strEspesor = ctrlEspesor.getValue();}
Si je change en cours de route une des deux option (par exemple choisir Haut + 9 = H9) ctrlEspesorNEW se met à jour.
Et enfin comment je combine les 2 résultats afin qu'ils soient concatener dans ctrlEspesorNEW?
J'ai essayer ceci :
Mais j'imagine que pour qu'il se mette a jour il faut un event sur les 2 se produise.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 var valueRRRRR = strProducto.concat('-',strEspesor); ctrlEspesorNEW.setValue(valueRRRRR);
Voici mon code html:
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236 <!doctype html> <html {$html_attrs}> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <title>{$pagetitle}</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link REL="stylesheet" href="styles/default.css" type="text/css"> {BEGIN rtlCSS} <link REL="stylesheet" href="styles/defaultRTL.css" type="text/css"> {END rtlCSS} {BEGIN styleCSSFiles} <link REL="stylesheet" href="{$stylepath}" type="text/css"> {END styleCSSFiles} {BEGIN pageCSSFiles} <link REL="stylesheet" href="{$pagestylepath}" type="text/css"> {END pageCSSFiles} </head> <body class="{$stylename} function-add" {$bodyattrs}> {BEGIN body} {$header} <div class="rnr-page"> <div class="rnr-top {$blockclass_top}"> {BEGIN container_all} <div class="rnr-c rnr-cv rnr-c-all"> <div class="rnr-brickcontents style1 rnr-b-wrapper {$wrapperclass_fields} rnr-wrapper rnr-cbw-fields"> {BEGIN container_fields} <div class="rnr-c rnr-cv rnr-c-fields"> {BEGIN addheader} <div class="rnr-brickcontents style2 rnr-b-addheader {$brickclass_addheader}"><span> <h1>{$pagetitlelabel Produccion add}</h1> </span></div>{END addheader} {BEGIN message_block} <div class="rnr-brickcontents style1 rnr-b-message {$brickclass_message}"><div class="rnr-message">{$message}</div></div>{END message_block} <div class="rnr-brickcontents style1 rnr-b-addfields2 {$brickclass_addfields2}"><table class="fieldGrid fieldGrid2 edit"> <tr> <td> {BEGIN Nave_fieldblock} <div data-fieldname="Nave" class="rnr-field style1 {$fielddispclass_Nave}"> <span class="rnr-label">{BEGIN Nave_label}{$label Produccion Nave}{END Nave_label}</span> <span class="rnr-control style3">{$Nave_editcontrol}</span> </div> {END Nave_fieldblock} {BEGIN Producto_fieldblock} <div data-fieldname="Producto" class="rnr-field style1 {$fielddispclass_Producto}"> <span class="rnr-label">{BEGIN Producto_label}{$label Produccion Producto}{END Producto_label}</span> <span class="rnr-control style3">{$Producto_editcontrol}</span> </div> {END Producto_fieldblock} {BEGIN Producto_tipo_fieldblock} <div data-fieldname="Producto_tipo" class="rnr-field style1 {$fielddispclass_Producto_tipo}"> <span class="rnr-label">{BEGIN Producto_tipo_label}{$label Produccion Producto_tipo}{END Producto_tipo_label}</span> <span class="rnr-control style3">{$Producto_tipo_editcontrol}</span> </div> {END Producto_tipo_fieldblock} {BEGIN Longitud_fieldblock} <div data-fieldname="Longitud" class="rnr-field style1 {$fielddispclass_Longitud}"> <span class="rnr-label">{BEGIN Longitud_label}{$label Produccion Longitud}{END Longitud_label}</span> <span class="rnr-control style3">{$Longitud_editcontrol}</span> </div> {END Longitud_fieldblock} {BEGIN Anchura_fieldblock} <div data-fieldname="Anchura" class="rnr-field style1 {$fielddispclass_Anchura}"> <span class="rnr-label">{BEGIN Anchura_label}{$label Produccion Anchura}{END Anchura_label}</span> <span class="rnr-control style3">{$Anchura_editcontrol}</span> </div> {END Anchura_fieldblock} {BEGIN Espesor_fieldblock} <div data-fieldname="Espesor" class="rnr-field style1 {$fielddispclass_Espesor}"> <span class="rnr-label">{BEGIN Espesor_label}{$label Produccion Espesor}{END Espesor_label}</span> <span class="rnr-control style3">{$Espesor_editcontrol}</span> </div> {END Espesor_fieldblock} {BEGIN EspesorNEW_fieldblock} <div data-fieldname="EspesorNEW" class="rnr-field style1 {$fielddispclass_EspesorNEW}"> <span class="rnr-label">{BEGIN EspesorNEW_label}{$label Produccion EspesorNEW}{END EspesorNEW_label}</span> <span class="rnr-control style3">{$EspesorNEW_editcontrol}</span> </div> {END EspesorNEW_fieldblock} {BEGIN Seleccion_fieldblock} <div data-fieldname="Seleccion" class="rnr-field style1 {$fielddispclass_Seleccion}"> <span class="rnr-label">{BEGIN Seleccion_label}{$label Produccion Seleccion}{END Seleccion_label}</span> <span class="rnr-control style3">{$Seleccion_editcontrol}</span> </div> {END Seleccion_fieldblock} {BEGIN PiezasOLD_fieldblock} <div data-fieldname="PiezasOLD" class="rnr-field style1 {$fielddispclass_PiezasOLD}"> <span class="rnr-label">{BEGIN PiezasOLD_label}{$label Produccion PiezasOLD}{END PiezasOLD_label}</span> <span class="rnr-control style3">{$PiezasOLD_editcontrol}</span> </div> {END PiezasOLD_fieldblock} {BEGIN Kilos_fieldblock} <div data-fieldname="Kilos" class="rnr-field style1 {$fielddispclass_Kilos}"> <span class="rnr-label">{BEGIN Kilos_label}{$label Produccion Kilos}{END Kilos_label}</span> <span class="rnr-control style3">{$Kilos_editcontrol}</span> </div> {END Kilos_fieldblock} {BEGIN Numero_pale_fieldblock} <div data-fieldname="Numero_pale" class="rnr-field style1 {$fielddispclass_Numero_pale}"> <span class="rnr-label">{BEGIN Numero_pale_label}{$label Produccion Numero_pale}{END Numero_pale_label}</span> <span class="rnr-control style3">{$Numero_pale_editcontrol}</span> </div> {END Numero_pale_fieldblock} </td> <td> {BEGIN Embaladora_fieldblock} <div data-fieldname="Embaladora" class="rnr-field style1 {$fielddispclass_Embaladora}"> <span class="rnr-label">{BEGIN Embaladora_label}{$label Produccion Embaladora}{END Embaladora_label}</span> <span class="rnr-control style3">{$Embaladora_editcontrol}</span> </div> {END Embaladora_fieldblock} {BEGIN Marcado_fieldblock} <div data-fieldname="Marcado" class="rnr-field style1 {$fielddispclass_Marcado}"> <span class="rnr-label">{BEGIN Marcado_label}{$label Produccion Marcado}{END Marcado_label}</span> <span class="rnr-control style3">{$Marcado_editcontrol}</span> </div> {END Marcado_fieldblock} {BEGIN Formato_fieldblock} <div data-fieldname="Formato" class="rnr-field style1 {$fielddispclass_Formato}"> <span class="rnr-label">{BEGIN Formato_label}{$label Produccion Formato}{END Formato_label}</span> <span class="rnr-control style3">{$Formato_editcontrol}</span> </div> {END Formato_fieldblock} {BEGIN Lote_medicion_fieldblock} <div data-fieldname="Lote_medicion" class="rnr-field style1 {$fielddispclass_Lote_medicion}"> <span class="rnr-label">{BEGIN Lote_medicion_label}{$label Produccion Lote_medicion}{END Lote_medicion_label}</span> <span class="rnr-control style3">{$Lote_medicion_editcontrol}</span> </div> {END Lote_medicion_fieldblock} {BEGIN Lote_cliente_fieldblock} <div data-fieldname="Lote_cliente" class="rnr-field style1 {$fielddispclass_Lote_cliente}"> <span class="rnr-label">{BEGIN Lote_cliente_label}{$label Produccion Lote_cliente}{END Lote_cliente_label}</span> <span class="rnr-control style3">{$Lote_cliente_editcontrol}</span> </div> {END Lote_cliente_fieldblock} {BEGIN Particularidad_fieldblock} <div data-fieldname="Particularidad" class="rnr-field style1 {$fielddispclass_Particularidad}"> <span class="rnr-label">{BEGIN Particularidad_label}{$label Produccion Particularidad}{END Particularidad_label}</span> <span class="rnr-control style3">{$Particularidad_editcontrol}</span> </div> {END Particularidad_fieldblock} {BEGIN Codigo_referencia_fieldblock} <div data-fieldname="Codigo_referencia" class="rnr-field style1 {$fielddispclass_Codigo_referencia}"> <span class="rnr-label">{BEGIN Codigo_referencia_label}{$label Produccion Codigo_referencia}{END Codigo_referencia_label}</span> <span class="rnr-control style3">{$Codigo_referencia_editcontrol}</span> </div> {END Codigo_referencia_fieldblock} {BEGIN Fecha_fieldblock} <div data-fieldname="Fecha" class="rnr-field style1 {$fielddispclass_Fecha}"> <span class="rnr-label">{BEGIN Fecha_label}{$label Produccion Fecha}{END Fecha_label}</span> <span class="rnr-control style3">{$Fecha_editcontrol}</span> </div> {END Fecha_fieldblock} {BEGIN Piezas_fieldblock} <div data-fieldname="Piezas" class="rnr-field style1 {$fielddispclass_Piezas}"> <span class="rnr-label">{BEGIN Piezas_label}{$label Produccion Piezas}{END Piezas_label}</span> <span class="rnr-control style3">{$Piezas_editcontrol}</span> </div> {END Piezas_fieldblock} {BEGIN Acabado_fieldblock} <div data-fieldname="Acabado" class="rnr-field style1 {$fielddispclass_Acabado}"> <span class="rnr-label">{BEGIN Acabado_label}{$label Produccion Acabado}{END Acabado_label}</span> <span class="rnr-control style3">{$Acabado_editcontrol}</span> </div> {END Acabado_fieldblock} </td> </tr> </table></div> {BEGIN addbuttons} <div class="rnr-brickcontents style2 rnr-b-addbuttons {$brickclass_addbuttons}"><div class="rnr-buttons-left"> {BEGIN save_button} <a href="#" class="rnr-button main" id="saveButton{$id}" {$savebutton_attrs}>Guardar</a> {END save_button} {BEGIN reset_button} <a href="#" class="rnr-button" id="resetButton{$id}">Reiniciar</a> {END reset_button} {BEGIN cancel_button} <a href="#" class="rnr-button" id="cancelButton{$id}">Cancelar</a> {END cancel_button} {BEGIN back_button} <a href="#" class="rnr-button" id="backButton{$id}">Volver a la lista</a> {END back_button} {BEGIN backToMenu_button} <a href="#" class="rnr-button" id="backToMenuButton{$id}">Regresar al menú</a> {END backToMenu_button} </div> </div>{END addbuttons} </div> {END container_fields} </div> </div> {END container_all} </div> <div class="rnr-middle"> <div class="rnr-left {$blockclass_left}"> </div> <div class="rnr-center {$blockclass_center}"> </div> <div class="rnr-right {$blockclass_right}"> </div> </div> <div class="rnr-bottom {$blockclass_bottom}"> <!--%%bottom%%--> </div> </div> {$footer} {END body} </body> </html>
Merci...
Partager