Class IdTextSelection

java.lang.Object
org.eclnt.jsfserver.defaultscreens.IdTextSelection
All Implemented Interfaces:
Serializable, BasePopup.IPopupListener, ModalPopup.IModalPopupListener

public class IdTextSelection extends Object implements Serializable, ModalPopup.IModalPopupListener
Class for server side implementation of COMBOFIELD component. Opens a pop up window with a list of valid values and calls back the logic when the user selects a value. Use @link createInstance() or @line createInstanceWithExplanation(String) in order to get an instance, then fill values via @link addLine(String, String) and specify the call back. You can select two call back options: either just the selected id via @link #setCallBack(ISetId) or the selected id and its text via @link #setCallBack(ISetIdText).
See Also:
  • Field Details

    • m_explanation

      public String m_explanation
  • Method Details

    • initialize

      public static void initialize()
    • getPopup

      public ModelessPopup getPopup()
      Popup instance that is opened by the value help.
    • getRequestFocus

      public String getRequestFocus()
      Request focus for the whole grid. By default has value "creation" - but this may be overridden when e.g. pre-selecting a certain item of the grid.
    • getFilterRequestFocus

      public String getFilterRequestFocus()
      Request focus for the filter field. By default is not set. But can be explicitly set by calling requestFocusInFilterField().
    • requestFocusInFilterField

      public void requestFocusInFilterField()
      This will move the focus into the filter field when opening the popup. Only is applied if setRenderFilterText(boolean) is called with value "true".
    • setTitleId

      public void setTitleId(String titleId)
      Set the title of the id column.
    • getTitleId

      public String getTitleId()
    • setTitleText

      public void setTitleText(String titleText)
      Set the title of the text column.
    • getTitleText

      public String getTitleText()
    • createInstance

      public static IdTextSelection createInstance()
      Creates a normal instance that is presented to the user as straight list. User addLine(String, String) in order to add items.
    • createInstanceHt

      protected static IdTextSelection createInstanceHt()
    • createInstanceWithExplanation

      public static IdTextSelection createInstanceWithExplanation(String explanation)
      Creates an instance in which the list of valid values is shown together with an explanation string. Use addLine(String, String) in order to add items.
    • createInstanceWithImageLine

      public static IdTextSelection createInstanceWithImageLine()
      Creates instance in which each line is rendered with image, text and id, as two lines. Use addLine(String, String, String) in order to add items.
    • createListInstance

      public static IdTextSelection createListInstance()
    • clear

      public void clear()
      Clears all items.
    • addLine

      public IdTextSelection.IdTextLine addLine(String id, String name)
      Adds a line to the list of valid values.
    • addLine

      public IdTextSelection.IdTextLine addLine(String id, String name, String image)
      Adds a line to the list of valid values. The image is only visible if having created this intance via #createInstanceWIthImageLine(), otherwise only id and name will be shown.
    • setCallBack

      public void setCallBack(ISetId callBack)
      Specifies a call back. The call back passes the selected id.
    • setCallBack

      public void setCallBack(ISetIdText callBack)
      Specifies a call back. The call back passes the selected id and the selected text.
    • onPopupClosedByUser

      public void onPopupClosedByUser(javax.faces.event.ActionEvent ae)
      Internal usage.
    • getLines

    • getExplanation

      public String getExplanation()
    • processSelectLine

      public void processSelectLine(IdTextSelection.IdTextLine line)
      Internal usage.
    • reactOnPopupClosedByUser

      public void reactOnPopupClosedByUser()
      Internal usage.
      Specified by:
      reactOnPopupClosedByUser in interface BasePopup.IPopupListener
    • getWithHeader

      public boolean getWithHeader()
    • setWithHeader

      public void setWithHeader(boolean value)
      The header is the area in which the OK and cancel button is rendered (once upon a time this area way the header of the popup, now it has moved to the bottom...). By default it is shown but you can explicitly switch it off passing "false" as value.
    • getSuppressHeadline

      public boolean getSuppressHeadline()
    • setSuppressHeadline

      public void setSuppressHeadline(boolean value)
      If set to "true" then the grid head line is not shown but only the grid content is shown.
    • getRenderIdColumn

      public boolean getRenderIdColumn()
    • setRenderIdColumn

      public void setRenderIdColumn(boolean renderIdColumn)
      Set if id column is to be rendered (true/default) or not (false).
    • getRenderTextColumn

      public boolean getRenderTextColumn()
    • setRenderTextColumn

      public void setRenderTextColumn(boolean renderTextColumn)
      Set if text column is to be rendered (true/default) or not (false).
    • setFilterText

      public void setFilterText(String filterText)
      Sets the filter text. Only applicable if setRenderFilterText(boolean) is activated.
    • getFilterText

      public String getFilterText()
    • onRenderBeginAction

      public void onRenderBeginAction(javax.faces.event.ActionEvent event)
    • onFilterTextAction

      public void onFilterTextAction()
    • getFilterResultText

      public String getFilterResultText()
    • filterItems

      protected void filterItems()
    • checkIfTextFitsToFilter

      protected boolean checkIfTextFitsToFilter(String text, String filter)
    • setRenderFilterText

      public void setRenderFilterText(boolean renderFilterText)
      On top of the value list a text field may be shown for filtering the items. By default this field is not shown. By passing "true" the filter text field is shown.
    • getRenderFilterText

      public boolean getRenderFilterText()
    • onOK

      public void onOK(javax.faces.event.ActionEvent event)
      Internally used - reactor on "OK" in popup.
    • onCancel

      public void onCancel(javax.faces.event.ActionEvent event)
      Internally used - reactor on "cancel" in popup.
    • filterByInputId

      public void filterByInputId(String inputId)
      Filters all passed values in order to show these ones fitting to the current input.
    • filterByInputText

      public void filterByInputText(String inputText)
      Filters all passed values in order to show these ones fitting to the current input.
    • setPopupWidth

      public void setPopupWidth(int width)
      Set the height of the popup that is opened.
    • setPopupHeight

      public void setPopupHeight(int height)
      Set the width of the popup that is opened.
    • preselect

      public void preselect(String id)
      Preselects the corresponding item: the item is selected, focused and the list is scrolled so that the item is visible.

      Remark: If having called requestFocusInFilterField() before calling this method then the focus is NOT moved into the selected item, but stays in the filter field.
    • getListValues

      public String getListValues()
    • getListSelection

      public String getListSelection()
    • setListSelection

      public void setListSelection(String listSelection)
    • onListAction

      public void onListAction(javax.faces.event.ActionEvent ae)
      Internal usage.
    • sortItemsById

      public void sortItemsById()
    • sortItemsByText

      public void sortItemsByText()
    • getHtContent

      public ROWDYNAMICCONTENTBinding getHtContent()
    • onHtButtonAction

      public void onHtButtonAction(javax.faces.event.ActionEvent event)
    • processKeySequence

      protected void processKeySequence(String ks)