com.orchestranetworks.ui
Class UITableFilter

java.lang.Object
  extended bycom.orchestranetworks.ui.UITableFilter

public abstract class UITableFilter
extends Object

Abstract class for implementing a user interface filter over a table.

Schema definition

Filters are specified in the same parent element as osd:table, for example:

 <xs:annotation>
   <xs:appinfo>
     <osd:table>...</osd:table>
     <osd:uiFilter class="com.foo.MyUIFilter1"/>
       <label>Label of filter 1</label>
     </osd:uiFilter>
     <osd:uiFilter class="com.foo.MyUIFilter2">
       <label>Default label of filter 2</label>
       <label xml:lang="fr">Libellé en français du filtre 2</label>
     </osd:uiFilter>
   <xs:appinfo>
 </xs:annotation>
where com.foo.MyUIFilter1 and com.foo.MyUIFilter2 are the fully qualified name of classes implementing this interface. The declaration may also use parameters:
 <osd:uiFilter class="com.foo.MyUIFilter3">
     <param1>...</param1>
     <param2>...</param2>
 </osd:uiFilter>
where param1 and param2 are JavaBean properties of com.foo.MyUIFilter3 class.

For more information, read JavaBeans specification.

Life cycle

  1. When the schema is loaded, the declaration is checked : each filter class specified is instantiated through its default constructor and, if defined, the JavaBean properties' setters are called (in the example above, setParam1(...) and setParam2(...)).
  2. For each EBX.Manager session, the same instantiation and initialization process as above is performed. Each HTTP session maintains its own filter instances. Consequently, when the user performs interactions, each filter is able to keep its own state (the user selection) throughout the session.

  3. Constructor Summary
    UITableFilter()
               
     
    Method Summary
    abstract  void addForEdit(UITableFilterResponseContext aResponse)
              Adds HTML or DHTML for the filter pane, so that it allows the user to set the filter.
     void addForPrint(UITableFilterResponseContext aResponse)
              Adds HTML content for displaying information about the current filter's settings on a printable page.
     UserMessage getLabel()
              Returns the label of this filter.
    abstract  void handleApply(UITableFilterRequestContext aContext)
              Handles the request when the "apply filter" button is pushed.
    abstract  void handleReset()
              Handles the request when the "reset" button is pushed.
    abstract  void handleSelect(UITableFilterRequestContext aContext)
              Handles the request when this filter is selected in the list of filters.
     void setLabel(Locale aLocale, String aLabel)
              Sets the label of this filter for the locale specified.
     void setLabel(String aLabel)
              Sets the default label of this filter.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    UITableFilter

    public UITableFilter()
    Method Detail

    addForEdit

    public abstract void addForEdit(UITableFilterResponseContext aResponse)
    Adds HTML or DHTML for the filter pane, so that it allows the user to set the filter.

    When this method is called, the container has already added a <form ...> tag, and after this method has returned, it will add the closing </form> tag. Hence the implementation has only to place properly HTML components.

    Example

    The following code adds a check-box :
      aResponse.add("<input type=\"checkbox\" name=\"item\" style=\"border: 0;\" value=\"P4\" ");
      if (selection.contains("P4"))
           aResponse.add(" checked");
      aResponse.add("> Label of P4<br>");
     

    Constraints

    • HTML consistency – The HTML written is already enclosed in a HTML form by the container.
    • Avoid name conflicts with EBX.Manager – For any HTML component, its name and its id must not use the name requestID
    • , nor a name beginning with onw (in lowercase or uppercase).


    addForPrint

    public void addForPrint(UITableFilterResponseContext aResponse)
    Adds HTML content for displaying information about the current filter's settings on a printable page.

    Default implementation redirects to addForEdit(UITableFilterResponseContext). For production use, it is recommended to implement this method more adequately.


    handleApply

    public abstract void handleApply(UITableFilterRequestContext aContext)
    Handles the request when the "apply filter" button is pushed.

    The implementation of this method should:

    1. take into account the HTTP parameters coming from the request (those parameters are specified by the implementation of addForEdit(UITableFilterResponseContext));
    2. set the state of this instance accordingly;
    3. build the appropriate filter and call UITableFilterRequestContext.setTableFilter(AdaptationFilter).


    handleSelect

    public abstract void handleSelect(UITableFilterRequestContext aContext)
    Handles the request when this filter is selected in the list of filters.

    The implementation of this method should take into account the internal state of this instance for building the appropriate AdaptationFilter and set it by calling UITableFilterRequestContext.setTableFilter(AdaptationFilter).


    handleReset

    public abstract void handleReset()
    Handles the request when the "reset" button is pushed.

    The implementation of this method should reset the state of this instance to its initial state.


    getLabel

    public UserMessage getLabel()
    Returns the label of this filter.


    setLabel

    public void setLabel(Locale aLocale,
                         String aLabel)
    Sets the label of this filter for the locale specified.


    setLabel

    public void setLabel(String aLabel)
    Sets the default label of this filter.



    (report a bug)
    EBX.Platform 4.5.0 [0598]
    Copyright Orchestra Networks 2000-2008. All rights reserved.