Re: Auto Complate Text Field Character Problem

2011-08-15 Thread bilgisever
   I thik there is no problem with general encoding because I can use turkish
character for some other place. Such as :
http://apache-wicket.1842946.n4.nabble.com/file/n3744005/Untitled.png 

 So, I have problem with AutoComplateTextField text field companent. It is
not accept turkish characters.

Thanks,

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Auto-Complate-Text-Field-Character-Problem-tp3738977p3744005.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Auto Complate Text Field Character Problem

2011-08-15 Thread Martin Grigorov
Sorry, for this problem you actually need
org.apache.wicket.settings.IRequestCycleSettings.setResponseRequestEncoding(String)

I remember such problem reporter by a user with Cyrillic characters.

On Mon, Aug 15, 2011 at 9:49 AM, bilgisever mehmetate...@hotmail.com wrote:
   I thik there is no problem with general encoding because I can use turkish
 character for some other place. Such as :
 http://apache-wicket.1842946.n4.nabble.com/file/n3744005/Untitled.png

  So, I have problem with AutoComplateTextField text field companent. It is
 not accept turkish characters.

 Thanks,

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Auto-Complate-Text-Field-Character-Problem-tp3738977p3744005.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: How to Ajax refresh captcha image (a image backed by DynamicImageResource)?

2011-08-15 Thread praveenhomkar
Hi I am able to reload the captcha image in the following way(Using JCaptcha)

package com.sybase365.mobiliser.web.consumer.pages.signup;
1Write a class for dynamic image as follows.

public abstract class CaptchaImage extends NonCachingImage {
public CaptchaImage(String id, final String challengeId) {
super(id);
setImageResource(new DynamicImageResource() {
protected byte[] getImageData() {
ByteArrayOutputStream os = new ByteArrayOutputStream();
String challengeId = String.valueOf(System.currentTimeMillis());
BufferedImage challenge = getImageCaptchaService()
.getImageChallengeForID(challengeId,
Session.get().getLocale());
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
try {
encoder.encode(challenge);
return os.toByteArray();
} catch (Exception e) {
throw new RuntimeException(e);
}
}   });}
protected abstract ImageCaptchaService getImageCaptchaService();
}

2 add it to form and provide a link to refresh it

img = generateCaptcha();// see this code in 3rd step
form.add(img);

form.add(new AjaxLink(captchLink) {
@Override
public void onClick(AjaxRequestTarget target) {
// counter++;

// target.addComponent(generateCaptcha());
target.addComponent(form.replace(generateCaptcha()));

}
});

3public NonCachingImage generateCaptcha() {
String challengeId = String.valueOf(System.currentTimeMillis());
img = new CaptchaImage(captchaImage, challengeId) {
@Override
protected ImageCaptchaService getImageCaptchaService() {
return captchaService;
}
};
img.setOutputMarkupId(true);
return img;

}
4 html
p /p
 # click me 


5 Don't forget to add the following in application-context.xml if u r using
spring injection

bean
class=com.octo.captcha.service.image.DefaultManageableImageCaptchaService
id=imageCaptchaService/

For any queries mail me praveenhom...@yahoo.com

Thanks
Praveen Homkar




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-Ajax-refresh-captcha-image-a-image-backed-by-DynamicImageResource-tp1858686p3744243.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Auto Complate Text Field Character Problem

2011-08-15 Thread bilgisever
getMarkupSettings().setDefaultMarkupEncoding(ISO-8859-3);
getRequestCycleSettings().setResponseRequestEncoding(ISO-8859-3);

I try it in Application init, encoding is changed but the problem is still
ongoing.   

Thanks,

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Auto-Complate-Text-Field-Character-Problem-tp3738977p3744253.html
Sent from the Users forum mailing list archive at Nabble.com.

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



onClick on Image

2011-08-15 Thread Charles Moulliard
Hi,

I would like to change the Locale setting when we click on a Image (flag
corresponding to the Locale - France, UK, ...).

