@ResourceDependencies({ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js") })
@JsfBehaviorRenderer(type = "org.richfaces.component.behavior.ToggleControl")
public class ToggleControlRenderer extends ClientBehaviorRenderer {
@Override
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
ToggleControl control = (ToggleControl) behavior;
StringBuilder builder = new StringBuilder();
builder.append("RichFaces.$('").append(control.getPanelId(behaviorContext)).append("').switchToItem('")
.append(control.getTargetItem()).append("'); return ").append(!control.getDisableDefault()).append(';');
return builder.toString();
}