com.HybridServerPages
Class BaseComponent

java.lang.Object
  extended by com.HybridServerPages.BaseComponent

public class BaseComponent
extends java.lang.Object

Derive component state classes ("*_WS.java") from this class


Constructor Summary
BaseComponent()
           
 
Method Summary
protected  void $accept(int code, java.lang.String msg, java.lang.Object more, BaseComponent source)
          Override this method to get signals from sub-components.
protected  void $ajaxComponent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method to process Ajax request at the component level
protected  java.lang.String $getParam(java.lang.String name, java.lang.String previous_value)
          Access to component-related HTTP request parameters
protected  void $handleComponent(java.lang.String h1, java.lang.String h2)
          If the actual submission is unrelated to current component then empty strings are passed to both parameters.
protected  void $resend()
          Resends the last accepted message (code,msg,more,source) upwards
protected  void $send(int code, java.lang.String msg, java.lang.Object more)
          Send a signal to the parent component or to the page
protected  void $setBadParam(java.lang.String name, java.lang.String msg)
          Marks the parameter as bad
protected  boolean $setNextPage(java.lang.String pn)
          Sets the next page to be shown.
protected  void $setReturn()
          Sets the next page equal to the page you came here from This is a support for back button
 java.lang.String getShortName()
          Returns the short name of the component
 java.lang.String getUniqueId()
          Returns unique id of the component state instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseComponent

public BaseComponent()
Method Detail

getShortName

public final java.lang.String getShortName()
Returns the short name of the component

Returns:
the short name of the component

getUniqueId

public final java.lang.String getUniqueId()
Returns unique id of the component state instance

Returns:
unique id of the component state instance

$send

protected final void $send(int code,
                           java.lang.String msg,
                           java.lang.Object more)
Send a signal to the parent component or to the page

Parameters:
code - some value
msg - some message
more - some additional data

$resend

protected final void $resend()
Resends the last accepted message (code,msg,more,source) upwards


$accept

protected void $accept(int code,
                       java.lang.String msg,
                       java.lang.Object more,
                       BaseComponent source)
Override this method to get signals from sub-components. Otherwise the signal will be propagated up

Parameters:
code - some value
msg - some message
more - some additional data
source - the component that fired the signal

$handleComponent

protected void $handleComponent(java.lang.String h1,
                                java.lang.String h2)
If the actual submission is unrelated to current component then empty strings are passed to both parameters.

Parameters:
h1 - first (name) part (before ':') of HJ_Action HTTP parameter
h2 - second (value) part of HJ_Action HTTP parameter
Using the HJ_Action is optional as HTTP request is also available
To extract request parameters relevant to this component use String $getParam(String name) This method is called for every component with respect to their seniority AND before $handlePage.

$setBadParam

protected final void $setBadParam(java.lang.String name,
                                  java.lang.String msg)
Marks the parameter as bad

Parameters:
name - of the parameter that did not pass validation
msg - message to be shown at the control

$getParam

protected final java.lang.String $getParam(java.lang.String name,
                                           java.lang.String previous_value)
Access to component-related HTTP request parameters

Parameters:
name - component-scope name of the parameter
previous_value - - returned if no such parameter in the current HTTP request
Returns:
parameter value.

$setReturn

protected final void $setReturn()
Sets the next page equal to the page you came here from This is a support for back button


$setNextPage

protected final boolean $setNextPage(java.lang.String pn)
Sets the next page to be shown. If called more than once the last call is effective

Parameters:
pn - name of the page a.k.a. full class name of the page
Returns:
false for all calls except the first one

$ajaxComponent

protected void $ajaxComponent(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
Override this method to process Ajax request at the component level

Parameters:
request - standard
response - standard