1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.shared.renderkit.html; |
20 | |
|
21 | |
import java.io.IOException; |
22 | |
import java.util.Collection; |
23 | |
import java.util.List; |
24 | |
import java.util.Map; |
25 | |
import javax.faces.component.UIComponent; |
26 | |
import javax.faces.component.behavior.ClientBehavior; |
27 | |
import javax.faces.component.behavior.ClientBehaviorContext; |
28 | |
import javax.faces.context.FacesContext; |
29 | |
import javax.faces.context.ResponseWriter; |
30 | |
import org.apache.myfaces.shared.renderkit.ClientBehaviorEvents; |
31 | |
|
32 | 0 | public class CommonEventUtils |
33 | |
{ |
34 | |
public static long getCommonEventsMarked(UIComponent component) |
35 | |
{ |
36 | 0 | Long commonEvents = (Long) component.getAttributes().get(CommonEventConstants.COMMON_EVENTS_MARKED); |
37 | |
|
38 | 0 | if (commonEvents == null) |
39 | |
{ |
40 | 0 | commonEvents = 0L; |
41 | |
} |
42 | 0 | return commonEvents; |
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 | |
public static boolean renderBehaviorizedAttribute( |
114 | |
FacesContext facesContext, ResponseWriter writer, |
115 | |
String componentProperty, UIComponent component, |
116 | |
String sourceId, String eventName, |
117 | |
Map<String, List<ClientBehavior>> clientBehaviors, |
118 | |
String htmlAttrName) throws IOException |
119 | |
{ |
120 | 0 | return renderBehaviorizedAttribute(facesContext, writer, |
121 | |
componentProperty, component, sourceId, eventName, null, |
122 | |
clientBehaviors, htmlAttrName, (String) component |
123 | |
.getAttributes().get(componentProperty)); |
124 | |
} |
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
public static boolean renderBehaviorizedAttribute( |
143 | |
FacesContext facesContext, ResponseWriter writer, |
144 | |
String componentProperty, UIComponent component, String eventName, |
145 | |
Collection<ClientBehaviorContext.Parameter> eventParameters, |
146 | |
Map<String, List<ClientBehavior>> clientBehaviors, |
147 | |
String htmlAttrName, String attributeValue) throws IOException |
148 | |
{ |
149 | 0 | return renderBehaviorizedAttribute(facesContext, writer, |
150 | |
componentProperty, component, |
151 | |
null, eventName, |
152 | |
eventParameters, clientBehaviors, htmlAttrName, attributeValue); |
153 | |
} |
154 | |
|
155 | |
public static boolean renderBehaviorizedAttribute( |
156 | |
FacesContext facesContext, ResponseWriter writer, |
157 | |
String componentProperty, UIComponent component, |
158 | |
String sourceId, String eventName, |
159 | |
Collection<ClientBehaviorContext.Parameter> eventParameters, |
160 | |
Map<String, List<ClientBehavior>> clientBehaviors, |
161 | |
String htmlAttrName, String attributeValue) throws IOException |
162 | |
{ |
163 | |
|
164 | 0 | List<ClientBehavior> cbl = (clientBehaviors != null) ? clientBehaviors |
165 | |
.get(eventName) : null; |
166 | |
|
167 | 0 | if (cbl == null || cbl.size() == 0) |
168 | |
{ |
169 | 0 | return HtmlRendererUtils.renderHTMLStringAttribute(writer, componentProperty, htmlAttrName, |
170 | |
attributeValue); |
171 | |
} |
172 | |
|
173 | 0 | if (cbl.size() > 1 || (cbl.size() == 1 && attributeValue != null)) |
174 | |
{ |
175 | 0 | return HtmlRendererUtils.renderHTMLStringAttribute(writer, componentProperty, htmlAttrName, |
176 | |
HtmlRendererUtils.buildBehaviorChain(facesContext, |
177 | |
component, sourceId, eventName, |
178 | |
eventParameters, clientBehaviors, attributeValue, |
179 | |
HtmlRendererUtils.STR_EMPTY)); |
180 | |
} |
181 | |
else |
182 | |
{ |
183 | |
|
184 | 0 | return HtmlRendererUtils.renderHTMLStringAttribute( |
185 | |
writer, |
186 | |
componentProperty, |
187 | |
htmlAttrName, |
188 | |
cbl.get(0).getScript( |
189 | |
ClientBehaviorContext.createClientBehaviorContext( |
190 | |
facesContext, component, eventName, |
191 | |
sourceId, eventParameters))); |
192 | |
} |
193 | |
} |
194 | |
|
195 | |
public static void renderBehaviorizedEventHandlers( |
196 | |
FacesContext facesContext, ResponseWriter writer, |
197 | |
long commonPropertiesMarked, long commonEventsMarked, |
198 | |
UIComponent uiComponent, |
199 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
200 | |
throws IOException |
201 | |
{ |
202 | 0 | renderBehaviorizedEventHandlers(facesContext, writer, |
203 | |
commonPropertiesMarked, commonEventsMarked, uiComponent, |
204 | |
null, clientBehaviors); |
205 | 0 | } |
206 | |
|
207 | |
public static void renderBehaviorizedEventHandlers( |
208 | |
FacesContext facesContext, ResponseWriter writer, |
209 | |
long commonPropertiesMarked, long commonEventsMarked, |
210 | |
UIComponent uiComponent, String sourceId, |
211 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
212 | |
throws IOException |
213 | |
{ |
214 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONCLICK_PROP) != 0 || |
215 | |
(commonEventsMarked & CommonEventConstants.CLICK_EVENT) != 0) |
216 | |
{ |
217 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONCLICK_ATTR, |
218 | |
uiComponent, sourceId, ClientBehaviorEvents.CLICK, |
219 | |
clientBehaviors, HTML.ONCLICK_ATTR); |
220 | |
} |
221 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONDBLCLICK_PROP) != 0 || |
222 | |
(commonEventsMarked & CommonEventConstants.DBLCLICK_EVENT) != 0) |
223 | |
{ |
224 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONDBLCLICK_ATTR, |
225 | |
uiComponent, sourceId, ClientBehaviorEvents.DBLCLICK, |
226 | |
clientBehaviors, HTML.ONDBLCLICK_ATTR); |
227 | |
} |
228 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEDOWN_PROP) != 0 || |
229 | |
(commonEventsMarked & CommonEventConstants.MOUSEDOWN_EVENT) != 0) |
230 | |
{ |
231 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
232 | |
HTML.ONMOUSEDOWN_ATTR, uiComponent, sourceId, |
233 | |
ClientBehaviorEvents.MOUSEDOWN, clientBehaviors, |
234 | |
HTML.ONMOUSEDOWN_ATTR); |
235 | |
} |
236 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEUP_PROP) != 0 || |
237 | |
(commonEventsMarked & CommonEventConstants.MOUSEUP_EVENT) != 0) |
238 | |
{ |
239 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEUP_ATTR, |
240 | |
uiComponent, sourceId, ClientBehaviorEvents.MOUSEUP, |
241 | |
clientBehaviors, HTML.ONMOUSEUP_ATTR); |
242 | |
} |
243 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOVER_PROP) != 0 || |
244 | |
(commonEventsMarked & CommonEventConstants.MOUSEOVER_EVENT) != 0) |
245 | |
{ |
246 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
247 | |
HTML.ONMOUSEOVER_ATTR, uiComponent, sourceId, |
248 | |
ClientBehaviorEvents.MOUSEOVER, clientBehaviors, |
249 | |
HTML.ONMOUSEOVER_ATTR); |
250 | |
} |
251 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEMOVE_PROP) != 0 || |
252 | |
(commonEventsMarked & CommonEventConstants.MOUSEMOVE_EVENT) != 0) |
253 | |
{ |
254 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
255 | |
HTML.ONMOUSEMOVE_ATTR, uiComponent, sourceId, |
256 | |
ClientBehaviorEvents.MOUSEMOVE, clientBehaviors, |
257 | |
HTML.ONMOUSEMOVE_ATTR); |
258 | |
} |
259 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOUT_PROP) != 0 || |
260 | |
(commonEventsMarked & CommonEventConstants.MOUSEOUT_EVENT) != 0) |
261 | |
{ |
262 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEOUT_ATTR, |
263 | |
uiComponent, sourceId, ClientBehaviorEvents.MOUSEOUT, |
264 | |
clientBehaviors, HTML.ONMOUSEOUT_ATTR); |
265 | |
} |
266 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYPRESS_PROP) != 0 || |
267 | |
(commonEventsMarked & CommonEventConstants.KEYPRESS_EVENT) != 0) |
268 | |
{ |
269 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYPRESS_ATTR, |
270 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYPRESS, |
271 | |
clientBehaviors, HTML.ONKEYPRESS_ATTR); |
272 | |
} |
273 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYDOWN_PROP) != 0 || |
274 | |
(commonEventsMarked & CommonEventConstants.KEYDOWN_EVENT) != 0) |
275 | |
{ |
276 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYDOWN_ATTR, |
277 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYDOWN, |
278 | |
clientBehaviors, HTML.ONKEYDOWN_ATTR); |
279 | |
} |
280 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYUP_PROP) != 0 || |
281 | |
(commonEventsMarked & CommonEventConstants.KEYUP_EVENT) != 0) |
282 | |
{ |
283 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYUP_ATTR, |
284 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYUP, |
285 | |
clientBehaviors, HTML.ONKEYUP_ATTR); |
286 | |
} |
287 | 0 | } |
288 | |
|
289 | |
public static void renderBehaviorizedEventHandlersWithoutOnclick( |
290 | |
FacesContext facesContext, ResponseWriter writer, |
291 | |
long commonPropertiesMarked, long commonEventsMarked, |
292 | |
UIComponent uiComponent, |
293 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
294 | |
throws IOException |
295 | |
{ |
296 | 0 | renderBehaviorizedEventHandlersWithoutOnclick(facesContext, writer, |
297 | |
commonPropertiesMarked, commonEventsMarked, uiComponent, |
298 | |
null, clientBehaviors); |
299 | 0 | } |
300 | |
|
301 | |
|
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
public static void renderBehaviorizedEventHandlersWithoutOnclick( |
310 | |
FacesContext facesContext, ResponseWriter writer, |
311 | |
long commonPropertiesMarked, long commonEventsMarked, |
312 | |
UIComponent uiComponent, String sourceId, |
313 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
314 | |
throws IOException |
315 | |
{ |
316 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONDBLCLICK_PROP) != 0 || |
317 | |
(commonEventsMarked & CommonEventConstants.DBLCLICK_EVENT) != 0) |
318 | |
{ |
319 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONDBLCLICK_ATTR, |
320 | |
uiComponent, sourceId, ClientBehaviorEvents.DBLCLICK, |
321 | |
clientBehaviors, HTML.ONDBLCLICK_ATTR); |
322 | |
} |
323 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEDOWN_PROP) != 0 || |
324 | |
(commonEventsMarked & CommonEventConstants.MOUSEDOWN_EVENT) != 0) |
325 | |
{ |
326 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
327 | |
HTML.ONMOUSEDOWN_ATTR, uiComponent, sourceId, |
328 | |
ClientBehaviorEvents.MOUSEDOWN, clientBehaviors, |
329 | |
HTML.ONMOUSEDOWN_ATTR); |
330 | |
} |
331 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEUP_PROP) != 0 || |
332 | |
(commonEventsMarked & CommonEventConstants.MOUSEUP_EVENT) != 0) |
333 | |
{ |
334 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEUP_ATTR, |
335 | |
uiComponent, sourceId, ClientBehaviorEvents.MOUSEUP, |
336 | |
clientBehaviors, HTML.ONMOUSEUP_ATTR); |
337 | |
} |
338 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOVER_PROP) != 0 || |
339 | |
(commonEventsMarked & CommonEventConstants.MOUSEOVER_EVENT) != 0) |
340 | |
{ |
341 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
342 | |
HTML.ONMOUSEOVER_ATTR, uiComponent, sourceId, |
343 | |
ClientBehaviorEvents.MOUSEOVER, clientBehaviors, |
344 | |
HTML.ONMOUSEOVER_ATTR); |
345 | |
} |
346 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEMOVE_PROP) != 0 || |
347 | |
(commonEventsMarked & CommonEventConstants.MOUSEMOVE_EVENT) != 0) |
348 | |
{ |
349 | 0 | renderBehaviorizedAttribute(facesContext, writer, |
350 | |
HTML.ONMOUSEMOVE_ATTR, uiComponent, sourceId, |
351 | |
ClientBehaviorEvents.MOUSEMOVE, clientBehaviors, |
352 | |
HTML.ONMOUSEMOVE_ATTR); |
353 | |
} |
354 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOUT_PROP) != 0 || |
355 | |
(commonEventsMarked & CommonEventConstants.MOUSEOUT_EVENT) != 0) |
356 | |
{ |
357 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEOUT_ATTR, |
358 | |
uiComponent, sourceId, ClientBehaviorEvents.MOUSEOUT, |
359 | |
clientBehaviors, HTML.ONMOUSEOUT_ATTR); |
360 | |
} |
361 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYPRESS_PROP) != 0 || |
362 | |
(commonEventsMarked & CommonEventConstants.KEYPRESS_EVENT) != 0) |
363 | |
{ |
364 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYPRESS_ATTR, |
365 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYPRESS, |
366 | |
clientBehaviors, HTML.ONKEYPRESS_ATTR); |
367 | |
} |
368 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYDOWN_PROP) != 0 || |
369 | |
(commonEventsMarked & CommonEventConstants.KEYDOWN_EVENT) != 0) |
370 | |
{ |
371 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYDOWN_ATTR, |
372 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYDOWN, |
373 | |
clientBehaviors, HTML.ONKEYDOWN_ATTR); |
374 | |
} |
375 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYUP_PROP) != 0 || |
376 | |
(commonEventsMarked & CommonEventConstants.KEYUP_EVENT) != 0) |
377 | |
{ |
378 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYUP_ATTR, |
379 | |
uiComponent, sourceId, ClientBehaviorEvents.KEYUP, |
380 | |
clientBehaviors, HTML.ONKEYUP_ATTR); |
381 | |
} |
382 | 0 | } |
383 | |
|
384 | |
|
385 | |
|
386 | |
|
387 | |
|
388 | |
|
389 | |
|
390 | |
|
391 | |
|
392 | |
public static void renderBehaviorizedFieldEventHandlers( |
393 | |
FacesContext facesContext, ResponseWriter writer, |
394 | |
long commonPropertiesMarked, long commonEventsMarked, |
395 | |
UIComponent uiComponent, String sourceId, |
396 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
397 | |
throws IOException |
398 | |
{ |
399 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0 || |
400 | |
(commonEventsMarked & CommonEventConstants.FOCUS_EVENT) != 0) |
401 | |
{ |
402 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONFOCUS_ATTR, |
403 | |
uiComponent, sourceId, ClientBehaviorEvents.FOCUS, clientBehaviors, |
404 | |
HTML.ONFOCUS_ATTR); |
405 | |
} |
406 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONBLUR_PROP) != 0 || |
407 | |
(commonEventsMarked & CommonEventConstants.BLUR_EVENT) != 0) |
408 | |
{ |
409 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONBLUR_ATTR, |
410 | |
uiComponent, sourceId, ClientBehaviorEvents.BLUR, clientBehaviors, |
411 | |
HTML.ONBLUR_ATTR); |
412 | |
} |
413 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONCHANGE_PROP) != 0 || |
414 | |
(commonEventsMarked & CommonEventConstants.CHANGE_EVENT) != 0) |
415 | |
{ |
416 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONCHANGE_ATTR, |
417 | |
uiComponent, sourceId, ClientBehaviorEvents.CHANGE, clientBehaviors, |
418 | |
HTML.ONCHANGE_ATTR); |
419 | |
} |
420 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONSELECT_PROP) != 0 || |
421 | |
(commonEventsMarked & CommonEventConstants.SELECT_EVENT) != 0) |
422 | |
{ |
423 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONSELECT_ATTR, |
424 | |
uiComponent, sourceId, ClientBehaviorEvents.SELECT, clientBehaviors, |
425 | |
HTML.ONSELECT_ATTR); |
426 | |
} |
427 | 0 | } |
428 | |
|
429 | |
public static void renderBehaviorizedFieldEventHandlersWithoutOnfocus( |
430 | |
FacesContext facesContext, ResponseWriter writer, |
431 | |
long commonPropertiesMarked, long commonEventsMarked, |
432 | |
UIComponent uiComponent, String sourceId, |
433 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
434 | |
throws IOException |
435 | |
{ |
436 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONBLUR_PROP) != 0 || |
437 | |
(commonEventsMarked & CommonEventConstants.BLUR_EVENT) != 0) |
438 | |
{ |
439 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONBLUR_ATTR, |
440 | |
uiComponent, sourceId, ClientBehaviorEvents.BLUR, clientBehaviors, |
441 | |
HTML.ONBLUR_ATTR); |
442 | |
} |
443 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONCHANGE_PROP) != 0 || |
444 | |
(commonEventsMarked & CommonEventConstants.CHANGE_EVENT) != 0) |
445 | |
{ |
446 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONCHANGE_ATTR, |
447 | |
uiComponent, sourceId, ClientBehaviorEvents.CHANGE, clientBehaviors, |
448 | |
HTML.ONCHANGE_ATTR); |
449 | |
} |
450 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONSELECT_PROP) != 0 || |
451 | |
(commonEventsMarked & CommonEventConstants.SELECT_EVENT) != 0) |
452 | |
{ |
453 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONSELECT_ATTR, |
454 | |
uiComponent, sourceId, ClientBehaviorEvents.SELECT, clientBehaviors, |
455 | |
HTML.ONSELECT_ATTR); |
456 | |
} |
457 | 0 | } |
458 | |
|
459 | |
public static void renderBehaviorizedFieldEventHandlersWithoutOnchange( |
460 | |
FacesContext facesContext, ResponseWriter writer, |
461 | |
long commonPropertiesMarked, long commonEventsMarked, |
462 | |
UIComponent uiComponent, |
463 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
464 | |
throws IOException |
465 | |
{ |
466 | 0 | renderBehaviorizedFieldEventHandlersWithoutOnchange( |
467 | |
facesContext, writer, commonPropertiesMarked, commonEventsMarked, |
468 | |
uiComponent, null, clientBehaviors); |
469 | 0 | } |
470 | |
|
471 | |
public static void renderBehaviorizedFieldEventHandlersWithoutOnchange( |
472 | |
FacesContext facesContext, ResponseWriter writer, |
473 | |
long commonPropertiesMarked, long commonEventsMarked, |
474 | |
UIComponent uiComponent, String sourceId, |
475 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
476 | |
throws IOException |
477 | |
{ |
478 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0 || |
479 | |
(commonEventsMarked & CommonEventConstants.FOCUS_EVENT) != 0) |
480 | |
{ |
481 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONFOCUS_ATTR, |
482 | |
uiComponent, sourceId, ClientBehaviorEvents.FOCUS, clientBehaviors, |
483 | |
HTML.ONFOCUS_ATTR); |
484 | |
} |
485 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONBLUR_PROP) != 0 || |
486 | |
(commonEventsMarked & CommonEventConstants.BLUR_EVENT) != 0) |
487 | |
{ |
488 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONBLUR_ATTR, |
489 | |
uiComponent, sourceId, ClientBehaviorEvents.BLUR, clientBehaviors, |
490 | |
HTML.ONBLUR_ATTR); |
491 | |
} |
492 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONSELECT_PROP) != 0 || |
493 | |
(commonEventsMarked & CommonEventConstants.SELECT_EVENT) != 0) |
494 | |
{ |
495 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONSELECT_ATTR, |
496 | |
uiComponent, sourceId, ClientBehaviorEvents.SELECT, clientBehaviors, |
497 | |
HTML.ONSELECT_ATTR); |
498 | |
} |
499 | 0 | } |
500 | |
|
501 | |
public static void renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect( |
502 | |
FacesContext facesContext, ResponseWriter writer, |
503 | |
long commonPropertiesMarked, long commonEventsMarked, |
504 | |
UIComponent uiComponent, |
505 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
506 | |
throws IOException |
507 | |
{ |
508 | 0 | renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect( |
509 | |
facesContext, writer, |
510 | |
commonPropertiesMarked, commonEventsMarked, |
511 | |
uiComponent, null, |
512 | |
clientBehaviors); |
513 | 0 | } |
514 | |
|
515 | |
public static void renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect( |
516 | |
FacesContext facesContext, ResponseWriter writer, |
517 | |
long commonPropertiesMarked, long commonEventsMarked, |
518 | |
UIComponent uiComponent, String sourceId, |
519 | |
Map<String, List<ClientBehavior>> clientBehaviors) |
520 | |
throws IOException |
521 | |
{ |
522 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0 || |
523 | |
(commonEventsMarked & CommonEventConstants.FOCUS_EVENT) != 0) |
524 | |
{ |
525 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONFOCUS_ATTR, |
526 | |
uiComponent, sourceId, ClientBehaviorEvents.FOCUS, clientBehaviors, |
527 | |
HTML.ONFOCUS_ATTR); |
528 | |
} |
529 | 0 | if ((commonPropertiesMarked & CommonPropertyConstants.ONBLUR_PROP) != 0 || |
530 | |
(commonEventsMarked & CommonEventConstants.BLUR_EVENT) != 0) |
531 | |
{ |
532 | 0 | renderBehaviorizedAttribute(facesContext, writer, HTML.ONBLUR_ATTR, |
533 | |
uiComponent, sourceId, ClientBehaviorEvents.BLUR, clientBehaviors, |
534 | |
HTML.ONBLUR_ATTR); |
535 | |
} |
536 | 0 | } |
537 | |
} |