So in my HTML page, I have defined the following HTML 

#   

and in the corresponding Wicket Class, the following code :

Link link = new Link(goFrench) {
@Override
public void onClick() {
getSession().setLocale(Locale.FRANCE);
}
};


add(link).add(new Image(frenchFlag, new
ResourceReference(BasePage.class, images/karaf-logo.png)));

But when I open the page in my browser, I get this error :

WicketMessage: Unable to find component with id 'frenchFlag' in
[MarkupContainer [Component id = goFrench]]. This means that you declared
wicket:id=frenchFlag in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.

Any help is welcome.

Regards,

Charles M. - Apache Committer

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: onClick on Image

2011-08-15 Thread Bas Gooren

If the image is inside the link, your code should read:

add(link);
link.add(new Image(...));

Bas

Op 15-8-2011 12:28, schreef Charles Moulliard:

Hi,

I would like to change the Locale setting when we click on a Image (flag
corresponding to the Locale - France, UK, ...).

So in my HTML page, I have defined the following HTML

#

and in the corresponding Wicket Class, the following code :

 Link link = new Link(goFrench) {
@Override
public void onClick() {
getSession().setLocale(Locale.FRANCE);
}
};


 add(link).add(new Image(frenchFlag, new
ResourceReference(BasePage.class, images/karaf-logo.png)));

But when I open the page in my browser, I get this error :

WicketMessage: Unable to find component with id 'frenchFlag' in
[MarkupContainer [Component id = goFrench]]. This means that you declared
wicket:id=frenchFlag in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.

Any help is welcome.

Regards,

Charles M. - Apache Committer

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: onClick on Image

2011-08-15 Thread Dmitriy V. Ivanov

And what is your markup?

15 Август 2011 г. 16:28:00, Charles Moulliard писал:


Hi,

I would like to change the Locale setting when we click on a Image (flag
corresponding to the Locale - France, UK, ...).

So in my HTML page, I have defined the following HTML

#

and in the corresponding Wicket Class, the following code :

Link link = new Link(goFrench) {
@Override
public void onClick() {
getSession().setLocale(Locale.FRANCE);
}
};


add(link).add(new Image(frenchFlag, new
ResourceReference(BasePage.class, images/karaf-logo.png)));

But when I open the page in my browser, I get this error :

WicketMessage: Unable to find component with id 'frenchFlag' in
[MarkupContainer [Component id = goFrench]]. This means that you declared
wicket:id=frenchFlag in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.

Any help is welcome.

Regards,

Charles M. - Apache Committer

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html

Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: onClick on Image

2011-08-15 Thread vineet semwal
add(link).add(new Image(frenchFlag, new
ResourceReference(BasePage.class, images/karaf-logo.png)));

^^ is the problem
add(link)  actually returns the container to which you are adding
component so you are actually not adding image to link

and i think in your html you have specified image to be child of link
is what error saying..

On Mon, Aug 15, 2011 at 3:58 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 Hi,

 I would like to change the Locale setting when we click on a Image (flag
 corresponding to the Locale - France, UK, ...).

 So in my HTML page, I have defined the following HTML

 #

 and in the corresponding Wicket Class, the following code :

        Link link = new Link(goFrench) {
                        @Override
                        public void onClick() {
                                getSession().setLocale(Locale.FRANCE);
                        }
                };


        add(link).add(new Image(frenchFlag, new
 ResourceReference(BasePage.class, images/karaf-logo.png)));

 But when I open the page in my browser, I get this error :

 WicketMessage: Unable to find component with id 'frenchFlag' in
 [MarkupContainer [Component id = goFrench]]. This means that you declared
 wicket:id=frenchFlag in your markup, but that you either did not add the
 component to your page at all, or that the hierarchy does not match.

 Any help is welcome.

 Regards,

 Charles M. - Apache Committer

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
thank you,

regards,
Vineet Semwal

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



Re: onClick on Image

2011-08-15 Thread Charles Moulliard
Here is the code which was missing from my topic post --

 #   

Regards,

Charles
   


Иванов Дмитрий wrote:
 
 And what is your markup?
 
 15 Август 2011 г. 16:28:00, Charles Moulliard писал:

 Hi,

 I would like to change the Locale setting when we click on a Image (flag
 corresponding to the Locale - France, UK, ...).

 So in my HTML page, I have defined the following HTML

 #

 and in the corresponding Wicket Class, the following code :

 Link link = new Link(goFrench) {
 @Override
 public void onClick() {
 getSession().setLocale(Locale.FRANCE);
 }
 };


 add(link).add(new Image(frenchFlag, new
 ResourceReference(BasePage.class, images/karaf-logo.png)));

 But when I open the page in my browser, I get this error :

 WicketMessage: Unable to find component with id 'frenchFlag' in
 [MarkupContainer [Component id = goFrench]]. This means that you declared
 wicket:id=frenchFlag in your markup, but that you either did not add the
 component to your page at all, or that the hierarchy does not match.

 Any help is welcome.

 Regards,

 Charles M. - Apache Committer

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
 Sent from the Users forum mailing list archive at Nabble.com.

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

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

Иванов Дмитрий wrote:
 
 And what is your markup?
 
 15 Август 2011 г. 16:28:00, Charles Moulliard писал:

 Hi,

 I would like to change the Locale setting when we click on a Image (flag
 corresponding to the Locale - France, UK, ...).

 So in my HTML page, I have defined the following HTML

 #

 and in the corresponding Wicket Class, the following code :

 Link link = new Link(goFrench) {
 @Override
 public void onClick() {
 getSession().setLocale(Locale.FRANCE);
 }
 };


 add(link).add(new Image(frenchFlag, new
 ResourceReference(BasePage.class, images/karaf-logo.png)));

 But when I open the page in my browser, I get this error :

 WicketMessage: Unable to find component with id 'frenchFlag' in
 [MarkupContainer [Component id = goFrench]]. This means that you declared
 wicket:id=frenchFlag in your markup, but that you either did not add the
 component to your page at all, or that the hierarchy does not match.

 Any help is welcome.

 Regards,

 Charles M. - Apache Committer

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
 Sent from the Users forum mailing list archive at Nabble.com.

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

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

Иванов Дмитрий wrote:
 
 And what is your markup?
 
 15 Август 2011 г. 16:28:00, Charles Moulliard писал:

 Hi,

 I would like to change the Locale setting when we click on a Image (flag
 corresponding to the Locale - France, UK, ...).

 So in my HTML page, I have defined the following HTML

 #

 and in the corresponding Wicket Class, the following code :

 Link link = new Link(goFrench) {
 @Override
 public void onClick() {
 getSession().setLocale(Locale.FRANCE);
 }
 };


 add(link).add(new Image(frenchFlag, new
 ResourceReference(BasePage.class, images/karaf-logo.png)));

 But when I open the page in my browser, I get this error :

 WicketMessage: Unable to find component with id 'frenchFlag' in
 [MarkupContainer [Component id = goFrench]]. This means that you declared
 wicket:id=frenchFlag in your markup, but that you either did not add the
 component to your page at all, or that the hierarchy does not match.

 Any help is welcome.

 Regards,

 Charles M. - Apache Committer

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.html
 Sent from the Users forum mailing list archive at Nabble.com.

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

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


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744330.html
Sent from the Users forum mailing list archive at Nabble.com.


Re: Auto Complate Text Field Character Problem

2011-08-15 Thread İzlem Gözükeleş
Hi,
I also had problem about Turkish characters (ç, ş,İ,ğ) and solved problem:

* Add these lines to the Application class's init method:
 getRequestCycleSettings().setResponseRequestEncoding(UTF-8);
 getMarkupSettings().setDefaultMarkupEncoding(UTF-8);

* After this, I re-configured tomcat's server.xml file and modified
connector for UTF-8 encoding:
Connector port=80 protocol=org.apache.coyote.http11.Http11AprProtocol
   connectionTimeout=2
   URIEncoding=UTF-8
   ^
   redirectPort=8443 /


On Mon, Aug 15, 2011 at 12:55 PM, bilgisever mehmetate...@hotmail.comwrote:

 getMarkupSettings().setDefaultMarkupEncoding(ISO-8859-3);
 getRequestCycleSettings().setResponseRequestEncoding(ISO-8859-3);

 I try it in Application init, encoding is changed but the problem is still
 ongoing.

 Thanks,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Auto-Complate-Text-Field-Character-Problem-tp3738977p3744253.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: onClick on Image

2011-08-15 Thread Charles Moulliard
Thx for the remark. That works now.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744332.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Issue with french accent

2011-08-15 Thread Charles Moulliard
Hi,

I have created a xxx_fr.properties file to translate labels from English to
French. During the display, the french accents are removed the html page. I
have tried to use in the properties file the following syntax :

table.repertory = Reacute;pertoire

but that does not help too 

Regards,

Charles M.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-french-accent-tp3744402p3744402.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Issue with french accent

2011-08-15 Thread Andreas Pieber
Not sure what is the correct setting. But if you use eclipse you can try the
propedit plugin translating such chars correctly.

Kind regards, Andreas
On Aug 15, 2011 1:39 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 Hi,

 I have created a xxx_fr.properties file to translate labels from English
to
 French. During the display, the french accents are removed the html page.
I
 have tried to use in the properties file the following syntax :

 table.repertory = Reacute;pertoire

 but that does not help too

 Regards,

 Charles M.

 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Issue-with-french-accent-tp3744402p3744402.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Issue with french accent

2011-08-15 Thread Martin Grigorov
Better use XML properties. There is no need to UTF encode the special
characters.
In Wicket 1.5 just rename the file to xxx_fr.properties.xml
and the structure is
entry key=someKeysomeValue/entry

See java.util.Properties#loadFromXml() for more details.

In Wicket 1.4 the file extension is .xml.

In .properties file you need to encode the special chars as \u1234.
You can use Java's native2ascii or
http://www.wicket-library.com/wicket-examples/unicodeconverter

On Mon, Aug 15, 2011 at 2:44 PM, Andreas Pieber anpie...@gmail.com wrote:
 Not sure what is the correct setting. But if you use eclipse you can try the
 propedit plugin translating such chars correctly.

 Kind regards, Andreas
 On Aug 15, 2011 1:39 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 Hi,

 I have created a xxx_fr.properties file to translate labels from English
 to
 French. During the display, the french accents are removed the html page.
 I
 have tried to use in the properties file the following syntax :

 table.repertory = Reacute;pertoire

 but that does not help too

 Regards,

 Charles M.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Issue-with-french-accent-tp3744402p3744402.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



get url string to stateful page without defining an element in markup

2011-08-15 Thread Jack Berg
Hello!

I'm trying to create a tooltip behavior that adds tooltip html elements
after components. I want the tooltip message to contain a link to a page
where you can edit the tooltip itself.
I could mount the page and use pageparameters from a manually constructed
link in the behavior, but is there a better way?
Can I get an url String to the stateful page programmatically?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/get-url-string-to-stateful-page-without-defining-an-element-in-markup-tp3744424p3744424.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: get url string to stateful page without defining an element in markup

2011-08-15 Thread Martin Grigorov
See different Component#urlFor() methods.

On Mon, Aug 15, 2011 at 2:53 PM, Jack Berg erki.pub...@gmail.com wrote:
 Hello!

 I'm trying to create a tooltip behavior that adds tooltip html elements
 after components. I want the tooltip message to contain a link to a page
 where you can edit the tooltip itself.
 I could mount the page and use pageparameters from a manually constructed
 link in the behavior, but is there a better way?
 Can I get an url String to the stateful page programmatically?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/get-url-string-to-stateful-page-without-defining-an-element-in-markup-tp3744424p3744424.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Fabio Cechinel Veronez
Hello everybody,

I'm using wicket 1.5-RC5.1 and I'm having problem to override
getConverter method of in a FormCompont subclass.

Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
as example, could be any type) when I try to to provide a specific
converter for my instance I

-- 
Fabio Cechinel Veronez

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Martin Grigorov
See how we do it at:
http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java?view=markup

On Mon, Aug 15, 2011 at 2:57 PM, Fabio Cechinel Veronez
fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Fabio Cechinel Veronez
Sorry for previews post, wrong combinations of pressed keys =/

I, will continue:

Hello everybody,

I'm using wicket 1.5-RC5.1 and I'm having problem to override
getConverter method of in a FormCompont subclass.

Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
as example, could be any type) when I try to to provide a specific
converter for my instance I'm implementing like that:

TextFieldString tf = new TextFieldString(id) {

@Override
public IConverterString getConverter(ClassString type) {
// ...
return converter;
}
};

But if I do like I get a compiler error saying:

 Name clash: The method getConverter(ClassString) of type new
TextFieldString(){} has the same erasure as getConverter(ClassC)
of type Component but does not override it
 The method getConverter(ClassString) of type new
TextFieldString(){} must override or implement a supertype method

And when I try

TextFieldString tf = new TextFieldString(id) {

@Override
public String IConverterString
getConverter(ClassString type) {
// ...
return converter;
}
};

I get a compilation warn saying:

   The type parameter String is hiding the type String


I guess it happens 'cause getConverter uses a generic type C defined
at method level that is not the same generic type T defined at
TextField class level.

What is the proper way to overwrite getConverter method?


On Mon, Aug 15, 2011 at 8:57 AM, Fabio Cechinel Veronez
fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez




-- 
Fabio Cechinel Veronez

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Fabio Cechinel Veronez
Hello Martin, thanks for you prompt response..

I had saw that solution but it uses an unchecked cast that was
exactly what I was trying to avoid.

I guess generics were introduced just to avoid those types of casts.


On Mon, Aug 15, 2011 at 9:04 AM, Martin Grigorov mgrigo...@apache.org wrote:
 See how we do it at:
 http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java?view=markup

 On Mon, Aug 15, 2011 at 2:57 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





-- 
Fabio Cechinel Veronez

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Martin Grigorov
If you find better solution please send it back to us :-)

On Mon, Aug 15, 2011 at 3:14 PM, Fabio Cechinel Veronez
fabio.vero...@gmail.com wrote:
 Hello Martin, thanks for you prompt response..

 I had saw that solution but it uses an unchecked cast that was
 exactly what I was trying to avoid.

 I guess generics were introduced just to avoid those types of casts.


 On Mon, Aug 15, 2011 at 9:04 AM, Martin Grigorov mgrigo...@apache.org wrote:
 See how we do it at:
 http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java?view=markup

 On Mon, Aug 15, 2011 at 2:57 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





 --
 Fabio Cechinel Veronez

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Fabio Cechinel Veronez
heheh ... well, in my opinion the best solution is to change
definition of Component.getConverter in way its generic type is bound
to FormComponent's T generic type ...

Is there any change to have it changed?

On Mon, Aug 15, 2011 at 9:24 AM, Martin Grigorov mgrigo...@apache.org wrote:
 If you find better solution please send it back to us :-)

 On Mon, Aug 15, 2011 at 3:14 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello Martin, thanks for you prompt response..

 I had saw that solution but it uses an unchecked cast that was
 exactly what I was trying to avoid.

 I guess generics were introduced just to avoid those types of casts.


 On Mon, Aug 15, 2011 at 9:04 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 See how we do it at:
 http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java?view=markup

 On Mon, Aug 15, 2011 at 2:57 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





-- 
Fabio Cechinel Veronez

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Martin Grigorov
Try it.

The problem is that getConverter(Class) is defined in Component which
has no type parametrization.
FormComponent extends Component and has the type but cannot break the
signature...

On Mon, Aug 15, 2011 at 3:33 PM, Fabio Cechinel Veronez
fabio.vero...@gmail.com wrote:
 heheh ... well, in my opinion the best solution is to change
 definition of Component.getConverter in way its generic type is bound
 to FormComponent's T generic type ...

 Is there any change to have it changed?

 On Mon, Aug 15, 2011 at 9:24 AM, Martin Grigorov mgrigo...@apache.org wrote:
 If you find better solution please send it back to us :-)

 On Mon, Aug 15, 2011 at 3:14 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello Martin, thanks for you prompt response..

 I had saw that solution but it uses an unchecked cast that was
 exactly what I was trying to avoid.

 I guess generics were introduced just to avoid those types of casts.


 On Mon, Aug 15, 2011 at 9:04 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 See how we do it at:
 http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java?view=markup

 On Mon, Aug 15, 2011 at 2:57 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





 --
 Fabio Cechinel Veronez

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





 --
 Fabio Cechinel Veronez

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Auto Complate Text Field Character Problem

2011-08-15 Thread bilgisever
   The problem has been solved. Source of the problem is operating system
language and also encoding.
Change operating system(English to Turkish) and encoding work fine.
  Thanks all,

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Auto-Complate-Text-Field-Character-Problem-tp3738977p3744634.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Injecting beans into behaviors

2011-08-15 Thread Jack Berg
Hello,

It seems that @SpringBeans does not inject beans into behaviors. It works
only in Components by calling
getApplication().notifyComponentInstantiationListeners(this) in the
constructor. Is there a reason for limiting this? An easy workaround?


Thanks for the responses to my previous questions!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Injecting-beans-into-behaviors-tp3744739p3744739.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Injecting beans into behaviors

2011-08-15 Thread Martin Grigorov
The limitation is that all your components extend from o.a.w.Component
while you can implement IBehavior or IModel directly and there is no
way to intercept your constructors' calls.

In Wicket 1.5 there is no IBehavior anymore and there is class
Behavior where we can do that but I'm not convinced there is such
need.

The workaround is to call: InjectorHolder.getInstance().inject(this)
in your behavior constructor.

On Mon, Aug 15, 2011 at 5:41 PM, Jack Berg erki.pub...@gmail.com wrote:
 Hello,

 It seems that @SpringBeans does not inject beans into behaviors. It works
 only in Components by calling
 getApplication().notifyComponentInstantiationListeners(this) in the
 constructor. Is there a reason for limiting this? An easy workaround?


 Thanks for the responses to my previous questions!

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Injecting-beans-into-behaviors-tp3744739p3744739.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



serialization question

2011-08-15 Thread Steve Lowery
Is there a hook point to serialization of components?  We would like to
throw a WicketRuntimeException if we detect that we are about to attempt to
serialize out an attached (in our case Hibernate) entity rather than using a
LoadableDetachableModel and only serializing the id.  I see I can register
an DetachListener, but that doesn't fire until after the model is detached
and that doesn't help in these cases I think.  We have had issues where we
actually OOM the server when trying to serialize an entity that has LOTS of
associations.  I'd like to throw the exception before the serialization is
even attempted.

We are using wicket 1.4.17.


Re: serialization question

2011-08-15 Thread Martin Grigorov
In Wicket 1.4 see org.apache.wicket.util.io.IObjectStreamFactory.
In Wicket 1.5 org.apache.wicket.serialize.ISerializer

On Mon, Aug 15, 2011 at 5:50 PM, Steve Lowery
slow...@gatessolutions.com wrote:
 Is there a hook point to serialization of components?  We would like to
 throw a WicketRuntimeException if we detect that we are about to attempt to
 serialize out an attached (in our case Hibernate) entity rather than using a
 LoadableDetachableModel and only serializing the id.  I see I can register
 an DetachListener, but that doesn't fire until after the model is detached
 and that doesn't help in these cases I think.  We have had issues where we
 actually OOM the server when trying to serialize an entity that has LOTS of
 associations.  I'd like to throw the exception before the serialization is
 even attempted.

 We are using wicket 1.4.17.




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread vineet semwal
the signature of method is  public final C IConverterC
getConverter(ClassC clazz) ;

