01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/mailtool/tags/sakai_2-4-1/mailtool/src/java/org/sakaiproject/tool/mailtool/SelectorComponent.java $
03: * $Id: SelectorComponent.java 27662 2007-03-22 19:44:57Z kimsooil@bu.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006, 2007 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.tool.mailtool;
21:
22: import java.io.IOException;
23: import java.util.Iterator;
24: import java.util.Map;
25:
26: import javax.faces.component.UIComponent;
27: import javax.faces.component.UIInput;
28: import javax.faces.component.UIOutput;
29: import javax.faces.context.FacesContext;
30: import javax.faces.context.ResponseWriter;
31:
32: /**
33: * @author sgithens
34: *
35: * TODO To change the template for this generated type comment go to
36: * Window - Preferences - Java - Code Style - Code Templates
37: */
38: public class SelectorComponent extends UIOutput {
39:
40: public SelectorComponent() {
41:
42: }
43:
44: public void encodeBegin(FacesContext context) throws IOException {
45: ResponseWriter writer = context.getResponseWriter();
46: String clientId = getClientId(context);
47:
48: writer.startElement("div", this );
49: writer.writeAttribute("id", "selectdiv", "");
50: writer.endElement("div");
51:
52: }
53:
54: public void decode(FacesContext context, UIComponent component) {
55: String clientId = component.getClientId(context);
56: Map requestParameterMap = context.getExternalContext()
57: .getRequestParameterMap();
58: //logger.debug("SWG:inside Decode");
59: for (Iterator i = requestParameterMap.keySet().iterator(); i
60: .hasNext();) {
61: String key = (String) i.next();
62: //logger.debug("SWG:decode key: " + key + " value: " + requestParameterMap.get(key));
63:
64: }
65: UIInput comp = (UIInput) component;
66: comp.setSubmittedValue(comp);
67: }
68: }
|