All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hdiv.components.TextFieldHDIV Maven / Gradle / Ivy

/*
 * Copyright 2005-2008 hdiv.org
 *
 * 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 org.hdiv.components;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.TextField;
import org.apache.struts2.views.annotations.StrutsTag;
import org.hdiv.dataComposer.IDataComposer;

import com.opensymphony.xwork2.util.ValueStack;

/**
 * 
 * Render an HTML input field of type text

* * *

Examples *

* * In this example, a text control for the "user" property is rendered. The label is also retrieved from a ResourceBundle via the key attribute. * *

 * 
 * <s:textfield key="user" />
 * 
 * 
* *
 * 
 * <s:textfield name="user" label="User Name" />
 * 
 * 
* * @author Gorka Vicente * @since HDIV 2.0.4 */ @StrutsTag(name="textfield", tldTagClass="org.hdiv.views.jsp.ui.TextFieldTagHDIV", description="Render an HTML input field of type text") public class TextFieldHDIV extends TextField { /** * The name of the default template for the TextFieldTag */ final public static String TEMPLATE = "textHDIV"; private static final String DATA_COMPOSER = "dataComposer"; public TextFieldHDIV(ValueStack stack, HttpServletRequest request, HttpServletResponse response) { super(stack, request, response); } protected String getDefaultTemplate() { return TEMPLATE; } /** * @return Returns data composer from request */ public IDataComposer getDataComposer() { return (IDataComposer) this.request.getAttribute(DATA_COMPOSER); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy