ilog.views.faces.dhtml.renderkit
Class IlvDHTMLResponseWriter

java.lang.Object
  extended by ilog.views.faces.dhtml.renderkit.IlvDHTMLResponseWriter

public class IlvDHTMLResponseWriter
extends Object

Provider for JViews Faces component and properties JavaScript writing.

Since:
JViews 6.5

Constructor Summary
IlvDHTMLResponseWriter(FacesContext context, UIComponent component)
          Creates an IlvDHTMLResponseWriter.
 
Method Summary
 void endScriptSection()
          Close a scripting section.
 ResponseWriter getSupport()
          Returns the support response writer.
 void startScriptSection()
          Starts a scripting section.
 void write(String s)
          Writes a string into the response writer.
 void writeJSArrayProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSBodyEventHandler(String event, String jsMethod)
          Writes javascript code to register a function as a listener to a specified event on the <BODY> element.
 void writeJSClassNameOrValueBindingRef(String refPropertyId, String classPropertyId)
          Write the value binding expression of the refPropertyId if the property do have a value binding on it.
 void writeJSColorProperty(String propertyId)
          Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
 void writeJSColorPropertyWithoutPrefix(String propertyId)
          Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
 void writeJSDependencyProperty(String propertyId)
          Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
 void writeJSHandler(String jsHandler, String jsCode)
          Writes a JavaScript handler on the event generated by the component jsRef.
 void writeJSHandler(String jsHandler, String jsCode, String[] params)
          Writes in the current response writer the registering of a JavaScript handler on an event.
 void writeJSHandlerProperty(String propertyId)
          Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
 void writeJSHandlerProperty(String propertyId, String[] params)
          Writes in the current response writer the registering of a JavaScript handler on an event.
 void writeJSMethodBindingProperty(String propertyId)
          Write the method binding expression.
 void writeJSPrimitiveProperty(String propertyId, Object defaultValue)
          Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
 void writeJSProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSProperty(String propertyId, Object value)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSPropertyValueBindingRef(String propertyId)
          Write the value binding expression of the property if the property do have a value binding on it.
 void writeJSProxyCreation(String proxyClassName)
          Writes the creation of the JavaScript proxy of the component.
 void writeJSProxyCreation(String proxyClassName, Object[] params)
          Writes the creation of the JavaScript proxy of the component.
 void writeJSSessionAttributeStringProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSStringArrayProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSStringMapProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSStringProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSStringProperty(String propertyId, Object value)
          Writes in the current response writer the JavaScript setting of a property of a component.
 void writeJSURLProperty(String propertyId)
          Writes in the current response writer the JavaScript setting of a property of a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDHTMLResponseWriter

public IlvDHTMLResponseWriter(FacesContext context,
                              UIComponent component)
Creates an IlvDHTMLResponseWriter.

Parameters:
context - The current faces context instance.
component - The current component that is being rendered.
Method Detail

getSupport

public ResponseWriter getSupport()
Returns the support response writer.

Returns:
The support response writer.
Since:
JViews 7.5

write

public void write(String s)
           throws IOException
Writes a string into the response writer.

Parameters:
s - The string to write.
Throws:
IOException
Since:
JViews 7.5

writeJSProxyCreation

public void writeJSProxyCreation(String proxyClassName)
                          throws IOException
Writes the creation of the JavaScript proxy of the component.
Example: jsRef = new ProxyClass(jsRef);

Parameters:
proxyClassName - The class name of the JavaScript proxy.
Throws:
IOException

writeJSProxyCreation

public void writeJSProxyCreation(String proxyClassName,
                                 Object[] params)
                          throws IOException
Writes the creation of the JavaScript proxy of the component.
Example: jsRef = new ProxyClass(jsRef, param1, param2, ...);. The jsRef parameter is implicitly declared and therefore it does not need to be included in the parameters list.

Parameters:
proxyClassName - The class name of the JavaScript proxy.
params - The parameters used in the constructor. If the parameter is a string, the writer will generate quotes around the paramenter.
Throws:
IOException

writeJSProperty

public void writeJSProperty(String propertyId)
                     throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The value must be a JavaScript reference or a number. If the value is a string, use writeJSStringProperty instead.

Parameters:
propertyId - The property to set.
Throws:
IOException

writeJSProperty

public void writeJSProperty(String propertyId,
                            Object value)
                     throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value is retrieved in the component.
If the value is a string, use writeJSStringProperty instead.

Parameters:
propertyId - The property to set.
value - The property value to set.
Throws:
IOException

writeJSStringProperty

public void writeJSStringProperty(String propertyId)
                           throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value is retrieved in the component.
The value must be a JavaScript string that will be enclosed with "'" characters. If the value is a reference or a number, use writeJSProperty instead.

Parameters:
propertyId - The property to set.
Throws:
IOException

writeJSSessionAttributeStringProperty

public void writeJSSessionAttributeStringProperty(String propertyId)
                                           throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value is retrieved in the component.
The value must be a JavaScript string that will be enclosed with "'" characters. If the value is a reference or a number, use writeJSProperty instead.
This string will be encoded using IlvDHTMLUtil.encodeNamespace method to handle the portlet case.

Parameters:
propertyId - The property to set.
Throws:
IOException
Since:
JViews 8.0

writeJSStringProperty

public void writeJSStringProperty(String propertyId,
                                  Object value)
                           throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The value must be a JavaScript string that will be enclosed with "'" characters. If the value is a reference or a number, use writeJSProperty instead.

Parameters:
propertyId - The property to set.
value - The property value to set.
Throws:
IOException

writeJSURLProperty

public void writeJSURLProperty(String propertyId)
                        throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property is a string that represents a URL. If the URL is relative, context.getExternalContext().encodeResourceURL(url) will be called.

Parameters:
propertyId - The property to set.
Throws:
IOException

writeJSPrimitiveProperty

public void writeJSPrimitiveProperty(String propertyId,
                                     Object defaultValue)
                              throws IOException
Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
The property is a primitive value. So, it is necessary to test the property value with the default value to determine whether generating the JavaScript code or not.

Parameters:
propertyId - The ID of the property.
defaultValue - If the current property value is this value, do not render.
Throws:
IOException

writeJSDependencyProperty

public void writeJSDependencyProperty(String propertyId)
                               throws IOException
Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
The property is a dependency property. The generation of the JavaScript code is made under different conditions (render state of the dependency).

Parameters:
propertyId - The ID of the property.
Throws:
IOException

writeJSColorPropertyWithoutPrefix

public void writeJSColorPropertyWithoutPrefix(String propertyId)
                                       throws IOException
Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
The property is a java.awt.Color.
The value of the color will be emitted as RRGGBB format.

Parameters:
propertyId - The ID of the property.
Throws:
IOException

writeJSColorProperty

public void writeJSColorProperty(String propertyId)
                          throws IOException
Writes the JavaScript code to set on the JavaScript component proxy the value of the property.
The property is a java.awt.Color.
The value of the color will be emitted as #RRGGBB format.

Parameters:
propertyId - The ID of the property.
Throws:
IOException

writeJSHandler

public void writeJSHandler(String jsHandler,
                           String jsCode)
                    throws IOException
Writes a JavaScript handler on the event generated by the component jsRef. The implicit parameter of the listener is 'view'.

Parameters:
jsHandler - The name of the JavaScript handler to add.
jsCode - The code that will be executed when the specified event is sent.
Throws:
IOException

writeJSHandlerProperty

public void writeJSHandlerProperty(String propertyId)
                            throws IOException
Writes the JavaScript code to set on the JavaScript component proxy the value of the property.

Parameters:
propertyId - The ID of the property.
Throws:
IOException

writeJSHandlerProperty

public void writeJSHandlerProperty(String propertyId,
                                   String[] params)
                            throws IOException
Writes in the current response writer the registering of a JavaScript handler on an event.

Parameters:
propertyId - The property to set.
params - The array of parameters.
Throws:
IOException
Since:
JViews 7.5

writeJSHandler

public void writeJSHandler(String jsHandler,
                           String jsCode,
                           String[] params)
                    throws IOException
Writes in the current response writer the registering of a JavaScript handler on an event.

Parameters:
jsHandler - The event without the prefix 'on'.
jsCode - The JavaScript handler.
params - The array of parameters.
Throws:
IOException

writeJSBodyEventHandler

public void writeJSBodyEventHandler(String event,
                                    String jsMethod)
                             throws IOException
Writes javascript code to register a function as a listener to a specified event on the <BODY> element.

Parameters:
event - The javascript event to register on the <BODY> element.
jsMethod - The method to register.
Throws:
IOException

writeJSPropertyValueBindingRef

public void writeJSPropertyValueBindingRef(String propertyId)
                                    throws IOException
Write the value binding expression of the property if the property do have a value binding on it. If not, this method retrieves the property value and if this property is not null it stores it in the session and renders the associated value binding expression.

Parameters:
propertyId - The ID of the property.
Throws:
IOException
Since:
JViews 7.5

writeJSMethodBindingProperty

public void writeJSMethodBindingProperty(String propertyId)
                                  throws IOException
Write the method binding expression.

Parameters:
propertyId - The ID of the property.
Throws:
IOException
Since:
JViews 7.5

writeJSClassNameOrValueBindingRef

public void writeJSClassNameOrValueBindingRef(String refPropertyId,
                                              String classPropertyId)
                                       throws IOException
Write the value binding expression of the refPropertyId if the property do have a value binding on it. If not fallback by retrieving the classPropertyId property value and write this value instead.

Parameters:
refPropertyId - The ID of the reference property.
classPropertyId - The ID of the property that contain the class.
Throws:
IOException
Since:
JViews 7.5

writeJSStringArrayProperty

public void writeJSStringArrayProperty(String propertyId)
                                throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value must represents an array or collection of String.

Parameters:
propertyId - The property to set.
Throws:
IOException
Since:
JViews 8.0

writeJSArrayProperty

public void writeJSArrayProperty(String propertyId)
                          throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value must represents an array or collection of values. If the values are JavaScript string, use writeJSStringArrayProperty instead.

Parameters:
propertyId - The property to set.
Throws:
IOException
Since:
JViews 8.0

writeJSStringMapProperty

public void writeJSStringMapProperty(String propertyId)
                              throws IOException
Writes in the current response writer the JavaScript setting of a property of a component. The property value must represents a Map for which keys and values are String instances.

Parameters:
propertyId - The property to set.
Throws:
IOException
Since:
JViews 8.0

startScriptSection

public void startScriptSection()
                        throws IOException
Starts a scripting section.

Throws:
IOException
Since:
JViews 7.5

endScriptSection

public void endScriptSection()
                      throws IOException
Close a scripting section.

Throws:
IOException
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.