Class Input

All Implemented Interfaces:
Serializable, Cloneable, Component, DynamicPropertied, RawId, Scope, ComponentCtrl
Direct Known Subclasses:
Textarea

public class Input extends AbstractTag
The input tag.
Author:
tomyeh
See Also:
  • Constructor Details

    • Input

      public Input()
    • Input

      protected Input(String tagnm)
  • Method Details

    • getValue

      public String getValue()
      Returns the value of this input.
    • setValue

      public void setValue(String value) throws WrongValueException
      Sets the vallue of this input.
      Throws:
      WrongValueException
    • isChecked

      public boolean isChecked()
      Returns if the input is checked (type: checkbox or radio).
    • setChecked

      public void setChecked(boolean checked) throws WrongValueException
      Sets if the input is checked (type: checkbox or radio).
      Throws:
      WrongValueException
    • getAccept

      public String getAccept()
      Returns the accept of this input tag.
      Since:
      8.0.3
    • setAccept

      public void setAccept(String accept) throws WrongValueException
      Sets the accept of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getAlt

      public String getAlt()
      Returns the alt of this input tag.
      Since:
      8.0.3
    • setAlt

      public void setAlt(String alt) throws WrongValueException
      Sets the alt of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getAutocomplete

      public String getAutocomplete()
      Returns the autocomplete of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setAutocomplete

      public void setAutocomplete(String autocomplete) throws WrongValueException
      Sets the autocomplete of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • isAutofocus

      public boolean isAutofocus()
      Returns the autofocus of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setAutofocus

      public void setAutofocus(boolean autofocus) throws WrongValueException
      Sets the autofocus of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getDirname

      public String getDirname()
      Returns the dirname of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setDirname

      public void setDirname(String dirname) throws WrongValueException
      Sets the dirname of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • isDisabled

      public boolean isDisabled()
      Returns the disabled of this input tag.
      Since:
      8.0.3
    • setDisabled

      public void setDisabled(boolean disabled) throws WrongValueException
      Sets the disabled of this input tag.
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getHeight

      public String getHeight()
      Returns the height of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setHeight

      public void setHeight(String height) throws WrongValueException
      Sets the height of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getInputmode

      public String getInputmode()
      Returns the inputmode of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setInputmode

      public void setInputmode(String inputmode) throws WrongValueException
      Sets the inputmode of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getList

      public String getList()
      Returns the list of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setList

      public void setList(String list) throws WrongValueException
      Sets the list of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getMax

      public String getMax()
      Returns the max of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setMax

      public void setMax(String max) throws WrongValueException
      Sets the max of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getMaxlength

      public Integer getMaxlength()
      Returns the maxlength of this input tag.
      Since:
      8.0.3
    • setMaxlength

      public void setMaxlength(Integer maxlength) throws WrongValueException
      Sets the maxlength of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getMin

      public String getMin()
      Returns the min of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setMin

      public void setMin(String min) throws WrongValueException
      Sets the min of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getMinlength

      public Integer getMinlength()
      Returns the minlength of this tag.
      Since:
      10.0.0
    • setMinlength

      public void setMinlength(Integer minlength) throws WrongValueException
      Sets the minlength of this tag.
      Throws:
      WrongValueException
      Since:
      10.0.0
    • isMultiple

      public boolean isMultiple()
      Returns the multiple of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setMultiple

      public void setMultiple(boolean multiple) throws WrongValueException
      Sets the multiple of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getName

      public String getName()
      Returns the name of this input tag.
      Since:
      8.0.3
    • setName

      public void setName(String name) throws WrongValueException
      Sets the name of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getPattern

      public String getPattern()
      Returns the pattern of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setPattern

      public void setPattern(String pattern) throws WrongValueException
      Sets the pattern of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getPlaceholder

      public String getPlaceholder()
      Returns the placeholder of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setPlaceholder

      public void setPlaceholder(String placeholder) throws WrongValueException
      Sets the placeholder of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • isReadonly

      public boolean isReadonly()
      Returns the readonly of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setReadonly

      public void setReadonly(Boolean readonly) throws WrongValueException
      Sets the readonly of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • isRequired

      public boolean isRequired()
      Returns the required of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setRequired

      public void setRequired(boolean required) throws WrongValueException
      Sets the required of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getSelectiondirection

      public String getSelectiondirection()
      Returns the selectiondirection of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setSelectiondirection

      public void setSelectiondirection(String selectiondirection) throws WrongValueException
      Sets the selectiondirection of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getSize

      public Integer getSize()
      Returns the size of this input tag.
      Since:
      8.0.3
    • setSize

      public void setSize(Integer size) throws WrongValueException
      Sets the size of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getSrc

      public String getSrc()
      Returns the src of this input tag.
      Since:
      8.0.3
    • setSrc

      public void setSrc(String src) throws WrongValueException
      Sets the src of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getStep

      public Integer getStep()
      Returns the step of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setStep

      public void setStep(Integer step) throws WrongValueException
      Sets the step of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getType

      public String getType()
      Returns the type of this input tag.
      Since:
      8.0.3
    • setType

      public void setType(String type) throws WrongValueException
      Sets the type of this input tag
      Throws:
      WrongValueException
      Since:
      8.0.3
    • getWidth

      public String getWidth()
      Returns the width of this input tag.

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Since:
      8.0.3
    • setWidth

      public void setWidth(String width) throws WrongValueException
      Sets the width of this input tag

      Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Throws:
      WrongValueException
      Since:
      8.0.3
    • getCapture

      public String getCapture()
      Returns the capture of this tag.
      Since:
      10.0.0
    • getForm

      public String getForm()
      Returns the form of this tag.
      Since:
      10.0.0
    • setForm

      public void setForm(String form) throws WrongValueException
      Sets the form of this tag.

      The <form> element to associate the button with (its form owner). The value of this attribute must be the id of a <form> in the same document. (If this attribute is not set, the <button> is associated with its ancestor <form> element, if any.)

      This attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>. It can also override an ancestor <form> element.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • getFormaction

      public String getFormaction()
      Returns the formaction of this tag.
      Since:
      10.0.0
    • setFormaction

      public void setFormaction(String formaction) throws WrongValueException
      Sets the formaction of this tag.

      The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner. Does nothing if there is no form owner.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • getFormenctype

      public String getFormenctype()
      Returns the formenctype of this tag.
      Since:
      10.0.0
    • setFormenctype

      public void setFormenctype(String formenctype) throws WrongValueException
      Set the formenctype of this tag.

      If the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), specifies how to encode the form data that is submitted.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • getFormmethod

      public String getFormmethod()
      Returns the formmethod of this tag.
      Since:
      10.0.0
    • setFormmethod

      public void setFormmethod(String formmethod) throws WrongValueException
      Sets the formmethod of this tag.

      If the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), this attribute specifies the HTTP method used to submit the form.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • getFormnovalidate

      public String getFormnovalidate()
      Returns the formnovalidate of this tag.
      Since:
      10.0.0
    • setFormnovalidate

      public void setFormnovalidate(String formnovalidate) throws WrongValueException
      Sets the formnovalidate of this tag.

      If the button is a submit button, this Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the novalidate attribute of the button's form owner.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • getFormtarget

      public String getFormtarget()
      Returns the formtarget of this tag.
      Since:
      10.0.0
    • setFormtarget

      public void setFormtarget(String formtarget) throws WrongValueException
      Sets the formtarget of this tag.

      If the button is a submit button, this attribute is an author-defined name or standardized, underscore-prefixed keyword indicating where to display the response from submitting the form. This is the name of, or keyword for, a browsing context (a tab, window, or <iframe>). If this attribute is specified, it overrides the target attribute of the button's form owner.

      Throws:
      WrongValueException
      Since:
      10.0.0
    • setCapture

      public void setCapture(String capture) throws WrongValueException
      Sets the capture of this tag.
      Throws:
      WrongValueException
      Since:
      10.0.0
    • getWidgetClass

      public String getWidgetClass()
      Returns the widget class, "zhtml.Input".
      Specified by:
      getWidgetClass in interface Component
      Overrides:
      getWidgetClass in class AbstractTag
      Since:
      8.0.0
      See Also:
    • smartUpdate

      protected void smartUpdate(String attr, Object value)
      Description copied from class: AbstractComponent
      Smart-updates a property of the peer widget associated with the component, running at the client, with the given value.

      The second invocation with the same property will replace the previous call. In other words, the same property will be set only once in each execution. If you prefer to send both updates to the client, use AbstractComponent.smartUpdate(String, Object, boolean) instead.

      This method has no effect if AbstractComponent.invalidate() is ever invoked (in the same execution), since AbstractComponent.invalidate() assumes the whole content shall be redrawn and all smart updates to this components can be ignored,

      Once AbstractComponent.invalidate() is called, all invocations to AbstractComponent.smartUpdate(String, Object) will then be ignored, and AbstractComponent.redraw(java.io.Writer) will be invoked later.

      It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.

      There are two ways to draw a component, one is to invoke Component.invalidate(), and the other is AbstractComponent.smartUpdate(String, Object). While Component.invalidate() causes the whole content to redraw, AbstractComponent.smartUpdate(String, Object) let component developer control which part to redraw.

      Overrides:
      smartUpdate in class AbstractComponent
      value - the new value. If it is DeferredValue, the value will be retrieved (by calling DeferredValue.getValue()) in the rendering phase. It is useful if the value can not be determined now.

      For some old application servers (example, Websphere 5.1), Execution.encodeURL(java.lang.String) cannot be called in the event processing thread. So, the developers have to use DeferredValue or disable the use of the event processing thread (by use of disable-event-thread in zk.xml).

      If you want to generate the JavaScript code directly (i.e., the value is a valid JavaScript snippet), you can use JavaScriptValue. Notice that the JavaScript code will be evaluated before assigning it to the widget.

      If the value is a Date object, a special pattern will be generated (a.k.a., marshaling) to ensure it can be unmarshalled back correctly at the client. Notice that it is marshalled to a string based on TimeZones.getCurrent(), and then unmarshalled back at the client. In other words, if the client is in different time-zone, the value returned by getTime() might be different. However, the value will remain the same if the client marshalled the Date object back. In other words, it assumes the browser's time zone from enduser's perspective (not really browser's setting) shall be the same as TimeZones.getCurrent().

      If the value is a component, a special pattern will be generated to ensure it can be unmarshalled back correctly at the client.

      In addition, the value can be any kind of objects that the client accepts (marshaled by JSON) (see also JSONAware).

      See Also:
    • service

      public void service(AuRequest request, boolean everError)
      Processes an AU request.
      Specified by:
      service in interface ComponentCtrl
      Overrides:
      service in class AbstractComponent
      everError - whether any error ever occurred before processing this request.
      Since:
      5.0.0
      See Also: