Have you tried using this in a ajax based form in Wicket?  It seems that it
does not like ajax based submits but the "solutions" in the nicedit forums
seems to be fail as well.

The problem is that the model for the textarea you add the nic behavior to,
never gets updated when you submit the form.  In the scenario I was testing,
it is AjaxButton for submission.



francisco treacy-2 wrote:
> 
> hi,
> 
> i thought i'd like to share a simple behaviour for NicEdit
> (http://nicedit.com/).
> 
> to use it, just download nicedit and modify NICEDIT_JAVASCRIPT and
> NICEDIT_ICONS accordingly.  (i chose to put them together in the same
> package).
> if you download the basic version (without xhtml/ code view), when
> adding the behaviour pass 'false' into the constructor, in order not
> to use the full panel.
> 
> of course, you can use it with multiple textareas in the same page.
> 
> let me know if you run into some problem using it. should this belong
> to the wiki as well?
> 
> francisco
> 
> 
> public class NicEditTextAreaBehavior extends AbstractBehavior {
> 
>       private Component<TextArea<String>> textArea;
>       private Boolean fullPanel = Boolean.TRUE;
>       
>       private static final ResourceReference NICEDIT_JAVASCRIPT =
>               new JavascriptResourceReference(NicEditTextAreaBehavior.class,
> "nicEdit.js");
>       
>       private static final ResourceReference NICEDIT_ICONS = new
> ResourceReference(NicEditTextAreaBehavior.class,
>               "nicEditorIcons.gif");
>       
>       public NicEditTextAreaBehavior() {
>       }
>       
>       public NicEditTextAreaBehavior(Boolean fullPanel) {
>               this.fullPanel = fullPanel;
>       }       
>       
>       @Override @SuppressWarnings("unchecked")
>       public void bind(Component component) {
>               this.textArea = component;
>               component.setOutputMarkupId(true);
>       }
>       
>       @Override
>       public void renderHead(IHeaderResponse response) {
>               super.renderHead(response);
>               response.renderJavascriptReference(NICEDIT_JAVASCRIPT);
>               response.renderOnDomReadyJavascript("new nicEditor({iconsPath : 
> '"+
> RequestCycle.get().urlFor(
>                               NICEDIT_ICONS) +"', fullPanel : "+ fullPanel 
> +"}).panelInstance('"
> + textArea.getMarkupId() + "');");
>       }
> 
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/NicEditTextAreaBehavior-tp17840648p17871532.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to