|
Project Wonder 5.0 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.webobjects.appserver.WOElement
com.webobjects.appserver.WODynamicElement
com.webobjects.appserver._private.WODynamicGroup
er.ajax.AjaxDynamicElement
er.coolcomponents.CCRating
public class CCRating
WebObjects wrapper for LivePipe Rating component, MIT license.
CCRating is a fully customizable CSS based ratings widget. By default it acts as an input. Alternatively, it can notify the server when the rating is changed, update the bound value, and call an action method.
It uses four (customizable) CSS class names to determine each link's state:
Example Usages
Rating: CCRating {
value = rating;
}
Rating: CCRating {
value = rating;
actAsInput = false;
}
Rating: CCRating {
value = rating;
actAsInput = false;
action = rated;
}
Rating: CCRating {
value = rating;
min = 1;
max = 10;
multiple = true;
}
| Bindings | |
value | the value to show in the ratings widget and the value set when the user selects a different rating |
actAsInput | optional, default is true, if false updates the value binding when clicked and optionally calls action method |
action | optional, action method to fire when rating changed. Ignored if actAsInput is true or unbound |
min | optional, the value sent to the server when the lowest rating is selected, indirectly controls the number of rating points displayed |
max | optional, the value sent to the server when the highest rating is selected, indirectly controls the number of rating points displayed |
multiple | optional, true if the user can change a previous rating |
id | optional, HTML ID for the div and Control.Rating widget |
capture | optional, stops the click event on each rating from propagating |
style | optional CSS style for container element |
class | optional CSS class for container element in addition to the standard rating_container class |
classNames | optional, dictionary of state names and CSS class names with state names of: off, half, on, selected |
rated | optional, true if this has already been rated |
reverse | optional, true if the links should be shown in reverse order |
updateOptions | highly optional, Ajax Options for the request |
formValueName | optional, the name of the form value that will contain the value |
elementName | optional, defaults to div, the name of the HTML element to use to hold the rating UI |
afterChange, | optional, script to run client side after a change e.g. afterChange = "alert(v)";. Receives one
parameter, v, the new value selected |
| Field Summary |
|---|
| Fields inherited from class er.ajax.AjaxDynamicElement |
|---|
log |
| Fields inherited from class com.webobjects.appserver._private.WODynamicGroup |
|---|
_children |
| Fields inherited from class com.webobjects.appserver.WODynamicElement |
|---|
_ConstructorParameters |
| Constructor Summary | |
|---|---|
CCRating(String name,
NSDictionary associations,
WOElement children)
|
|
| Method Summary | |
|---|---|
protected boolean |
actAsInput(WOContext context)
|
protected void |
addRequiredWebResources(WOResponse response,
WOContext context)
Override this method to append the needed scripts for this component. |
void |
appendToResponse(WOResponse response,
WOContext context)
Build div, optional input, and JavaScript into response. |
protected NSMutableDictionary |
createOptions(WOContext context)
Produce dictionary for options object for Control.Rating. |
protected String |
formValueName(WOContext context)
|
WOActionResults |
handleRequest(WORequest request,
WOContext context)
Handles server action if this is not being use as an input. |
protected String |
id(WOContext context)
|
protected void |
setValueFromFormValue(WORequest request,
WOContext context)
Sets the value binding based on the form value. |
void |
takeValuesFromRequest(WORequest request,
WOContext context)
Sets value binding if this is being used as an input. |
| Methods inherited from class com.webobjects.appserver._private.WODynamicGroup |
|---|
addChildElement, appendChildrenToResponse, childrenElements, EmptyGroup, hasChildrenElements, invokeChildrenAction, takeChildrenValuesFromRequest, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CCRating(String name,
NSDictionary associations,
WOElement children)
| Method Detail |
|---|
protected void addRequiredWebResources(WOResponse response,
WOContext context)
AjaxDynamicElement
addRequiredWebResources in class AjaxDynamicElementcontext - the current context
public void appendToResponse(WOResponse response,
WOContext context)
appendToResponse in class AjaxDynamicElementresponse - the current responsecontext - the current contextAjaxDynamicElement.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)protected NSMutableDictionary createOptions(WOContext context)
context - WOContext providing component to resolve bindings in
public WOActionResults handleRequest(WORequest request,
WOContext context)
handleRequest in interface IAjaxElementhandleRequest in class AjaxDynamicElementrequest - the current requestcontext - the current context
AjaxDynamicElement.handleRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext),
takeValuesFromRequest(WORequest, WOContext)
public void takeValuesFromRequest(WORequest request,
WOContext context)
takeValuesFromRequest in class AjaxDynamicElementAjaxDynamicElement.takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext),
handleRequest(WORequest, WOContext)
protected void setValueFromFormValue(WORequest request,
WOContext context)
request - the WORequest to get the form values fromcontext - WOContext used to determine component used intakeValuesFromRequest(WORequest, WOContext),
handleRequest(WORequest, WOContext)protected String formValueName(WOContext context)
context - WOContext used to determine component used in
protected String id(WOContext context)
context - WOContext used to determine component used in
protected boolean actAsInput(WOContext context)
context - WOContext used to determine component used in
true if unbound
|
Last updated: Wed, Feb 22, 2012 07:00 AM EST | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||