- Direct Known Subclasses:
- AppletContainer, Bookmark, BreadCrumb, Chart, Container, DateNavigator, EventValidationComponent, FileUpload, GridLayoutCell, HoverMenu, HoverMenuItem, HtmlEdit, HTMLFragment, Image, ImageMap, Includes, IsolatedHtmlContainer, LinkForHoverMenu, MenuBar, MessageBar, NonIsolatedHtmlContainer, PopupTrigger, ProgressIndicator, TextView, ToolbarSeparator, Tree
- public abstract class Component
- extends Object
Base class for all control model classes
Copyright 2004 SAP AG
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Component(String id)
public Container getParent()
public void setParent(Container parent)
public String getId()
- get the name of this component
- the name of this component
public void setId(String id)
- set the name of this component
id - the name of this component
public abstract String getUI()
- get a identification String for the renderer that is unique
across all supported components. E.g. you could simply return
the class name of the component class.
The reason for using a separate method and not some internal
reflection method is that you can more easily extend the
functionality or your Component class without having to rewrite
the view class.
- a unique identification string for this Component
public void render(IPageContext rendererContext)
- render the component using the current context. This is the
default method that is useful for components with atomic
Component classes that require separate pieces of HTML code
in their output should use separate methods with appropriate
names, e.g. renderBegin(IPageContext rc), renderEnd(..).
The IPageContext provides a separate method
render(Component c, String selector) to use separate view
classes for the fragments.
rendererContext - the context in which to render.
public String renderAsString(IPageContext pageContext)
- Experimental. Render a component into a String
pageContext - the current IPageContext for rendering.
- a String containing the output from rendering this Component
protected String getEncodedIdForForm(Form theForm)
- internal use only. This returns a string that uniquely
identifies the class of the component. Special subclasses
may add more information, separated with a '_'
- a String that uniquely identifies the class of this component
public static Component initializeFromId(String originalId,
- internal use only. This re-initializes a component from the submitted form
originalId - the ID the user used for the component
id - the internal class ID, generated by getEncodedIdForForm
pc - the IPageContext, required for accessing parameters
idInPage - the ID used internally in the HTML page
- a Component that encapsulates user input.
protected void initFromShortId(IPageContext pc,
- internal use only. Set up the class for the component.
If a Component added some special information to the
getEncodedIdForForm() this method should be used to
regain the additionally encoded information.
id - the Id as it was returned by getEncodedIdForForm()
protected void initFromPageContext(IPageContext pc,
- internal use only. Components should override this method
to analyse the parameters from the request object (via
IPageContext) and set their internal data structures
pc - the context, including the parameters
baseId - the prefix used for the component. (The
result of a former RenderUtil.getIdForForm(rc, c);)
public boolean requiresForm()
- check if a special component really requires a form around it.
Subclasses should override this if they do not require a form.
Basically, any Component that is capable of firing a server side
event or that contains user input must be placed in a form.
- true if the component must be placed in a form.
public boolean isJsObjectNeeded()
- return if a js object is needed on the client side for this component
public void setJsObjectNeeded(boolean jsObjectNeeded)
- determines if a js object is needed for this component
public void preRender(IPageContext pc)
- preRender traverses the component tree right before rendering