Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
//
// 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.apache.tapestry5.corelib.base;
import org.apache.tapestry5.*;
import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.beaneditor.Width;
import org.apache.tapestry5.corelib.mixins.RenderDisabled;
import org.apache.tapestry5.ioc.AnnotationProvider;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.services.ComponentDefaultProvider;
import org.apache.tapestry5.services.Request;
import java.lang.annotation.Annotation;
import java.util.Locale;
/**
* Abstract class for a variety of components that render some variation of a text field. Most of the hooks for user
* input validation are in this class.
*
* In particular, all subclasses support the "toclient" and "parseclient" events. These two events allow the normal
* {@link Translator} (specified by the translate parameter, but often automatically derived by Tapestry) to be
* augmented.
*
* If the component container (i.e., the page) provides an event handler method for the "toclient" event, and that
* handler returns a non-null string, that will be the string value sent to the client. The context passed to the event
* handler method is t he current value of the value parameter.
*
* Likewise, on a form submit, the "parseclient" event handler method will be passed the string provided by the client,
* and may provide a non-null value as the parsed value. Returning null allows the normal translator to operate. The
* event handler may also throw {@link org.apache.tapestry5.ValidationException}.
*/
@Events({ EventConstants.TO_CLIENT, EventConstants.VALIDATE, EventConstants.PARSE_CLIENT })
public abstract class AbstractTextField extends AbstractField
{
/**
* The value to be read and updated. This is not necessarily a string, a translator may be provided to convert
* between client side and server side representations. If not bound, a default binding is made to a property of the
* container matching the component's id. If no such property exists, then you will see a runtime exception due to
* the unbound value parameter.
*/
@Parameter(required = true, principal = true)
private Object value;
/**
* The object which will perform translation between server-side and client-side representations. If not specified,
* a value will usually be generated based on the type of the value parameter.
*/
@Parameter(required = true, allowNull = false, defaultPrefix = BindingConstants.TRANSLATE)
private FieldTranslator