private Logger log property in WebPage and Component

2011-10-14 Thread hok
Hello,
the Component and WebPage classes have a private property /log/. Sometimes
in Pages and Components there is a need for logging, but in this case the
user have to instantiate separate logger, since the existing is not
accessible. Do you think it's possible to make the logger protected, or
provide a getter? Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/private-Logger-log-property-in-WebPage-and-Component-tp3904720p3904720.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: private Logger log property in WebPage and Component

2011-10-14 Thread Bas Gooren

Out of curiosity: why would you want the component logger?

If you create one locally (private static final Logger log = 
LoggerFactory.getLogger(YourClass.class);), you have the benefit of 
controlling log output since the logger is bound to the actual component 
and not the superclass.
E.g. at runtime you can change a certain page or component (or other 
class) to display more or less verbose logging.


Op 14-10-2011 14:47, schreef hok:

Hello,
the Component and WebPage classes have a private property /log/. Sometimes
in Pages and Components there is a need for logging, but in this case the
user have to instantiate separate logger, since the existing is not
accessible. Do you think it's possible to make the logger protected, or
provide a getter? Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/private-Logger-log-property-in-WebPage-and-Component-tp3904720p3904720.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: NonCachingImage not showing image with GAE

2011-10-14 Thread Ian Marshall
I have solved my problem by using a class that descends from
ByteArrayResource and which overrides getData(IResource.Attributes). I
supply an instance of this class to my NonCachingImage instead of a model.

I thank Martin Grigorov for his reply to a vaguely-related posting last
month which solved my problem!



Ian Marshall wrote:
 
 Hello everyone,
 
 I use a NonCachingImage component to show an image in a form. The image
 shows correctly when using the Google App Engine for Java (GAE/J)
 development application server but fails to show when the code is running
 on Google App Engine (GAE) proper.
 
 I believe that this may be due to the image's src tag not being
 interpreted by GAE's cloud, whereas it is rendered properly by the dev app
 server.
 
 Has anyone had this happening to them? Can anyone think of a solution or
 suggestion? (Can I remove the src attribute?)
 
 Regards,
 
 Ian
 
 
 HTML
 
 lt;img wicket:id=imgImage alt=[None] width=100% height=100%/gt;
 
 
 Java code
 -
 // ImageModel extends LoadableDetachableModelItemImageResource
 // ItemImageResource extends DynamicImageResource
 ImageModel imodImage = new ImageModel(pidmModel);
 NonCachingImage imgImage = new NonCachingImage(imgImage, imodImage);
 frmForm.add(imgImage);
 
 
 Sample HTML output
 --
 // This output shows an image with the GAE dev app server,
 // but [None] when served by a GAE/J production server.
 lt;img wicket:id=imgImage alt=[None] width=100% height=100%
 
 src=page?8-IResourceListener-frmForm-imgImageamp;antiCache=1318502670796/gt;
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NonCachingImage-not-showing-image-with-GAE-tp3901604p3905671.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



ListChoice and it's renderer

2011-10-14 Thread Hakan Steisjo
Hi All,

I want to extend a simple listchoice component to also include a title
attribute in the generated html code. So basically I want the option tag
to be generated like this:

option value=value title=titleUser display/option

Can anyone give me some input on where I can add this feature to an existing
ListChoice or the IChoiceRenderer.

Thanks


Can not locate error messages from property messages

2011-10-14 Thread Erinc Arikan
Hi;

I am using a really simple property file, to display some validation errors,
it used to work fine, but it stopped working, now I can't even get the
simplest example to work. and I am receiving an Could not locate error
message for component:


Here's the code that I am using(directly from cookbook), and I have
PasswordPolicyValidator.properties file in the same folder
package cookbook;

import java.util.regex.Pattern;

import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.ValidationError;

public class PasswordPolicyValidator implements IValidatorString {

private static final Pattern UPPER = Pattern.compile([A-Z]);
private static final Pattern LOWER = Pattern.compile([a-z]);
private static final Pattern NUMBER = Pattern.compile([0-9]);

public void validate(IValidatableString validatable) {
final String password = validatable.getValue();

if (!NUMBER.matcher(password).find()) {
error(validatable, no-digit);
}

if (!LOWER.matcher(password).find()) {
error(validatable, no-lower);
}

if (!UPPER.matcher(password).find()) {
error(validatable, no-upper);
}
}

private void error(IValidatableString validatable, String errorKey) {
ValidationError error = new ValidationError();
error.addMessageKey(getClass().getSimpleName() + . + errorKey);
validatable.error(error);
}

}

PasswordPolicyValidator.no-digit=${label} must contain at least one digit
PasswordPolicyValidator.no-lower=${label} must contain at least one lower
case letter
PasswordPolicyValidator.no-upper=${label} must contain at least one upper
case letter

Erinc


Re: UTF-8 not working

2011-10-14 Thread Mathias Nilsson
Sorry. Forgot to say wicket version 1.4.18

getMarkupSettings().setDefaultMarkupEncoding(UTF-8); 
getRequestCycleSettings().setResponseRequestEncoding(UTF-8); 

set in init

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UTF-8-not-working-tp3906237p3906254.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: UTF-8 not working

2011-10-14 Thread Attila Király
You have to configure a filter (write one or reuse existing ones like
http://static.springsource.org/spring/docs/3.1.0.RC1/javadoc-api/org/springframework/web/filter/CharacterEncodingFilter.html)
to call request.setCharacterEncoding(UTF-8) before wicket gets the
request. This is not needed with wicket 1.5.

Attila

2011/10/14 Mathias Nilsson wicket.program...@gmail.com

 Sorry. Forgot to say wicket version 1.4.18

 getMarkupSettings().setDefaultMarkupEncoding(UTF-8);
 getRequestCycleSettings().setResponseRequestEncoding(UTF-8);

 set in init

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/UTF-8-not-working-tp3906237p3906254.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