public IConverterString getConverter(ClassString type)
  ^^  means not overriding correctly as method signature is not the  same

public String IConverterStringgetConverter(ClassString type)
   now you have declared String as your type parameter but you will
not be able to use String as class in method now as the
declared String will now hide the String java data type..

martin has already told you the way,currently casting appears to be
the only way..

On Mon, Aug 15, 2011 at 5:35 PM, Fabio Cechinel Veronez
fabio.vero...@gmail.com wrote:
 Sorry for previews post, wrong combinations of pressed keys =/

 I, will continue:

 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I'm implementing like that:

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public IConverterString getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 But if I do like I get a compiler error saying:

     Name clash: The method getConverter(ClassString) of type new
 TextFieldString(){} has the same erasure as getConverter(ClassC)
 of type Component but does not override it
     The method getConverter(ClassString) of type new
 TextFieldString(){} must override or implement a supertype method

 And when I try

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public String IConverterString
 getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 I get a compilation warn saying:

   The type parameter String is hiding the type String


 I guess it happens 'cause getConverter uses a generic type C defined
 at method level that is not the same generic type T defined at
 TextField class level.

 What is the proper way to overwrite getConverter method?


 On Mon, Aug 15, 2011 at 8:57 AM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez




 --
 Fabio Cechinel Veronez

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





-- 
thank you,

regards,
Vineet Semwal

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread Martin Grigorov
The real problem is that Component has no generics.
The tradeoff is that the library (FormComponents) do cast but all
users of them benefit without seeing this casting

On Mon, Aug 15, 2011 at 6:21 PM, vineet semwal
vineetsemwal1...@gmail.com wrote:
 the signature of method is  public final C IConverterC
 getConverter(ClassC clazz) ;

    public IConverterString getConverter(ClassString type)
  ^^  means not overriding correctly as method signature is not the  same

        public String IConverterStringgetConverter(ClassString type)
   now you have declared String as your type parameter but you will
 not be able to use String as class in method now as the
 declared String will now hide the String java data type..

 martin has already told you the way,currently casting appears to be
 the only way..

 On Mon, Aug 15, 2011 at 5:35 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Sorry for previews post, wrong combinations of pressed keys =/

 I, will continue:

 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I'm implementing like that:

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public IConverterString getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 But if I do like I get a compiler error saying:

     Name clash: The method getConverter(ClassString) of type new
 TextFieldString(){} has the same erasure as getConverter(ClassC)
 of type Component but does not override it
     The method getConverter(ClassString) of type new
 TextFieldString(){} must override or implement a supertype method

 And when I try

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public String IConverterString
 getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 I get a compilation warn saying:

   The type parameter String is hiding the type String


 I guess it happens 'cause getConverter uses a generic type C defined
 at method level that is not the same generic type T defined at
 TextField class level.

 What is the proper way to overwrite getConverter method?


 On Mon, Aug 15, 2011 at 8:57 AM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez




 --
 Fabio Cechinel Veronez

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





 --
 thank you,

 regards,
 Vineet Semwal

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread vineet semwal
The real problem is that Component has no generics.
i agree with that so type parameter has to be used on the method
currently unless a new method is added in the FormComponent ,the older
method can just call the new method based on some conditional logic so
nothings get broken in core..,the users will just have to override the
new method but yeah i agree not very important ..

thanks for the discussion in IRC too ! ;)


