|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
net.sf.jzeno.echo.components.CustomComponent
net.sf.jzeno.echo.components.CustomRenderingComponent
public abstract class CustomRenderingComponent
Base class for creating custom rendering component. This class represents a by-pass of jZeno's rendering abstraction layers (e.g. existing 'dynamic components'), and allows you to take full control over the HTML created for a component. Basically you can create a custom component that has 2 extra functions that allow full control over generated HTML :
The main design goal of this class is to make writing custom rendered components extremely easy, to allow people to bypass jZeno is a small set of situations where this is necessary. It is not a good idea if you are using CustomRenderingComponents for 90% of your application ! More efficient implementations are possible for that. (i.e. a custom peer component that renders out Elements i.o. Strings).
Field Summary |
---|
Constructor Summary | |
---|---|
CustomRenderingComponent()
|
|
CustomRenderingComponent(java.lang.Class beanClass,
java.lang.String property,
java.lang.String constructionHints)
|
Method Summary | |
---|---|
protected java.lang.String |
createUpdateScript(java.lang.String valueScript,
boolean immediate)
This method creates a JavaScript function-call that you can use inside of the render() method to trigger updates to the component from the client. |
protected abstract java.lang.String |
getHtml()
Render your component into HTML here. |
protected abstract java.lang.String |
getJavascript()
Return some javascript that you which to execute for the current rendering of your component. |
protected abstract java.lang.String |
getJavascriptLibrary()
If you whish to use some javascript functions/libraries you can return those in this method. |
boolean |
isRebound()
|
void |
rebind()
This operation causes the component to reset it's content to that of the domain model. |
void |
resetRebound()
|
protected abstract void |
update(java.lang.String input)
If you want to send information from you client back to the server to update state there, you can use the createUpdateScript function to generate a javascript function-call that will trigger an update. |
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent |
---|
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setReadOnly, setRequired, setValue, traceValue, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CustomRenderingComponent()
public CustomRenderingComponent(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
Method Detail |
---|
protected java.lang.String createUpdateScript(java.lang.String valueScript, boolean immediate)
valueScript
- immediate
-
protected abstract java.lang.String getHtml()
Render your component into HTML here.
protected abstract java.lang.String getJavascriptLibrary()
If you whish to use some javascript functions/libraries you can return those in this method. If you return null, no javascript will be available to you rendered HTML. The implementation could take the form of returning a string constant, or it could load a .js file from disk, and return the content, or it could load a JavaScript library as a resource from you application classpath, etc...
protected abstract void update(java.lang.String input)
If you want to send information from you client back to the server to update state there, you can use the createUpdateScript function to generate a javascript function-call that will trigger an update.
input
- protected abstract java.lang.String getJavascript()
Return some javascript that you which to execute for the current rendering of your component.
public void rebind()
RebindableComponent
This operation causes the component to reset it's content to that of the domain model.
rebind
in interface RebindableComponent
rebind
in class CustomComponent
public boolean isRebound()
public void resetRebound()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |