wicket.contrib.tinymce
Class InPlaceSaveBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.behavior.AbstractAjaxBehavior
          extended by org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
              extended by wicket.contrib.tinymce.InPlaceSaveBehavior
All Implemented Interfaces:
Serializable, IBehaviorListener, IClusterable, IComponentAwareEventSink, IRequestListener, IComponentAwareHeaderContributor

public class InPlaceSaveBehavior
extends AbstractDefaultAjaxBehavior

This behavior adds saving functionality to an editor for in-place editing of content. In most cases you will want to use InPlaceEditComponent instead of this class directly.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
 
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener
INTERFACE
 
Constructor Summary
InPlaceSaveBehavior()
           
 
Method Summary
 String getCancelCallbackName()
           
 String getSaveCallbackName()
          Returns the name of the JavaScript function that handles the save event.
 Component getTheComponent()
           
protected  String onSave(AjaxRequestTarget target, String newContent)
          This method gets called before the new content as received from the TinyMce editor is pushed to the website.
 void renderHead(Component c, IHeaderResponse response)
           
protected  void respond(AjaxRequestTarget target)
           
 void setAdditionalJavaScript(String additionalJavaScript)
           
 
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, getCallbackScript, getChannel, getChannelName, getFailureScript, getPreconditionScript, getSuccessScript, onBind, onRequest, throttleScript
 
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag
 
Methods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListenerInterface, detach, isEnabled, isTemporary, onConfigure, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InPlaceSaveBehavior

public InPlaceSaveBehavior()
Method Detail

setAdditionalJavaScript

public void setAdditionalJavaScript(String additionalJavaScript)
Parameters:
additionalJavaScript - Additional javascript code that will be appended to the save and cancel callback functions. You can use this to e.g. show or hide buttons based on the state of the in-place-edit component.

respond

protected final void respond(AjaxRequestTarget target)
Specified by:
respond in class AbstractDefaultAjaxBehavior

getSaveCallbackName

public final String getSaveCallbackName()
Returns the name of the JavaScript function that handles the save event. (Replace the editor with the saved content in the original component).

Returns:
Name of the javascript function, used by WicketSave plugin, see WicketSavePlugin

getCancelCallbackName

public final String getCancelCallbackName()

getTheComponent

public Component getTheComponent()

onSave

protected String onSave(AjaxRequestTarget target,
                        String newContent)
This method gets called before the new content as received from the TinyMce editor is pushed to the website. Override it to add additional processing to the content.

Parameters:
newContent - The content as received from the editor.
Returns:
The content that will be pushed back to your website.

renderHead

public void renderHead(Component c,
                       IHeaderResponse response)
Specified by:
renderHead in interface IComponentAwareHeaderContributor
Overrides:
renderHead in class AbstractDefaultAjaxBehavior


Copyright © 2004-2011. All Rights Reserved.