From: <fza...@us...> - 2005-07-01 20:51:02
|
Update of /cvsroot/struts/ajaxtags/WEB-INF/src/org/apache/struts/taglib/html/ajax/handlers/std In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16626/std Added Files: stdTextboxArea.java Log Message: --- NEW FILE: stdTextboxArea.java --- /* * Copyright 2005 Frank W. Zammetti * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package javawebparts.taglib.ajaxtags.handlers.std; import javawebparts.taglib.ajaxtags.handlers.HandlerRendererBase; /** * This class renders the Javascript for the std:TextboxArea response * handler. * * @author <a href="mailto:fza...@om...">Frank W. Zammetti</a> */ public class stdTextboxArea implements HandlerRendererBase { /** * Render the Javascript for this handler. * * @return The Javascript contents to insert into the page */ public String render() { StringBuffer sb = new StringBuffer(2048); sb.append("function stdTextboxArea() {\n"); sb.append(" if (ajaxXHR.readyState == 4) {\n"); sb.append(" if (ajaxXHR.status == 200) {\n"); sb.append(" for (i = 0; i < ajaxFRM.elements.length; i++) {\n"); sb.append(" if (ajaxFRM.elements[i].name == ajaxRHP) {\n"); sb.append(" ajaxFRM.elements[i].value = ajaxXHR.responseText;\n"); sb.append(" }\n"); sb.append(" }\n"); sb.append(" } else {\n"); sb.append(" alert(ajaxXHR.status);\n"); sb.append(" }\n"); sb.append(" }\n"); sb.append("}\n"); return sb.toString(); } // End render() } // End class |