001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package com.sun.rave.web.ui.component;
042:
043: import java.io.IOException;
044: import javax.faces.component.UIComponent;
045: import javax.faces.context.FacesContext;
046: import javax.faces.el.MethodBinding;
047: import javax.faces.el.ValueBinding;
048:
049: /**
050: * <p>Use the <code>ui:form</code> tag
051: * to create an HTML <code><form></code> element. The form can be submitted
052: * via a button or hyperlink control (in which case an <code>ActionEvent</code>
053: * will be generated on the server), or via client side scripting.</p>
054: * <p>The <code>virtualFormsConfig</code> attribute can be used to configure
055: * virtual forms.
056: * A <i>virtual form</i> defines a group of input components
057: * ("participants") and submission components ("submitters")
058: * on a page, such that when the user interacts with one of the submitters, the participants
059: * are processed exclusively while the remaining inputs on the page are ignored.
060: * An <i>input component</i> is any
061: * component that implements <code>EditableValueHolder</code>. A
062: * <i>submission component</i>
063: * is any component that causes the web page to be submitted (such as a button,
064: * hyperlink, or any input component that submits the page via the
065: * <code>common_timeoutSubmitForm</code> scripting function).
066: * <i>Processing </i>an input means converting and validating it, firing
067: * any value change events associated with the input, and mapping the input onto
068: * its binding target (if the component is bound). Virtual forms provide an
069: * alternative to the <code>immediate</code> property.
070: * They are more powerful than <code>immediate</code> because they let you
071: * specify multiple groups of inputs to be selectively processed (that is, you
072: * can specify multiple virtual forms on a page). They are also easier to use
073: * than <code>immediate</code> because they do not alter
074: * the JavaServer Faces lifecycle.</p>
075: * <br>
076: * <h3>HTML Elements and Layout</h3>
077: * The rendered HTML page contains an
078: * HTML <code><form></code> tag and its associated
079: * attributes. The rendered
080: * form includes a hidden field for use in
081: * determining which form submitted the page.</p><br>
082: * <h3>Client Side Javascript Functions</h3>
083: * None.
084: * <br>
085: * <h3>Examples</h3>
086: * <h4>Example 1: Using a Form<br>
087: * </h4>
088: * <code><ui:page><br>
089: * <ui:html><br>
090: * <ui:head id="head"
091: * title="Hyperlink Test Page" /><br>
092: * <ui:body><br>
093: *
094: * <ui:form id="form1"><br>
095: *
096: * <ui:hyperlink
097: * id="hyperlinkSubmitsPage" <br>
098: *
099: * label="#{HyperlinkBean.label}" <br>
100: *
101: * action="#{HyperlinkBean.determineWhatToDoFunction}" /><br>
102: *
103: * </ui:form><br>
104: * </ui:body><br>
105: * </ui:html><br>
106: * </ui:page></code><br>
107: * <h4>Example 2: A Page with Three Virtual Forms<br>
108: * </h4>
109: * <code><ui:page><br>
110: * <ui:html><br>
111: * <ui:head id="head"
112: * title="Shipping and Billing Information" /><br>
113: * <ui:body><br>
114: *
115: * <ui:form id="form1" virtualFormsConfig="shipping | shippingAddressTextField
116: * | updateShippingButton , creditCard | creditCardDropDown | creditCardDropDown ,
117: * billing | billingAddressTextfield creditCardDropDown | updateBillingButton">
118: * <br>
119: *
120: *
121: * <ui:label for="shippingAddressTextField" id="shippingAddressLabel"
122: * style="left: 48px; top: 48px; position: absolute" text="Shipping Address:"/>
123: * <br>
124: *
125: *
126: * <ui:textField id="shippingAddressTextField" required="true"
127: * style="left: 48px; top: 72px; position: absolute"/>
128: *
129: *
130: * <br>
131: *
132: *
133: * <ui:button id="updateShippingButton" style="left: 48px; top: 120px;
134: * position: absolute" text="Update Shipping Address"/>
135: * <br>
136: *
137: *
138: * <ui:label id="creditCardLabel" for="creditCardDropDown"
139: * style="left: 48px; top: 192px; position: absolute"
140: * text="Credit Card to Use:"/>
141: * <br>
142: *
143: *
144: * <ui:dropDown id="creditCardDropDown"
145: * items="#{SessionBean1.creditCards}" style="left: 48px; top: 216px;
146: * position: absolute"/>
147: * <br>
148: *
149: *
150: * <ui:label id="billingAddressLabel" for="billingAddressTextfield"
151: * style="left: 48px; top: 264px; position: absolute"
152: * text="Credit Card Billing Address:"/>
153: * <br>
154: *
155: *
156: * <ui:textField id="billingAddressTextfield" required="true"
157: * style="left: 48px; top: 288px; position: absolute"/>
158: * <br>
159: *
160: *
161: * <ui:button id="updateBillingButton" style="left: 48px; top: 336px;
162: * position: absolute" text="Update Billing Address"/>
163: * <br>
164: *
165: *
166: * <ui:button id="updateAllButton" style="left: 48px; top: 432px; position:
167: * absolute" text="Update All Information"/>
168: * <br>
169: *
170: * </ui:form><br>
171: * </ui:body><br>
172: * </ui:html><br>
173: * </ui:page></code><br>
174: * <p>Auto-generated component class.
175: * Do <strong>NOT</strong> modify; all changes
176: * <strong>will</strong> be lost!</p>
177: */
178:
179: public abstract class FormBase extends javax.faces.component.UIForm {
180:
181: /**
182: * <p>Construct a new <code>FormBase</code>.</p>
183: */
184: public FormBase() {
185: super ();
186: setRendererType("com.sun.rave.web.ui.Form");
187: }
188:
189: /**
190: * <p>Return the identifier of the component family to which this
191: * component belongs. This identifier, in conjunction with the value
192: * of the <code>rendererType</code> property, may be used to select
193: * the appropriate {@link Renderer} for this component instance.</p>
194: */
195: public String getFamily() {
196: return "com.sun.rave.web.ui.Form";
197: }
198:
199: // autoComplete
200: private boolean autoComplete = false;
201: private boolean autoComplete_set = false;
202:
203: /**
204: * <p>Use this non-XHTML compliant boolean attribute to turn off autocompletion
205: * feature of Internet Explorer and Firefox browsers. Set to "false" to
206: * turn off completion. The default is "true".</p>
207: */
208: public boolean isAutoComplete() {
209: if (this .autoComplete_set) {
210: return this .autoComplete;
211: }
212: ValueBinding _vb = getValueBinding("autoComplete");
213: if (_vb != null) {
214: Object _result = _vb.getValue(getFacesContext());
215: if (_result == null) {
216: return false;
217: } else {
218: return ((Boolean) _result).booleanValue();
219: }
220: }
221: return true;
222: }
223:
224: /**
225: * <p>Use this non-XHTML compliant boolean attribute to turn off autocompletion
226: * feature of Internet Explorer and Firefox browsers. Set to "false" to
227: * turn off completion. The default is "true".</p>
228: * @see #isAutoComplete()
229: */
230: public void setAutoComplete(boolean autoComplete) {
231: this .autoComplete = autoComplete;
232: this .autoComplete_set = true;
233: }
234:
235: // enctype
236: private String enctype = null;
237:
238: /**
239: * <p>Use this attribute to set the content-type of the HTTP request
240: * generated by this form. You do not normally need to set this
241: * attribute. Its default value is
242: * application/x-www-form-urlencoded. If there is an upload tag
243: * inside the form, the upload tag will modify the form's enctype
244: * attribute to multipart/form-data.</p>
245: */
246: public String getEnctype() {
247: if (this .enctype != null) {
248: return this .enctype;
249: }
250: ValueBinding _vb = getValueBinding("enctype");
251: if (_vb != null) {
252: return (String) _vb.getValue(getFacesContext());
253: }
254: return "application/x-www-form-urlencoded";
255: }
256:
257: /**
258: * <p>Use this attribute to set the content-type of the HTTP request
259: * generated by this form. You do not normally need to set this
260: * attribute. Its default value is
261: * application/x-www-form-urlencoded. If there is an upload tag
262: * inside the form, the upload tag will modify the form's enctype
263: * attribute to multipart/form-data.</p>
264: * @see #getEnctype()
265: */
266: public void setEnctype(String enctype) {
267: this .enctype = enctype;
268: }
269:
270: // internalVirtualForms
271: private com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] internalVirtualForms = null;
272:
273: /**
274: * <p>The virtual forms used "internally" by components (such as Table).
275: * Component authors can manipulate this set of virtual forms independent
276: * of the set exposed to developers. This set is only consulted after the
277: * set exposed to developers is consulted. A participating or submitting id
278: * can end in ":*" to indicate descendants. For example, table1:* can be
279: * used as a participating or submitting id to indicate all the descendants
280: * of table1.</p>
281: */
282: public com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] getInternalVirtualForms() {
283: return this .internalVirtualForms;
284: }
285:
286: /**
287: * <p>The virtual forms used "internally" by components (such as Table).
288: * Component authors can manipulate this set of virtual forms independent
289: * of the set exposed to developers. This set is only consulted after the
290: * set exposed to developers is consulted. A participating or submitting id
291: * can end in ":*" to indicate descendants. For example, table1:* can be
292: * used as a participating or submitting id to indicate all the descendants
293: * of table1.</p>
294: * @see #getInternalVirtualForms()
295: */
296: public void setInternalVirtualForms(
297: com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] internalVirtualForms) {
298: this .internalVirtualForms = internalVirtualForms;
299: }
300:
301: // onClick
302: private String onClick = null;
303:
304: /**
305: * <p>Scripting code executed when a mouse click
306: * occurs over this component.</p>
307: */
308: public String getOnClick() {
309: if (this .onClick != null) {
310: return this .onClick;
311: }
312: ValueBinding _vb = getValueBinding("onClick");
313: if (_vb != null) {
314: return (String) _vb.getValue(getFacesContext());
315: }
316: return null;
317: }
318:
319: /**
320: * <p>Scripting code executed when a mouse click
321: * occurs over this component.</p>
322: * @see #getOnClick()
323: */
324: public void setOnClick(String onClick) {
325: this .onClick = onClick;
326: }
327:
328: // onDblClick
329: private String onDblClick = null;
330:
331: /**
332: * <p>Scripting code executed when a mouse double click
333: * occurs over this component.</p>
334: */
335: public String getOnDblClick() {
336: if (this .onDblClick != null) {
337: return this .onDblClick;
338: }
339: ValueBinding _vb = getValueBinding("onDblClick");
340: if (_vb != null) {
341: return (String) _vb.getValue(getFacesContext());
342: }
343: return null;
344: }
345:
346: /**
347: * <p>Scripting code executed when a mouse double click
348: * occurs over this component.</p>
349: * @see #getOnDblClick()
350: */
351: public void setOnDblClick(String onDblClick) {
352: this .onDblClick = onDblClick;
353: }
354:
355: // onKeyDown
356: private String onKeyDown = null;
357:
358: /**
359: * <p>Scripting code executed when the user presses down on a key while the
360: * component has focus.</p>
361: */
362: public String getOnKeyDown() {
363: if (this .onKeyDown != null) {
364: return this .onKeyDown;
365: }
366: ValueBinding _vb = getValueBinding("onKeyDown");
367: if (_vb != null) {
368: return (String) _vb.getValue(getFacesContext());
369: }
370: return null;
371: }
372:
373: /**
374: * <p>Scripting code executed when the user presses down on a key while the
375: * component has focus.</p>
376: * @see #getOnKeyDown()
377: */
378: public void setOnKeyDown(String onKeyDown) {
379: this .onKeyDown = onKeyDown;
380: }
381:
382: // onKeyPress
383: private String onKeyPress = null;
384:
385: /**
386: * <p>Scripting code executed when the user presses and releases a key while
387: * the component has focus.</p>
388: */
389: public String getOnKeyPress() {
390: if (this .onKeyPress != null) {
391: return this .onKeyPress;
392: }
393: ValueBinding _vb = getValueBinding("onKeyPress");
394: if (_vb != null) {
395: return (String) _vb.getValue(getFacesContext());
396: }
397: return null;
398: }
399:
400: /**
401: * <p>Scripting code executed when the user presses and releases a key while
402: * the component has focus.</p>
403: * @see #getOnKeyPress()
404: */
405: public void setOnKeyPress(String onKeyPress) {
406: this .onKeyPress = onKeyPress;
407: }
408:
409: // onKeyUp
410: private String onKeyUp = null;
411:
412: /**
413: * <p>Scripting code executed when the user releases a key while the
414: * component has focus.</p>
415: */
416: public String getOnKeyUp() {
417: if (this .onKeyUp != null) {
418: return this .onKeyUp;
419: }
420: ValueBinding _vb = getValueBinding("onKeyUp");
421: if (_vb != null) {
422: return (String) _vb.getValue(getFacesContext());
423: }
424: return null;
425: }
426:
427: /**
428: * <p>Scripting code executed when the user releases a key while the
429: * component has focus.</p>
430: * @see #getOnKeyUp()
431: */
432: public void setOnKeyUp(String onKeyUp) {
433: this .onKeyUp = onKeyUp;
434: }
435:
436: // onMouseDown
437: private String onMouseDown = null;
438:
439: /**
440: * <p>Scripting code executed when the user presses a mouse button while the
441: * mouse pointer is on the component.</p>
442: */
443: public String getOnMouseDown() {
444: if (this .onMouseDown != null) {
445: return this .onMouseDown;
446: }
447: ValueBinding _vb = getValueBinding("onMouseDown");
448: if (_vb != null) {
449: return (String) _vb.getValue(getFacesContext());
450: }
451: return null;
452: }
453:
454: /**
455: * <p>Scripting code executed when the user presses a mouse button while the
456: * mouse pointer is on the component.</p>
457: * @see #getOnMouseDown()
458: */
459: public void setOnMouseDown(String onMouseDown) {
460: this .onMouseDown = onMouseDown;
461: }
462:
463: // onMouseMove
464: private String onMouseMove = null;
465:
466: /**
467: * <p>Scripting code executed when the user moves the mouse pointer while
468: * over the component.</p>
469: */
470: public String getOnMouseMove() {
471: if (this .onMouseMove != null) {
472: return this .onMouseMove;
473: }
474: ValueBinding _vb = getValueBinding("onMouseMove");
475: if (_vb != null) {
476: return (String) _vb.getValue(getFacesContext());
477: }
478: return null;
479: }
480:
481: /**
482: * <p>Scripting code executed when the user moves the mouse pointer while
483: * over the component.</p>
484: * @see #getOnMouseMove()
485: */
486: public void setOnMouseMove(String onMouseMove) {
487: this .onMouseMove = onMouseMove;
488: }
489:
490: // onMouseOut
491: private String onMouseOut = null;
492:
493: /**
494: * <p>Scripting code executed when a mouse out movement
495: * occurs over this component.</p>
496: */
497: public String getOnMouseOut() {
498: if (this .onMouseOut != null) {
499: return this .onMouseOut;
500: }
501: ValueBinding _vb = getValueBinding("onMouseOut");
502: if (_vb != null) {
503: return (String) _vb.getValue(getFacesContext());
504: }
505: return null;
506: }
507:
508: /**
509: * <p>Scripting code executed when a mouse out movement
510: * occurs over this component.</p>
511: * @see #getOnMouseOut()
512: */
513: public void setOnMouseOut(String onMouseOut) {
514: this .onMouseOut = onMouseOut;
515: }
516:
517: // onMouseOver
518: private String onMouseOver = null;
519:
520: /**
521: * <p>Scripting code executed when the user moves the mouse pointer into
522: * the boundary of this component.</p>
523: */
524: public String getOnMouseOver() {
525: if (this .onMouseOver != null) {
526: return this .onMouseOver;
527: }
528: ValueBinding _vb = getValueBinding("onMouseOver");
529: if (_vb != null) {
530: return (String) _vb.getValue(getFacesContext());
531: }
532: return null;
533: }
534:
535: /**
536: * <p>Scripting code executed when the user moves the mouse pointer into
537: * the boundary of this component.</p>
538: * @see #getOnMouseOver()
539: */
540: public void setOnMouseOver(String onMouseOver) {
541: this .onMouseOver = onMouseOver;
542: }
543:
544: // onMouseUp
545: private String onMouseUp = null;
546:
547: /**
548: * <p>Scripting code executed when the user releases a mouse button while
549: * the mouse pointer is on the component.</p>
550: */
551: public String getOnMouseUp() {
552: if (this .onMouseUp != null) {
553: return this .onMouseUp;
554: }
555: ValueBinding _vb = getValueBinding("onMouseUp");
556: if (_vb != null) {
557: return (String) _vb.getValue(getFacesContext());
558: }
559: return null;
560: }
561:
562: /**
563: * <p>Scripting code executed when the user releases a mouse button while
564: * the mouse pointer is on the component.</p>
565: * @see #getOnMouseUp()
566: */
567: public void setOnMouseUp(String onMouseUp) {
568: this .onMouseUp = onMouseUp;
569: }
570:
571: // onReset
572: private String onReset = null;
573:
574: /**
575: * <p>Scripting code executed when this form is reset.</p>
576: */
577: public String getOnReset() {
578: if (this .onReset != null) {
579: return this .onReset;
580: }
581: ValueBinding _vb = getValueBinding("onReset");
582: if (_vb != null) {
583: return (String) _vb.getValue(getFacesContext());
584: }
585: return null;
586: }
587:
588: /**
589: * <p>Scripting code executed when this form is reset.</p>
590: * @see #getOnReset()
591: */
592: public void setOnReset(String onReset) {
593: this .onReset = onReset;
594: }
595:
596: // onSubmit
597: private String onSubmit = null;
598:
599: /**
600: * <p>Scripting code executed when this form is submitted.</p>
601: */
602: public String getOnSubmit() {
603: if (this .onSubmit != null) {
604: return this .onSubmit;
605: }
606: ValueBinding _vb = getValueBinding("onSubmit");
607: if (_vb != null) {
608: return (String) _vb.getValue(getFacesContext());
609: }
610: return null;
611: }
612:
613: /**
614: * <p>Scripting code executed when this form is submitted.</p>
615: * @see #getOnSubmit()
616: */
617: public void setOnSubmit(String onSubmit) {
618: this .onSubmit = onSubmit;
619: }
620:
621: // style
622: private String style = null;
623:
624: /**
625: * <p>CSS style(s) to be applied when this component is rendered.</p>
626: */
627: public String getStyle() {
628: if (this .style != null) {
629: return this .style;
630: }
631: ValueBinding _vb = getValueBinding("style");
632: if (_vb != null) {
633: return (String) _vb.getValue(getFacesContext());
634: }
635: return null;
636: }
637:
638: /**
639: * <p>CSS style(s) to be applied when this component is rendered.</p>
640: * @see #getStyle()
641: */
642: public void setStyle(String style) {
643: this .style = style;
644: }
645:
646: // styleClass
647: private String styleClass = null;
648:
649: /**
650: * <p>CSS style class(es) to be applied when this component is rendered.</p>
651: */
652: public String getStyleClass() {
653: if (this .styleClass != null) {
654: return this .styleClass;
655: }
656: ValueBinding _vb = getValueBinding("styleClass");
657: if (_vb != null) {
658: return (String) _vb.getValue(getFacesContext());
659: }
660: return null;
661: }
662:
663: /**
664: * <p>CSS style class(es) to be applied when this component is rendered.</p>
665: * @see #getStyleClass()
666: */
667: public void setStyleClass(String styleClass) {
668: this .styleClass = styleClass;
669: }
670:
671: // target
672: private String target = null;
673:
674: /**
675: * <p>The form's target window.</p>
676: */
677: public String getTarget() {
678: if (this .target != null) {
679: return this .target;
680: }
681: ValueBinding _vb = getValueBinding("target");
682: if (_vb != null) {
683: return (String) _vb.getValue(getFacesContext());
684: }
685: return null;
686: }
687:
688: /**
689: * <p>The form's target window.</p>
690: * @see #getTarget()
691: */
692: public void setTarget(String target) {
693: this .target = target;
694: }
695:
696: // virtualForms
697: private com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] virtualForms = null;
698:
699: /**
700: * <p>The virtual forms within this literal form, represented as an
701: * array of Form.VirtualFormDescriptor objects. This property
702: * and the "virtualFormsConfig" property are automatically kept
703: * in-sync.</p>
704: */
705: public com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] getVirtualForms() {
706: return this .virtualForms;
707: }
708:
709: /**
710: * <p>The virtual forms within this literal form, represented as an
711: * array of Form.VirtualFormDescriptor objects. This property
712: * and the "virtualFormsConfig" property are automatically kept
713: * in-sync.</p>
714: * @see #getVirtualForms()
715: */
716: public void setVirtualForms(
717: com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[] virtualForms) {
718: this .virtualForms = virtualForms;
719: }
720:
721: // virtualFormsConfig
722: private String virtualFormsConfig = null;
723:
724: /**
725: * <p>The configuration of the virtual forms within this literal form, represented as a String.
726: * Each virtual form is described by three parts, separated with pipe ("|") characters:
727: * the virtual form name, a space-separated list of component ids that participate in the
728: * virtual form, and a space-separated list of component ids that submit the virtual form.
729: * Multiple such virtual form "descriptors" are separated by commas. The component ids may
730: * be qualified (for instance, "table1:tableRowGroup1:tableColumn1:textField1").</p>
731: */
732: public String getVirtualFormsConfig() {
733: return this .virtualFormsConfig;
734: }
735:
736: /**
737: * <p>The configuration of the virtual forms within this literal form, represented as a String.
738: * Each virtual form is described by three parts, separated with pipe ("|") characters:
739: * the virtual form name, a space-separated list of component ids that participate in the
740: * virtual form, and a space-separated list of component ids that submit the virtual form.
741: * Multiple such virtual form "descriptors" are separated by commas. The component ids may
742: * be qualified (for instance, "table1:tableRowGroup1:tableColumn1:textField1").</p>
743: * @see #getVirtualFormsConfig()
744: */
745: public void setVirtualFormsConfig(String virtualFormsConfig) {
746: this .virtualFormsConfig = virtualFormsConfig;
747: }
748:
749: // visible
750: private boolean visible = false;
751: private boolean visible_set = false;
752:
753: /**
754: * <p>Use the visible attribute to indicate whether the component should be
755: * viewable by the user in the rendered HTML page.</p>
756: */
757: public boolean isVisible() {
758: if (this .visible_set) {
759: return this .visible;
760: }
761: ValueBinding _vb = getValueBinding("visible");
762: if (_vb != null) {
763: Object _result = _vb.getValue(getFacesContext());
764: if (_result == null) {
765: return false;
766: } else {
767: return ((Boolean) _result).booleanValue();
768: }
769: }
770: return true;
771: }
772:
773: /**
774: * <p>Use the visible attribute to indicate whether the component should be
775: * viewable by the user in the rendered HTML page.</p>
776: * @see #isVisible()
777: */
778: public void setVisible(boolean visible) {
779: this .visible = visible;
780: this .visible_set = true;
781: }
782:
783: /**
784: * <p>Restore the state of this component.</p>
785: */
786: public void restoreState(FacesContext _context, Object _state) {
787: Object _values[] = (Object[]) _state;
788: super .restoreState(_context, _values[0]);
789: this .autoComplete = ((Boolean) _values[1]).booleanValue();
790: this .autoComplete_set = ((Boolean) _values[2]).booleanValue();
791: this .enctype = (String) _values[3];
792: this .internalVirtualForms = (com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[]) _values[4];
793: this .onClick = (String) _values[5];
794: this .onDblClick = (String) _values[6];
795: this .onKeyDown = (String) _values[7];
796: this .onKeyPress = (String) _values[8];
797: this .onKeyUp = (String) _values[9];
798: this .onMouseDown = (String) _values[10];
799: this .onMouseMove = (String) _values[11];
800: this .onMouseOut = (String) _values[12];
801: this .onMouseOver = (String) _values[13];
802: this .onMouseUp = (String) _values[14];
803: this .onReset = (String) _values[15];
804: this .onSubmit = (String) _values[16];
805: this .style = (String) _values[17];
806: this .styleClass = (String) _values[18];
807: this .target = (String) _values[19];
808: this .virtualForms = (com.sun.rave.web.ui.component.Form.VirtualFormDescriptor[]) _values[20];
809: this .virtualFormsConfig = (String) _values[21];
810: this .visible = ((Boolean) _values[22]).booleanValue();
811: this .visible_set = ((Boolean) _values[23]).booleanValue();
812: }
813:
814: /**
815: * <p>Save the state of this component.</p>
816: */
817: public Object saveState(FacesContext _context) {
818: Object _values[] = new Object[24];
819: _values[0] = super .saveState(_context);
820: _values[1] = this .autoComplete ? Boolean.TRUE : Boolean.FALSE;
821: _values[2] = this .autoComplete_set ? Boolean.TRUE
822: : Boolean.FALSE;
823: _values[3] = this .enctype;
824: _values[4] = this .internalVirtualForms;
825: _values[5] = this .onClick;
826: _values[6] = this .onDblClick;
827: _values[7] = this .onKeyDown;
828: _values[8] = this .onKeyPress;
829: _values[9] = this .onKeyUp;
830: _values[10] = this .onMouseDown;
831: _values[11] = this .onMouseMove;
832: _values[12] = this .onMouseOut;
833: _values[13] = this .onMouseOver;
834: _values[14] = this .onMouseUp;
835: _values[15] = this .onReset;
836: _values[16] = this .onSubmit;
837: _values[17] = this .style;
838: _values[18] = this .styleClass;
839: _values[19] = this .target;
840: _values[20] = this .virtualForms;
841: _values[21] = this .virtualFormsConfig;
842: _values[22] = this .visible ? Boolean.TRUE : Boolean.FALSE;
843: _values[23] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
844: return _values;
845: }
846:
847: }
|