KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > faces > core > component > UIHiddenInput


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.faces.core.component;
6
7 import java.io.IOException JavaDoc ;
8 import javax.faces.context.FacesContext;
9 import javax.faces.context.ResponseWriter;
10
11 /**
12  * Wed, Dec 22, 2003 @ 23:14
13  * @author: Tuan Nguyen
14  * @email: tuan08@users.sourceforge.net
15  * @version: $Id: UIHiddenInput.java,v 1.3 2004/10/05 14:40:48 tuan08 Exp $
16  */

17 public class UIHiddenInput extends UIExoComponentBase {
18   protected String JavaDoc name_ ;
19   protected String JavaDoc value_ ;
20   protected String JavaDoc validateErrorMessage_ ;
21
22   public UIHiddenInput(String JavaDoc name, String JavaDoc value) {
23     name_ = name ;
24     value_ = value ;
25   }
26
27   final public String JavaDoc getName() { return name_; }
28   final public UIHiddenInput setName(String JavaDoc name) {
29     name_ = name ;
30     return this ;
31   }
32
33   final public String JavaDoc getValue() { return value_; }
34   final public UIHiddenInput setValue(String JavaDoc value) {
35     value_ = value ;
36     return this ;
37   }
38   
39   public String JavaDoc getValidateErrorMessage() { return validateErrorMessage_ ; }
40
41
42   final public void processDecodes(FacesContext context) {
43     decode(context) ;
44   }
45
46   public void encodeBegin(FacesContext context) throws IOException JavaDoc {
47     ResponseWriter w = context.getResponseWriter();
48     String JavaDoc value = value_ ;
49     if (value == null) value = "" ;
50     w.write("<input type='hidden' name='"); w.write(name_); w.write("'");
51     w.write(" value='"); w.write(value); w.write("'") ;
52     w.write("/>") ;
53   }
54
55   public void encodeChildren(FacesContext context) {
56   }
57
58   public void encodeEnd(FacesContext context) {
59   }
60 }
61
Popular Tags