You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wicketyan <wi...@gmail.com> on 2010/04/12 15:59:26 UTC

how to make a wicket web editor

hi guys,I'm a freshman on js.Could anyone tell me how to user a web editor in wicket.I know wicket-stuff already have a project tinymce,But I don't like tinymce.There are so many web editor,I want to use my favorated editor.I just knew a little about abstractajaxbehavior,But something deep is hard for me,for example,the ajax upload using jquery.How to  encapsulate ajax upload using wicket? to understand tinymce project is hard for me now.so, hope someone can tell me how to use these editor writted by jquery or introduce tinymce project's detail about image upload.
 
 the editor xheditor use this  

$('#elm2').xheditor({upLinkUrl:"upload.php?immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php?immediate=1",upFlashExt:"swf",upMediaUrl:"upload.php?immediate=1",upMediaExt:"avi"}); 

the upload.php?immediate=1 is a interface to save the data,and if I use servlet ,that's easy.chang the url to a new url like xxxxx.do,writing a url-pattern in web.xml. But this is not a wicket way.
2010-04-12 



wicketyan 

Re: How to get stable DOM IDs without hacks?

Posted by Pierre Goupil <go...@gmail.com>.
Hello,

You can use myComponent.setMarkupId("blah"), but then it's up to you to
ensure the id uniqueness.

Regards,

Pierre


On Tue, Apr 13, 2010 at 12:35 AM, <bh...@actrix.gen.nz> wrote:

> Hi,
>
> Wicket has its own mind - it changes IDs in HTML forms so JavaScript
> breaks.
>
> Example:
>
> Source:
> <input type="button" wicket:id="addButton" id="addButton"
> value="Add"/>
>
> Generated:
> <input type="button" id="addButtona" value="Add" name="addButton"/>
>
> Please note that Wicket renames the id from "addButton" to
> "addButtona" while it does not change the name attribute value.
>
> So we would have to create a Button subclass and:
>
>    @Override
>    public String getMarkupId(){
>        // As an example, use the wicket:id value ...
>        return getId();
>    }
>
> and in HTML, we have to write a warning as a reminder of this hack:
>    <!-- Wicket overrides id from wicket:id value -->
>
> This is a maintenance problem and a performance problem because the
> additinal classes cost memory and CPU.
>
> Any ideas?
>
> Thanks,
>
> Bernard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Les deux règles universelles du bide :

1) on n'explique pas un bide

2) dans le futur, un bide sera toujours un bide.

How to get stable DOM IDs without hacks?

Posted by bh...@actrix.gen.nz.
Hi,

Wicket has its own mind - it changes IDs in HTML forms so JavaScript
breaks.

Example:

Source:
<input type="button" wicket:id="addButton" id="addButton"
value="Add"/>

Generated:
<input type="button" id="addButtona" value="Add" name="addButton"/>

Please note that Wicket renames the id from "addButton" to
"addButtona" while it does not change the name attribute value.

So we would have to create a Button subclass and:

    @Override
    public String getMarkupId(){
        // As an example, use the wicket:id value ...
        return getId();
    }

and in HTML, we have to write a warning as a reminder of this hack:
    <!-- Wicket overrides id from wicket:id value -->

This is a maintenance problem and a performance problem because the
additinal classes cost memory and CPU.

Any ideas?

Thanks,

Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Re: how to make a wicket web editor

Posted by 严杰 <wi...@gmail.com>.
yes,nicedit is pretty cool,But what a pity is this example has no image
upload.I will use it,

thanks Carman,thank you again.

在 2010年4月13日 下午9:48,James Carman <jc...@carmanconsulting.com>写道:

> Have you tried using visrual wicket's rich text editor?  There's an
> example here:
>
> http://visural-wicket-examples.appspot.com/app/
>
> I've never used it, but it looks pretty cool (so does the other stuff).
>
> On Tue, Apr 13, 2010 at 6:49 AM, wicketyan <wi...@gmail.com> wrote:
> > thanks mj! it looks like I have to learn jquery.your second solution is
> too hard for me.
> >
> >
> >
> >
> > 2010-04-13
> >
> >
> >
> > wicketyan
> >
> >
> >
> > 发件人: m j
> > 发送时间: 2010-04-13  11:56:26
> > 收件人: users
> > 抄送:
> > 主题: Re: how to make a wicket web editor
> >
> > Well, if you know how to use JQuery you can "hard" code the javascript
> and
> > html into the page, which is pretty easy and obvious as it just goes into
> > the HTML.
> > The other option if your familiar at all with Wicket is to put it into a
> > panel to allow more control and usability.
> > On Mon, Apr 12, 2010 at 9:59 AM, wicketyan <wi...@gmail.com> wrote:
> >>
> >> hi guys,I'm a freshman on js.Could anyone tell me how to user a web
> editor
> >> in wicket.I know wicket-stuff already have a project tinymce,But I don't
> >> like tinymce.There are so many web editor,I want to use my favorated
> >> editor.I just knew a little about abstractajaxbehavior,But something
> deep is
> >> hard for me,for example,the ajax upload using jquery.How to  encapsulate
> >> ajax upload using wicket? to understand tinymce project is hard for me
> >> now.so, hope someone can tell me how to use these editor writted by
> jquery
> >> or introduce tinymce project's detail about image upload.
> >>
> >>  the editor xheditor use this
> >>
> >>
> >>
> $('#elm2').xheditor({upLinkUrl:"upload.php?immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php?immediate=1",upFlashExt:"swf",upMediaUrl:"upload.php?immediate=1",upMediaExt:"avi"});
> >>
> >> the upload.php?immediate=1 is a interface to save the data,and if I use
> >> servlet ,that's easy.chang the url to a new url like xxxxx.do,writing a
> >> url-pattern in web.xml. But this is not a wicket way.
> >> 2010-04-12
> >>
> >>
> >>
> >> wicketyan
> >>
> >
>
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Re: how to make a wicket web editor