On Mon, Aug 15, 2011 at 8:56 PM, Martin Grigorov mgrigo...@apache.org wrote:
 The real problem is that Component has no generics.
 The tradeoff is that the library (FormComponents) do cast but all
 users of them benefit without seeing this casting

 On Mon, Aug 15, 2011 at 6:21 PM, vineet semwal
 vineetsemwal1...@gmail.com wrote:
 the signature of method is  public final C IConverterC
 getConverter(ClassC clazz) ;

    public IConverterString getConverter(ClassString type)
  ^^  means not overriding correctly as method signature is not the  same

        public String IConverterStringgetConverter(ClassString type)
   now you have declared String as your type parameter but you will
 not be able to use String as class in method now as the
 declared String will now hide the String java data type..

 martin has already told you the way,currently casting appears to be
 the only way..

 On Mon, Aug 15, 2011 at 5:35 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Sorry for previews post, wrong combinations of pressed keys =/

 I, will continue:

 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I'm implementing like that:

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public IConverterString getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 But if I do like I get a compiler error saying:

     Name clash: The method getConverter(ClassString) of type new
 TextFieldString(){} has the same erasure as getConverter(ClassC)
 of type Component but does not override it
     The method getConverter(ClassString) of type new
 TextFieldString(){} must override or implement a supertype method

 And when I try

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public String IConverterString
 getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 I get a compilation warn saying:

   The type parameter String is hiding the type String


 I guess it happens 'cause getConverter uses a generic type C defined
 at method level that is not the same generic type T defined at
 TextField class level.

 What is the proper way to overwrite getConverter method?


 On Mon, Aug 15, 2011 at 8:57 AM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez




 --
 Fabio Cechinel Veronez

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





 --
 thank you,

 regards,
 Vineet Semwal

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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





-- 
thank you,

regards,
Vineet Semwal

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



Re: Can't properly override getConverter on FormComponent subclasses

2011-08-15 Thread vineet semwal
sorry i just realized i goofed up while copying the method signature ..
there is no final in the method signature..

On Mon, Aug 15, 2011 at 8:51 PM, vineet semwal
vineetsemwal1...@gmail.com wrote:
 the signature of method is  public final C IConverterC
 getConverter(ClassC clazz) ;

    public IConverterString getConverter(ClassString type)
  ^^  means not overriding correctly as method signature is not the  same

        public String IConverterStringgetConverter(ClassString type)
   now you have declared String as your type parameter but you will
 not be able to use String as class in method now as the
 declared String will now hide the String java data type..

 martin has already told you the way,currently casting appears to be
 the only way..

 On Mon, Aug 15, 2011 at 5:35 PM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Sorry for previews post, wrong combinations of pressed keys =/

 I, will continue:

 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I'm implementing like that:

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public IConverterString getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 But if I do like I get a compiler error saying:

     Name clash: The method getConverter(ClassString) of type new
 TextFieldString(){} has the same erasure as getConverter(ClassC)
 of type Component but does not override it
     The method getConverter(ClassString) of type new
 TextFieldString(){} must override or implement a supertype method

 And when I try

        TextFieldString tf = new TextFieldString(id) {

            @Override
            public String IConverterString
 getConverter(ClassString type) {
                // ...
                return converter;
            }
        };

 I get a compilation warn saying:

   The type parameter String is hiding the type String


 I guess it happens 'cause getConverter uses a generic type C defined
 at method level that is not the same generic type T defined at
 TextField class level.

 What is the proper way to overwrite getConverter method?


 On Mon, Aug 15, 2011 at 8:57 AM, Fabio Cechinel Veronez
 fabio.vero...@gmail.com wrote:
 Hello everybody,

 I'm using wicket 1.5-RC5.1 and I'm having problem to override
 getConverter method of in a FormCompont subclass.

 Well, lets say I have a TextFieldDate (I'm using j.u.Date here just
 as example, could be any type) when I try to to provide a specific
 converter for my instance I

 --
 Fabio Cechinel Veronez




 --
 Fabio Cechinel Veronez

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





 --
 thank you,

 regards,
 Vineet Semwal




-- 
thank you,

regards,
Vineet Semwal

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