Class PlainButton

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Badgeable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

@Component public class PlainButton extends Control implements Hideable
The class extends Control and implements a button, the user interface element that allows to throw events.
This kind of button differs from the Button for the graphic rendering, which can be customized through the application of different styles and CSS classes. Even plainbuttons can validate form data.
Usually PlainButtons are used to be used as handlers that allows to open the Panel that appears from the edges of the screen
See Also:
GCApi:
component
  • Field Details

    • _icon

      protected String _icon
    • _iconCss

      protected String _iconCss
    • _param

      protected String _param
    • _msg

      protected String _msg
    • _prompt

      protected String _prompt
    • promptEmpty

      protected boolean promptEmpty
    • _anchor

      protected String _anchor
    • _visible

      protected SetPredicate _visible
    • _lastshow

      protected boolean _lastshow
    • _submit

      protected boolean _submit
    • _style

      protected String _style
    • _state

      protected String _state
    • _position

      protected String _position
    • _form

      protected String _form
    • destination

      protected String destination
    • _refreshTime

      protected int _refreshTime
    • _refreshNumber

      protected int _refreshNumber
    • _refreshed

      protected int _refreshed
    • autocomplete

      protected String autocomplete
  • Constructor Details

    • PlainButton

      public PlainButton()
  • Method Details

    • setDESTINATION

      public void setDESTINATION(String s)
      Sets the reference to the Container that will manage the event associated to the TaskMessage
      Parameters:
      s - The registryname of the container that will manage the event
    • setLASTSHOW

      public void setLASTSHOW(String s)
      Sets the visibility of the PlainButton when the Window that contains it is the last one of the stack
      Parameters:
      s - true if the PlainButton will be visible when the window that contains it is the last one of the stack, false otherwise
    • getLASTSHOW

      public boolean getLASTSHOW()
      Checks if the PlainButton will be visible when the Window that cotains it is the last one of the stack
      Returns:
      true if the PlainButton is visible when the window that contains it is the last one of the stack, false otherwise
    • setSTYLE

      public void setSTYLE(String s)
      Sets the CSS style of the PlainButton
      Parameters:
      s - The string that contains the css attributes and values for the button's style
    • setSTATE

      public void setSTATE(String s)
      Defines the state of the PlainButton. The button will take a different style, based on the state, that is dependend on the theme currently used
      Parameters:
      s - Possible values are:
      "on", usually used to indicate that the button, used as handler, is currently switched on
      "off", usually used to indicate that the button, used as handler, is currently switched off
      "active", usually used to indicate that the button can make a submit
    • setPOSITION

      public void setPOSITION(String s)
      Defines the position of the PlainButton. The button will take a different rounding border style, based on the position.
      Parameters:
      s - Possible values are:
      "c", the button will have all the borders rounded
      "t", the button will have the bottom borders rounded
      "b", the button will have the top borders rounded
      "l", the button will have the right borders rounded
      "r", the button will have the left borders rounded
    • setICONCSS

      public void setICONCSS(String s)
      Sets the CSS class of the IconHD of the PlainButton
      Parameters:
      s - A string that defines a CSS class
    • setPARAM

      public void setPARAM(String s)
      Sets a parameter that will be passed to the event associated to the PlainButton.
      If there is a param, when the event is triggered it will receives in the HashGetter an entry with key: "param", and value: the string set with this method. The parameter can therefore be managed by the event.
      Parameters:
      s - A string that represents the parameter passed to the event triggered by the PlainButton
    • setMSG

      public void setMSG(String s)
      Sets the string that appears as a message for the event associated to the PlainButton.
      If there is a message, when the user clicks the PlainButton a javascript alert will appear, containing the message and two buttons; by pressing one of the two the event will be triggered, while pressing the other will not. Therefore usually this alert is used to request confirmation of proceeding to the user.
      Using this method the message will be translated by the Teacher.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user clicks the PlainButton
    • setPROMPT

      public void setPROMPT(String s)
      Sets the string that appears as a prompt message for the event associated to the PlainButton.
      If there is a prompt, when the user clicks the PlainButton a javascript alert will appear, containing a message (that is the prompt string set with this method), an input field that the user can edit, and two buttons; by pressing one of the two, the event will be triggered, while pressing the other will not. If the event is triggered, it will receives in the HashGetter an entry with key: "prompt", and value: the string that the user has inserted into the input field of the alert. Therefore usually this alert is used to request confirmation of proceeding to the user, that can also insert a parameter, that will be managed by the event.
      Using this method the prompt message will be translated by the Teacher.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user clicks the PlainButton
    • setPROMPTEMPTY

      public void setPROMPTEMPTY(String s)
      Sets if the value returned by the prompt can be an empty string ""
      Parameters:
      s - true if you want to allow to return an empty value by the prompt, false otherwise.
    • setANCHOR

      public void setANCHOR(String s)
      Defines the name of the anchor that is used to reposition the scrolling of the page following the execution of the event associated with the button. The name must correspond to the value of a reference attribute of a Grid or a Section, set using the appropriate set methods (Grid.setREF(java.lang.String), Section.setREF(java.lang.String)).
      The relocation mechanism works only with non-Ajax events, the ones that reload the page.
      Parameters:
      s - The name of the anchor
    • setFORM

      public void setFORM(String s)
      Sets the reference to a specific Form element.
      It is possible to position the PlainButton outside of a form, but still allow the submission of the values of a referenced form by setting it, using this method. If the PlainButton is in a form, then also setting this attribute, the submitted values will be those of the form to which the button belongs.
      Parameters:
      s - The registryname (Component.setREGISTRYNAME(java.lang.String)) of the form
    • setICON

      public void setICON(String icon)
      Sets the IconHD associated to the PlainButton
      Overrides:
      setICON in class Component
      Parameters:
      icon - The path of the icon
    • setVISIBLE

      public void setVISIBLE(String s)
      Sets the visibility of the PlainButton
      Specified by:
      setVISIBLE in interface Hideable
      Parameters:
      s - true if the button will be visible, false otherwise, or a name of a function used to determine visibility (see isVisible())
    • isVisible

      public boolean isVisible()
      Checks the visibility of the PlainButton. See getBoolean(visible,id,true))
      Specified by:
      isVisible in interface Hideable
      Returns:
      true if the button is visible, false otherwise
    • setSUBMIT

      public void setSUBMIT(String s)
      Defines if the PlainButton is a SUBMIT one, ie it performs the data validation before the submit
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setREFRESHTIME

      public void setREFRESHTIME(String s)
      Sets a refresh time. By setting this attribute it will appear a little progress bar under the label of the PlainButton, that graphically highlights the passage of time. Once the time has elapsed, the event associated to the PlainButton will be triggered
      Parameters:
      s - The refresh time, expressed in seconds. The default value is 0 (that means no refresh)
    • setREFRESHNUMBER

      public void setREFRESHNUMBER(String s)
      Sets a refresh number. Defines the number of automatic executions of the event associated to the PlainButton.
      Parameters:
      s - The refresh number, the default value is 10
    • setAUTOCOMPLETE

      public void setAUTOCOMPLETE(String s)
      Sets the autocomplete attribute on the button.
      Parameters:
      s - A string that represents the autocomplete attribute for the button. Some examples are : off,nameemail,tel,sex ecc.
      The complete list of autocomplete's value can be found on this link: https://www.w3.org/Translations/WCAG21-it/#input-purposes
    • getRefreshTime

      public int getRefreshTime()
      Returns the refresh time
      Returns:
      The integer that represents the refresh time, expressed in seconds. The default value is 0, that means no refresh.
    • getRefreshNumber

      public int getRefreshNumber()
      Returns the refresh number
      Returns:
      The integer that represents the refresh number. The default value is 10
    • setup

      public void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Component
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • setMsg

      public void setMsg(String s)
      Sets programmatically the string that appears as a message for the event associated to the PlainButton.
      Using this method the message will not be translated by the Teacher.
      See setMSG(java.lang.String) for the meaning of the attribute.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user clicks the button
    • setPrompt

      public void setPrompt(String s)
      Sets programmatically the string that appears as a prompt message for the event associated to the PlainButton.
      Using this method the message will not be translated by the Teacher.
      See (java.lang.String) for the meaning of the attribute.
      Parameters:
      s - A string that represents the prompt message contained in the alert that will appears when the user clicks the button
    • nn

      protected String nn(String s)