Posted by James Carman <jc...@carmanconsulting.com>.
Have you tried using visrual wicket's rich text editor?  There's an
example here:

http://visural-wicket-examples.appspot.com/app/

I've never used it, but it looks pretty cool (so does the other stuff).

On Tue, Apr 13, 2010 at 6:49 AM, wicketyan <wi...@gmail.com> wrote:
> thanks mj! it looks like I have to learn jquery.your second solution is too hard for me.
>
>
>
>
> 2010-04-13
>
>
>
> wicketyan
>
>
>
> 发件人: m j
> 发送时间: 2010-04-13  11:56:26
> 收件人: users
> 抄送:
> 主题: Re: how to make a wicket web editor
>
> Well, if you know how to use JQuery you can "hard" code the javascript and
> html into the page, which is pretty easy and obvious as it just goes into
> the HTML.
> The other option if your familiar at all with Wicket is to put it into a
> panel to allow more control and usability.
> On Mon, Apr 12, 2010 at 9:59 AM, wicketyan <wi...@gmail.com> wrote:
>>
>> hi guys,I'm a freshman on js.Could anyone tell me how to user a web editor
>> in wicket.I know wicket-stuff already have a project tinymce,But I don't
>> like tinymce.There are so many web editor,I want to use my favorated
>> editor.I just knew a little about abstractajaxbehavior,But something deep is
>> hard for me,for example,the ajax upload using jquery.How to  encapsulate
>> ajax upload using wicket? to understand tinymce project is hard for me
>> now.so, hope someone can tell me how to use these editor writted by jquery
>> or introduce tinymce project's detail about image upload.
>>
>>  the editor xheditor use this
>>
>>
>> $('#elm2').xheditor({upLinkUrl:"upload.php?immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php?immediate=1",upFlashExt:"swf",upMediaUrl:"upload.php?immediate=1",upMediaExt:"avi"});
>>
>> the upload.php?immediate=1 is a interface to save the data,and if I use
>> servlet ,that's easy.chang the url to a new url like xxxxx.do,writing a
>> url-pattern in web.xml. But this is not a wicket way.
>> 2010-04-12
>>
>>
>>
>> wicketyan
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Re: how to make a wicket web editor

Posted by wicketyan <wi...@gmail.com>.
thanks mj! it looks like I have to learn jquery.your second solution is too hard for me.

        


2010-04-13 



wicketyan 



发件人: m j 
发送时间: 2010-04-13  11:56:26 
收件人: users 
抄送: 
主题: Re: how to make a wicket web editor 
 
Well, if you know how to use JQuery you can "hard" code the javascript and
html into the page, which is pretty easy and obvious as it just goes into
the HTML.
The other option if your familiar at all with Wicket is to put it into a
panel to allow more control and usability.
On Mon, Apr 12, 2010 at 9:59 AM, wicketyan <wi...@gmail.com> wrote:
>
> hi guys,I'm a freshman on js.Could anyone tell me how to user a web editor
> in wicket.I know wicket-stuff already have a project tinymce,But I don't
> like tinymce.There are so many web editor,I want to use my favorated
> editor.I just knew a little about abstractajaxbehavior,But something deep is
> hard for me,for example,the ajax upload using jquery.How to  encapsulate
> ajax upload using wicket? to understand tinymce project is hard for me
> now.so, hope someone can tell me how to use these editor writted by jquery
> or introduce tinymce project's detail about image upload.
>
>  the editor xheditor use this
>
>
> $('#elm2').xheditor({upLinkUrl:"upload.php?immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php?immediate=1",upFlashExt:"swf",upMediaUrl:"upload.php?immediate=1",upMediaExt:"avi"});
>
> the upload.php?immediate=1 is a interface to save the data,and if I use
> servlet ,that's easy.chang the url to a new url like xxxxx.do,writing a
> url-pattern in web.xml. But this is not a wicket way.
> 2010-04-12
>
>
>
> wicketyan
>

Re: how to make a wicket web editor

Posted by m j <ms...@gmail.com>.
Well, if you know how to use JQuery you can "hard" code the javascript and
html into the page, which is pretty easy and obvious as it just goes into
the HTML.

The other option if your familiar at all with Wicket is to put it into a
panel to allow more control and usability.

On Mon, Apr 12, 2010 at 9:59 AM, wicketyan <wi...@gmail.com> wrote:

>
> hi guys,I'm a freshman on js.Could anyone tell me how to user a web editor
> in wicket.I know wicket-stuff already have a project tinymce,But I don't
> like tinymce.There are so many web editor,I want to use my favorated
> editor.I just knew a little about abstractajaxbehavior,But something deep is
> hard for me,for example,the ajax upload using jquery.How to  encapsulate
> ajax upload using wicket? to understand tinymce project is hard for me
> now.so, hope someone can tell me how to use these editor writted by jquery
> or introduce tinymce project's detail about image upload.
>
>  the editor xheditor use this
>
>
> $('#elm2').xheditor({upLinkUrl:"upload.php?immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php?immediate=1",upFlashExt:"swf",upMediaUrl:"upload.php?immediate=1",upMediaExt:"avi"});
>
> the upload.php?immediate=1 is a interface to save the data,and if I use
> servlet ,that's easy.chang the url to a new url like xxxxx.do,writing a
> url-pattern in web.xml. But this is not a wicket way.
> 2010-04-12
>
>
>
> wicketyan
>