Re: Big Problem with TinyMCE

2010-05-03 Thread Fernando Wermus
I've solved it with the following

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator(){
private static final long serialVersionUID = 4430011596296790970L;

@Override
public CharSequence decorateScript(CharSequence script) {
return "tinyMCE.triggerSave(true,true); " + script;
}
};
}

I don't need any extra button.


I think this could be a behavior, doesn't it?


On Mon, May 3, 2010 at 5:59 PM, Fernando Wermus
wrote:

> Nicolas,
> Your proposal work. But I have my TinyMCE in a modal window and it has
> stopped to close. In the other case, I don't get any string in text area,
> but my modal window close. I need both. Any suggestion?
>
> thanks in advance
>
>
>
> On Mon, May 3, 2010 at 12:06 PM, nicolas melendez wrote:
>
>> hey!
>> do this:
>>
>> add to the page a hidden ajaxSubmitLink and se it an id, for example:
>> "submitToServer". In the onclick java method of the hidden ajaxSubmitLink
>> do your java magic server-side.
>> Then in your submit button of the html page,  add a small javascript that
>> save HTML and then clicks the hidden link, for example:
>>
>> function() {
>> tinyMCE.triggerSave(true,true);
>>  document.getElementById('submitToServer').onclick();
>> };
>>
>> Your problem is that wicket recive the information that is in a hidden
>> textfield, but you have to say to tinyMce, to save in the hidden textfield
>> the html the user have been writing (thats what tinyMCE.triggerSave do)
>> then, when the data is saved in the textfield, you submit your form to the
>> server, and in the wicket code, you use it like a normal textfield.
>>
>> NM
>>
>>
>>
>>
>> On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus
>> wrote:
>>
>> > I run into the same problem. I cant see the text written in text area.
>> > Could
>> > show the code you have written?
>> >
>> > thanks in advance
>> >
>> > On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho 
>> wrote:
>> >
>> > > On your AjaxButton add TinyMceAjaxSubmitModifier.
>> > >
>> > > Kimotho.
>> > >
>> > > On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier <
>> brad.gr...@salusnovus.com
>> > > >wrote:
>> > >
>> > > > I'm trying to use a TinyMCE editor on a form (itself belonging to a
>> > panel
>> > > > added to a page via Ajax). The form is submitted via an AjaxButton.
>> > From
>> > > > other posts here and elsewhere I found I had to call
>> > > > "tinyMCE.triggerSave(true,true);" before the submit to get the data
>> > into
>> > > the
>> > > > textarea's model and then "tinyMCE.idCounter=0;" after the submit. I
>> > used
>> > > an
>> > > > IAjaxCallDecorator to add these functions to the submit button.
>> > > >
>> > > > The problem is that the form only submits with every other press of
>> the
>> > > > button. When it fails, it looks like no script appended after the
>> > > > triggerSave runs. Can anyone help me out? I'm stuck.
>> > > >
>> > > > Thanks,
>> > > > Brad
>> > >
>> >
>> >
>> >
>> > --
>> > Fernando Wermus.
>> >
>> > www.linkedin.com/in/fernandowermus
>> >
>>
>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Big Problem with TinyMCE

2010-05-03 Thread Fernando Wermus
Nicolas,
Your proposal work. But I have my TinyMCE in a modal window and it has
stopped to close. In the other case, I don't get any string in text area,
but my modal window close. I need both. Any suggestion?

thanks in advance



On Mon, May 3, 2010 at 12:06 PM, nicolas melendez wrote:

> hey!
> do this:
>
> add to the page a hidden ajaxSubmitLink and se it an id, for example:
> "submitToServer". In the onclick java method of the hidden ajaxSubmitLink
> do your java magic server-side.
> Then in your submit button of the html page,  add a small javascript that
> save HTML and then clicks the hidden link, for example:
>
> function() {
> tinyMCE.triggerSave(true,true);
>  document.getElementById('submitToServer').onclick();
> };
>
> Your problem is that wicket recive the information that is in a hidden
> textfield, but you have to say to tinyMce, to save in the hidden textfield
> the html the user have been writing (thats what tinyMCE.triggerSave do)
> then, when the data is saved in the textfield, you submit your form to the
> server, and in the wicket code, you use it like a normal textfield.
>
> NM
>
>
>
>
> On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus
> wrote:
>
> > I run into the same problem. I cant see the text written in text area.
> > Could
> > show the code you have written?
> >
> > thanks in advance
> >
> > On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho 
> wrote:
> >
> > > On your AjaxButton add TinyMceAjaxSubmitModifier.
> > >
> > > Kimotho.
> > >
> > > On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier <
> brad.gr...@salusnovus.com
> > > >wrote:
> > >
> > > > I'm trying to use a TinyMCE editor on a form (itself belonging to a
> > panel
> > > > added to a page via Ajax). The form is submitted via an AjaxButton.
> > From
> > > > other posts here and elsewhere I found I had to call
> > > > "tinyMCE.triggerSave(true,true);" before the submit to get the data
> > into
> > > the
> > > > textarea's model and then "tinyMCE.idCounter=0;" after the submit. I
> > used
> > > an
> > > > IAjaxCallDecorator to add these functions to the submit button.
> > > >
> > > > The problem is that the form only submits with every other press of
> the
> > > > button. When it fails, it looks like no script appended after the
> > > > triggerSave runs. Can anyone help me out? I'm stuck.
> > > >
> > > > Thanks,
> > > > Brad
> > >
> >
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> >
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Big Problem with TinyMCE

2010-05-03 Thread nicolas melendez
hey!
do this:

add to the page a hidden ajaxSubmitLink and se it an id, for example:
"submitToServer". In the onclick java method of the hidden ajaxSubmitLink
do your java magic server-side.
Then in your submit button of the html page,  add a small javascript that
save HTML and then clicks the hidden link, for example:

function() {
tinyMCE.triggerSave(true,true);
 document.getElementById('submitToServer').onclick();
};

Your problem is that wicket recive the information that is in a hidden
textfield, but you have to say to tinyMce, to save in the hidden textfield
the html the user have been writing (thats what tinyMCE.triggerSave do)
then, when the data is saved in the textfield, you submit your form to the
server, and in the wicket code, you use it like a normal textfield.

NM




On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus
wrote:

> I run into the same problem. I cant see the text written in text area.
> Could
> show the code you have written?
>
> thanks in advance
>
> On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho  wrote:
>
> > On your AjaxButton add TinyMceAjaxSubmitModifier.
> >
> > Kimotho.
> >
> > On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier  > >wrote:
> >
> > > I'm trying to use a TinyMCE editor on a form (itself belonging to a
> panel
> > > added to a page via Ajax). The form is submitted via an AjaxButton.
> From
> > > other posts here and elsewhere I found I had to call
> > > "tinyMCE.triggerSave(true,true);" before the submit to get the data
> into
> > the
> > > textarea's model and then "tinyMCE.idCounter=0;" after the submit. I
> used
> > an
> > > IAjaxCallDecorator to add these functions to the submit button.
> > >
> > > The problem is that the form only submits with every other press of the
> > > button. When it fails, it looks like no script appended after the
> > > triggerSave runs. Can anyone help me out? I'm stuck.
> > >
> > > Thanks,
> > > Brad
> >
>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>


Re: Big Problem with TinyMCE

2010-05-03 Thread Fernando Wermus
I run into the same problem. I cant see the text written in text area. Could
show the code you have written?

thanks in advance

On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho  wrote:

> On your AjaxButton add TinyMceAjaxSubmitModifier.
>
> Kimotho.
>
> On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier  >wrote:
>
> > I'm trying to use a TinyMCE editor on a form (itself belonging to a panel
> > added to a page via Ajax). The form is submitted via an AjaxButton. From
> > other posts here and elsewhere I found I had to call
> > "tinyMCE.triggerSave(true,true);" before the submit to get the data into
> the
> > textarea's model and then "tinyMCE.idCounter=0;" after the submit. I used
> an
> > IAjaxCallDecorator to add these functions to the submit button.
> >
> > The problem is that the form only submits with every other press of the
> > button. When it fails, it looks like no script appended after the
> > triggerSave runs. Can anyone help me out? I'm stuck.
> >
> > Thanks,
> > Brad
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Big Problem with TinyMCE

2010-05-03 Thread Robert Kimotho
On your AjaxButton add TinyMceAjaxSubmitModifier.

Kimotho.

On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier wrote:

> I'm trying to use a TinyMCE editor on a form (itself belonging to a panel
> added to a page via Ajax). The form is submitted via an AjaxButton. From
> other posts here and elsewhere I found I had to call
> "tinyMCE.triggerSave(true,true);" before the submit to get the data into the
> textarea's model and then "tinyMCE.idCounter=0;" after the submit. I used an
> IAjaxCallDecorator to add these functions to the submit button.
>
> The problem is that the form only submits with every other press of the
> button. When it fails, it looks like no script appended after the
> triggerSave runs. Can anyone help me out? I'm stuck.
>
> Thanks,
> Brad


Big Problem with TinyMCE

2010-04-29 Thread Brad Grier
I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added 
to a page via Ajax). The form is submitted via an AjaxButton. From other posts 
here and elsewhere I found I had to call "tinyMCE.triggerSave(true,true);" 
before the submit to get the data into the textarea's model and then 
"tinyMCE.idCounter=0;" after the submit. I used an IAjaxCallDecorator to add 
these functions to the submit button.

The problem is that the form only submits with every other press of the button. 
When it fails, it looks like no script appended after the triggerSave runs. Can 
anyone help me out? I'm stuck.

Thanks,
Brad