Coverage Report - org.apache.myfaces.shared.renderkit.html.CommonEventUtils
 
Classes in this File Line Coverage Branch Coverage Complexity
CommonEventUtils
0%
0/89
0%
0/138
6.071
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 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  
      * Render an attribute taking into account the passed event and
 47  
      * the component property. It will be rendered as "componentProperty"
 48  
      * attribute.
 49  
      *
 50  
      * @param facesContext
 51  
      * @param writer
 52  
      * @param componentProperty
 53  
      * @param component
 54  
      * @param eventName
 55  
      * @param clientBehaviors
 56  
      * @return
 57  
      * @throws IOException
 58  
      * @since 4.0.1
 59  
      */
 60  
     /*
 61  
     public static boolean renderBehaviorizedAttribute(
 62  
             FacesContext facesContext, ResponseWriter writer,
 63  
             String componentProperty, UIComponent component, String eventName,
 64  
             Map<String, List<ClientBehavior>> clientBehaviors)
 65  
             throws IOException
 66  
     {
 67  
         return renderBehaviorizedAttribute(facesContext, writer,
 68  
                 componentProperty, component, eventName, clientBehaviors,
 69  
                 componentProperty);
 70  
     }
 71  
 
 72  
     public static boolean renderBehaviorizedAttribute(
 73  
             FacesContext facesContext, ResponseWriter writer,
 74  
             String componentProperty, UIComponent component,
 75  
             String sourceId, String eventName,
 76  
             Map<String, List<ClientBehavior>> clientBehaviors)
 77  
             throws IOException
 78  
     {
 79  
         return renderBehaviorizedAttribute(facesContext, writer,
 80  
                 componentProperty, component, sourceId, eventName,
 81  
                 clientBehaviors, componentProperty);
 82  
     }*/
 83  
 
 84  
     /**
 85  
      * Render an attribute taking into account the passed event and
 86  
      * the component property. The event will be rendered on the selected
 87  
      * htmlAttrName
 88  
      *
 89  
      * @param facesContext
 90  
      * @param writer
 91  
      * @param component
 92  
      * @param clientBehaviors
 93  
      * @param eventName
 94  
      * @param componentProperty
 95  
      * @param htmlAttrName
 96  
      * @return
 97  
      * @throws IOException
 98  
      * @since 4.0.1
 99  
      */
 100  
     /*
 101  
     public static boolean renderBehaviorizedAttribute(
 102  
             FacesContext facesContext, ResponseWriter writer,
 103  
             String componentProperty, UIComponent component, String eventName,
 104  
             Map<String, List<ClientBehavior>> clientBehaviors,
 105  
             String htmlAttrName) throws IOException
 106  
     {
 107  
         return renderBehaviorizedAttribute(facesContext, writer,
 108  
                 componentProperty, component, eventName, null, clientBehaviors,
 109  
                 htmlAttrName,
 110  
                 (String) component.getAttributes().get(componentProperty));
 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  
      * Render an attribute taking into account the passed event,
 128  
      * the component property and the passed attribute value for the component
 129  
      * property. The event will be rendered on the selected htmlAttrName.
 130  
      *
 131  
      * @param facesContext
 132  
      * @param writer
 133  
      * @param componentProperty
 134  
      * @param component
 135  
      * @param eventName
 136  
      * @param clientBehaviors
 137  
      * @param htmlAttrName
 138  
      * @param attributeValue
 139  
      * @return
 140  
      * @throws IOException
 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  
             //Only 1 behavior and attrValue == null, so just render it directly
 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  
      * @param facesContext
 303  
      * @param writer
 304  
      * @param uiComponent
 305  
      * @param clientBehaviors
 306  
      * @throws IOException
 307  
      * @since 4.0.0
 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  
      * @param facesContext
 386  
      * @param writer
 387  
      * @param uiComponent
 388  
      * @param clientBehaviors
 389  
      * @throws IOException
 390  
      * @since 4.0.0
 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  
 }