View Javadoc

1   // WARNING: This file was automatically generated. Do not edit it directly,
2   //          or you will lose your changes.
3   
4   /*
5    * Licensed to the Apache Software Foundation (ASF) under one
6    * or more contributor license agreements.  See the NOTICE file
7    * distributed with this work for additional information
8    * regarding copyright ownership.  The ASF licenses this file
9    * to you under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License.  You may obtain a copy of the License at
12   *
13   *   http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on an
17   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied.  See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
21  */
22  package org.apache.myfaces.trinidad.component;
23  
24  import javax.faces.context.FacesContext;
25  import org.apache.myfaces.trinidad.bean.FacesBean;
26  import org.apache.myfaces.trinidad.bean.PropertyKey;
27  import org.apache.myfaces.trinidad.util.ComponentUtils;
28  
29  /**
30   *
31   * <h4>Events:</h4>
32   * <table border="1" width="100%" cellpadding="3" summary="">
33   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
34   * <th align="left">Type</th>
35   * <th align="left">Phases</th>
36   * <th align="left">Description</th>
37   * </tr>
38   * <tr class="TableRowColor">
39   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
40   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
41   * <td valign="top">Event delivered to describe an attribute change.  Attribute change events are not delivered for any programmatic change to a property.  They are only delivered when a renderer changes a property without the application's specific request.  An example of an attribute change event might include the width of a column that supported client-side resizing.</td>
42   * </tr>
43   * </table>
44   */
45  public class UIXForm extends UIXComponentBase
46  {
47    static public final FacesBean.Type TYPE = new FacesBean.Type(
48      UIXComponentBase.TYPE);
49    static public final PropertyKey SUBMITTED_KEY =
50      TYPE.registerKey("submitted", Boolean.class, Boolean.FALSE, PropertyKey.CAP_TRANSIENT);
51  
52    static public final String COMPONENT_FAMILY =
53      "org.apache.myfaces.trinidad.Form";
54    static public final String COMPONENT_TYPE =
55      "org.apache.myfaces.trinidad.Form";
56  
57    /**
58     * Construct an instance of the UIXForm.
59     */
60    public UIXForm()
61    {
62      super("org.apache.myfaces.trinidad.Form");
63    }
64      
65    @Override
66    public void processDecodes(FacesContext context)
67    {
68      if (!isRendered())
69        return;
70  
71      decode(context);
72      if (!isSubmitted())
73        return;
74  
75      decodeChildren(context);
76    }
77  
78    @Override
79    public void processValidators(FacesContext context)
80    {
81      if (isSubmitted())
82        super.processValidators(context);
83    }
84  
85    @Override
86    public void processUpdates(FacesContext context)
87    {
88      if (isSubmitted())
89        super.processUpdates(context);
90    }
91  
92    /**
93     * Gets whether the form was submitted on this request
94     *
95     * @return  the new submitted value
96     */
97    final public boolean isSubmitted()
98    {
99      return ComponentUtils.resolveBoolean(getProperty(SUBMITTED_KEY), false);
100   }
101 
102   /**
103    * Sets whether the form was submitted on this request
104    * 
105    * @param submitted  the new submitted value
106    */
107   final public void setSubmitted(boolean submitted)
108   {
109     setProperty(SUBMITTED_KEY, submitted ? Boolean.TRUE : Boolean.FALSE);
110   }
111 
112   @Override
113   public String getFamily()
114   {
115     return COMPONENT_FAMILY;
116   }
117 
118   @Override
119   protected FacesBean.Type getBeanType()
120   {
121     return TYPE;
122   }
123 
124   /**
125    * Construct an instance of the UIXForm.
126    */
127   protected UIXForm(
128     String rendererType
129     )
130   {
131     super(rendererType);
132   }
133 
134   static
135   {
136     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Form","org.apache.myfaces.trinidad.Form");
137   }
138 }