Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Bernhard Schauer

w00t, Wicket FTW!

On 2011-09-08 05:31, Duy Do wrote:

Big news! You made my day. Thanks a lot for your great working.


On 9/8/11 5:17 AM, Martijn Dashorst wrote:
The Apache Wicket team is proud to announce the immediate 
availability of the
newest release of their component oriented open source Java web 
framework.
Apache Wicket 1.5 has been in development for the last two years and 
brings

many improvements over previous versions.

Downloading Apache Wicket 1.5
-

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.0

Or use this in your Maven POM to upgrade to the new version:

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-core/artifactId
version1.5.0/version
/dependency

Please note that Wicket’s main artifact ID has been renamed to 
wicket-core.


You will need to upgrade all modules (i.e. wicket, wicket-extensions,
wicket-ioc, wicket-spring, etc) to 1.5.0. It is not possible to mix 
previous

versions of Wicket with modules of this release.

Most notable changes


With this release the Wicket team has revised many of its internals. A
short list:

  - HTML5 components added: EmailTextField, NumberTextField, 
UrlTextField and

RangeTextField

  - New inter-component events (explained below)

  - Minimum required servlet API is servlet-api 2.5

  - All standard validators now extend Behavior to allow for client side
validations

  - IBehavior has been removed and AbstractBehavior has been 
deprecated, you

should now extend Behavior instead

  - Simplified the request cycle processing and made it more extensible

  - URL handling is now in one place

  - Wicket’s rendering code has been greatly simplified

  - Improved browser caching support

  - ClientSideImageMap replaces old ImageMap

  - Better support for running behind proxies with x-forwarded-for 
header


  - Request cycle listeners make it easier to integrate frameworks in 
your

Wicket application

  - Consistent naming: methods with Javascript in the name have been 
renamed to

use proper capitalization: JavaScript

  - Switching to HTTPS is as simple as configuring a new root mapper 
to make

Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration
guide.

Inter-component events
--

Wicket 1.5 offers a simple, yet flexible, way for component to 
communicate

with each other in a decoupled manner. The two major interfaces that
facilitate this are:

/**
 * Objects that can send events
 */
public interface IEventSource {
T  void send(IEventSink sink, Broadcast broadcast, T payload);
}

and

/**
 * Objects that can receive events
 */
public interface IEventSink
{
/**
 * Called when an event is sent to this sink
 */
void onEvent(IEvent?  event);
}

The classes that implement these interfaces, and can thus participate 
in the

event mechanism are: Component, RequestCycle, Session, and Application.

The mechanism allows for different event broadcast methods defined here:

/**
 * Defines the event broadcast type.
 */
public enum Broadcast {
BREADTH,
DEPTH,
BUBBLE,
EXACT;
}

There is an example in wicket-examples which demonstrates the usage 
of this.


Applications can register custom event dispatchers in 
FrameworkSettings; the
dispatchers can be used to build custom event delivery mechanisms. 
For example
a custom IEventDispatcher mechanism can route events to annotated 
methods, for

example:

public class MyComponent extends Component {
@OnEvent
private void onUserAdded(UserAddedEvent event) {...}
}

where UserAddedEvent is the event payload object.

The default Component#onEvent method will be called even if custom 
dispatchers

are registered.

A default event is raised whenever Wicket begins to create an AJAX 
response.

The payload of the event is the AjaxRequestTarget used for event. Sample
implementation:

// component that always adds itself to the ajax response
public class MyComponent extends Component {
public void onEvent(IEvent event) {
if (event.getPayload() instanceof AjaxRequestTarget) {
((AjaxRequestTarget)event.getPayload()).add(this);
 }
}
}

-
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



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

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-07 Thread Bernhard Schauer
I think you could do it as follows. The js function 'bindYourEvent()' is 
called after the the components that are added to the AjaxRequestTarget 
are 're-painted'.


   form.add(new AjaxButton(set) {
   @Override
   protected void onSubmit(final AjaxRequestTarget target, 
final Form? form) {

   target.appendJavascript(bindYourEvent(););
   }

   });

mfg Bernhard

Joseph Pachod schrieb:

hi

I've some components which require some client side javascript which 
require one init call (for all) to be initialized. In fact, this init 
call uses selectors to get at the components to work one.


My issues is with Ajax. It happens that, during it, some new 
components required this init call are added.


As such, how could I trigger it only once per Ajax request ?

The pattern I'm targeting is for each component to initialize this way 
to have a behavior in which something would be added only in Ajax 
request cycle. For non ajax request cycle, I use jquery to do the 
init, through:

 $(document).ready(function(){
   $.initEdit();
   });

When trying to reach this goal, I tried to run the init call through 
an header contributor, but the call is then done before my content is 
put on the page, making it useless:

public abstract class AbstractEditBehavior extends AbstractBehavior
{
   public AbstractEditBehavior(final AbstractTextComponent? component)
   {
   component.add(JQueryDependency.CORE);
   component.add(new HeaderContributor(new IHeaderContributor()
   {
   public void renderHead(final IHeaderResponse response)
   {
   if ((AjaxRequestTarget.get() != null))
   {
   response.renderJavascript(jQuery.initEdit();, ID
   + response.hashCode());
   }
   }
   }));

   }
(...)

thanks in advance
best



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



WicketRuntimeException when injecting into hidden form field

2010-09-06 Thread Bernhard Schauer

Hello,

in wicket forms get a hidden field. I found on the web, that this hidden 
field is needed for some kind of event handling. (Anyone knows more 
details?)


I played around with XSS-Me 
(https://addons.mozilla.org/de/firefox/addon/7598/) a firefox plugin, 
that tries to find XSS vulnerabilities.
What the addon does, is that it injects some values into that hidden 
field, and then wicket throws :
   WicketRuntimeException: Attempt to access unknown request listener 
interface null


Has anyone an idea, how this exception could be prevented? or caught?

mfg bernhard

the full trace is:

ERROR - RequestCycle   - Attempt to access unknown request 
listener interface null
org.apache.wicket.WicketRuntimeException: Attempt to access unknown 
request listener interface null

   at org.apache.wicket.markup.html.form.Form.dispatchEvent(Form.java:1327)
   at 
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:874)

   at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:597)
   at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
   at 
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
   at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
   at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)

   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
   at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
   at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
   at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
   at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
   at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
   at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
   at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)

   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
   at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

   at org.mortbay.jetty.Server.handle(Server.java:295)
   at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
   at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)

   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
   at 
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
   at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
** 
http://dict.leo.org/ende?lp=endep=Ci4HO3kMAAsearch=vulnerabilitytrestr=0x8001 



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



validate() form (Form.class) - how to validate form by hand?

2009-12-11 Thread Bernhard Michal

Hello everyone,

How to run validation of form (Form.class) by hand?

Form.class javadoc says:

If you want you can call validate() to execute form validation,
hasError() to find out whether validate() resulted in validation errors,
and updateFormComponentModels() to update the models of nested form
components. 

But in Wicket 1.4.3 the validate() method is protected so it's not
visible. By the way actually only hasError() method is public.

Why is this method protected? 
Is javadoc stale or there is just a misunderstanding on my side?

Thank you.

Best regards,
michalb

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



Re: I18N for bookmarkable urls

2009-10-26 Thread Bernhard Grünewaldt

Hello,

After thinking a bit I came up with a solution (which many of you might 
call dirty workaround). But since no one else came up with a solution

I will stick to it until something better will be provided.

The solution can be found here:

http://blog.gruenewaldt.net/en/programming/java/apache-wicket-1_4-mounting-urls-for-a-multilanguage-setup-i18n-seo/

Perhaps someone might find that useful.

Bernhard


Bernhard Grünewaldt schrieb:

Hi folks,

Since my app will be english and german aswell, that is something I need 
too. I tried to mount and unmount my pages

when the locale changes from german to english or vice versa.
I tried using ResourceModel Strings for the urls, but it's not working 
the way I want it to be. And it would be a massive amount of code for 
something that seems to be so simple.


The problem is, that I want both urls to be accessed via the url like in 
the example:

  http://xxx/impressum
and
  http://xxx/imprint
should be accessible not depending on a specific locale setting.
(Perhaps the locale should change to english or german depending on the 
url when accessed via a browser bookmark with no session)


The problem is, that you can mount a class multiple times, but for
creating the BookmarkablePageLinks the first one mounted will be used 
for the link. (tested with wicket 1.4.3).


Wouldn't it be cool to have such a mechanism which uses the Locale 
setting to generate links and mount pages.


For example (Just pseudo code):

.mount(
  new HybridUrlCodingStrategy(
impressum, ImprintPage.class, Locale.GERMAN)
);
.mount(
  new HybridUrlCodingStrategy(
imprint, ImprintPage.class, Locale.ENGLISH)
);

And when you then generate a url you could use:

add(new BookmarkablePageLinkVoid(
   bookmarked,
   ImprintPage.class,
   getSession().getLocale())
);

That way both urls would be accessible if bookmarked.
And the user gets the url generated in his locale while browsing through 
the app.


Is there a cool(=easy) way to do that or will it lead to
a massive code section that mounts and unmounts pages on locale change?

Bernhard


Ilja Pavkovic schrieb:

Hi,

as we need some SEO optimization I want to provide the following 
bookmarkable pages:


http://xxx/impressum
http://xxx/imprint

the native approach would be somethink like:

mountBookmarkablePage(imprint, ImprintPage.class);

mountBookmarkablePage(impressum, ImprintPage.class);

This looks ugly but works.
Now I don't know how to create a bookmarkable links having an url in 
the expected language.


if( getLocale().equals(Locale.GERMAN)) {
  //create http://xxx/impressum
} else {
  // http://xxx/imprint
}

Obviously the following code does not help:
  add(new BookmarkablePageLink(link, ImprintPage.class));

Does anyone have a good idea?

Best regards,
Ilja Pavkovic




-
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: I18N for bookmarkable urls

2009-10-24 Thread Bernhard Grünewaldt

Hi folks,

Since my app will be english and german aswell, that is something I need 
too. I tried to mount and unmount my pages

when the locale changes from german to english or vice versa.
I tried using ResourceModel Strings for the urls, but it's not working 
the way I want it to be. And it would be a massive amount of code for 
something that seems to be so simple.


The problem is, that I want both urls to be accessed via the url like in 
the example:

  http://xxx/impressum
and
  http://xxx/imprint
should be accessible not depending on a specific locale setting.
(Perhaps the locale should change to english or german depending on the 
url when accessed via a browser bookmark with no session)


The problem is, that you can mount a class multiple times, but for
creating the BookmarkablePageLinks the first one mounted will be used 
for the link. (tested with wicket 1.4.3).


Wouldn't it be cool to have such a mechanism which uses the Locale 
setting to generate links and mount pages.


For example (Just pseudo code):

.mount(
  new HybridUrlCodingStrategy(
impressum, ImprintPage.class, Locale.GERMAN)
);
.mount(
  new HybridUrlCodingStrategy(
imprint, ImprintPage.class, Locale.ENGLISH)
);

And when you then generate a url you could use:

add(new BookmarkablePageLinkVoid(
   bookmarked,
   ImprintPage.class,
   getSession().getLocale())
);

That way both urls would be accessible if bookmarked.
And the user gets the url generated in his locale while browsing through 
the app.


Is there a cool(=easy) way to do that or will it lead to
a massive code section that mounts and unmounts pages on locale change?

Bernhard


Ilja Pavkovic schrieb:

Hi,

as we need some SEO optimization I want to provide the following bookmarkable 
pages:


http://xxx/impressum
http://xxx/imprint

the native approach would be somethink like:

mountBookmarkablePage(imprint, ImprintPage.class);

mountBookmarkablePage(impressum, ImprintPage.class);

This looks ugly but works. 

Now I don't know how to create a bookmarkable links having an url in the 
expected language.


if( getLocale().equals(Locale.GERMAN)) {
  //create http://xxx/impressum
} else {
  // http://xxx/imprint
}

Obviously the following code does not help:
  add(new BookmarkablePageLink(link, ImprintPage.class));

Does anyone have a good idea?

Best regards,
Ilja Pavkovic




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



RE: Hippo's patch for wicket ids

2009-10-20 Thread Bernhard Michal
 
Works for me, your xpath must be wrong. Your syntax is ok. Either there
is no a element (link) with attribute
wicketpath=tablePanel_leftList_tableList_pojoList_18_nameCell_namePanel
Link_name or there is no div tag inside an a element...


-Original Message-
From: Douglas Ferguson [mailto:doug...@douglasferguson.us] 


Does anybody have sample of how to do this?

I'm getting this error when I try to use the wicketpath

  [error] Element //a
[...@wicketpath
=
'tablePanel_leftList_tableList_pojoList_18_nameCell_namePanelLink_name
']/div not found


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



RE: Localization of values coming from my Model

2009-10-19 Thread Bernhard Michal
No, javadoc is ok. You are right. My mistake, sorry.

-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] 

Then is the javadoc wrong?

This was taken right from the javadoc?
http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wic
ket/model/StringResourceModel.html

===

Example 2 

In this example, the resource key is selected based on the evaluation of
a property expression: 

 public MyPage extends WebPage
 {
 public MyPage(final PageParameters parameters)
 {
 WeatherStation ws = new WeatherStation();
 add(new Label(weatherMessage,
 new StringResourceModel(weather.${currentStatus}, this,
new Model(ws)));
 }
 }
 Which will call the WeatherStation.getCurrentStatus() method each time
the string resource model is used and where the resource bundle for the
page contains the entries: 
 weather.sunny=Don't forget sunscreen!
 weather.raining=You might need an umbrella  weather.snowing=Got your
skis?
 weather.overcast=Best take a coat to be safe




-Original Message-
From: Bernhard Michal [mailto:michal.bernh...@tigra.cz]

It doesn't seem correct...
StringResourceModel expect string which is supposed to be resource key
to find localization in resource bundle.

I recommend you to read
http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications
.html.

-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] 

I tried this and it seems to work.  Is this a correct way of doing it?

Label gender = new Label(gender, new StringResourceModel(${gender},
this, model)); add(gender); Obviously the StringResourceModel uses the
property file for the page.

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



Re: Strong Password Validation using Ajax (with Fallback)

2009-10-17 Thread Bernhard Grünewaldt
That's the case :)

I want to have it working with Javascript activated and without.

I am now thinking of something GWT does.
You write java and the framework translates it to ajax. (if I am not
mistaken)
It would be cool to write just one Validator in Java
that implements some behaviour and it works as ajax and without on the
serverside.

Does anybody have a tutorial or best practice for that, or will I end up
maintaining redundant code for Java and Javascript?
I am using jquery as framework if that is of concern.
But I am open for everything.

I already took a look at wiquery but haven't found a nice tutorial for my
purpose.
http://code.google.com/p/wiquery/


Bernhard
 Why wouldn't you?  If it's https it's no different than sending it to
 complete the registration or change password page.  It's the same load as
 any other AJAX validation.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, Oct 16, 2009 at 1:48 PM, Ryan Gravener
 r...@ryangravener.comwrote:

 I don't think you want to validate passwords by sending them to the
 server multiple times.

 Ryan Gravener
 http://bit.ly/no_word_docs



 On Fri, Oct 16, 2009 at 2:31 PM, Bernhard Grünewaldt
 bernh...@gruenewaldt.net wrote:
  Hello,
 
  Is there such a thing as a Strong Password Validator?
  I found a jquery plugin which is nice:
  http://bassistance.de/jquery-plugins/jquery-plugin-password-validation/
 
  But it lacks the serverside Java implementation and i18n.
  Does anyone know of such a component?
  The code isn't that complex, but if it is already there why implement
 it
  yourself.
 
  thx
 
  Bernhard
 
 
  -
  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





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



RE: Localization of values coming from my Model

2009-10-16 Thread Bernhard Michal
Why don't you use special model for each component?

Because this is very specific thing - CompoundPropertyModel is not
supposed for this kind of model value's processing stuff.

For example for activeString:

add(new Label(activeString, new AbstractReadOnlyModelString() {

   @Override
   public String getObject() {
 return getString(yourModel.getActiveString());
   }

}));

Anyway if you want it you can still write your own implementation of
CompoundPropertyModel...


-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] 
Sent: Friday, October 16, 2009 4:36 PM
To: users@wicket.apache.org
Subject: Localization of values coming from my Model

I am trying to display a page using my CompoundPropertyModel however
some of the values coming from the model need to be localized before
displaying to the user.  This is being done inside of a wizard step.

For example:

My model has the following properties

String gender

boolean active

 

Gender is either male or female

I have a getter in my object which is getActiveString which returns Yes
or No based on the T/F of the Boolean.public String
getActiveString() {if (active) { return Yes;} else {return No;}}

 

The html is:

span wicket:id=gender/span

span wicket:id=activeString/span

 

The java code is:

add(new Label(gender));

add(new Label(activeString));

 

 

The issue is that I need to localize the gender value.  The activeString
also needs to be localized.

 

How would one do this?  I need to store the values in the model as they
are since it is being persisted to a db.  However for certain users the
data needs to be shown in their particular language when presented on
the page.

 

Any ideas?

 

BTW... thanks you all for your previous help.  I am finally in the final
steps of development for my project.

 

Thanks.

 

 

 


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



RE: Localization of values coming from my Model

2009-10-16 Thread Bernhard Michal
It doesn't seem correct...
StringResourceModel expect string which is supposed to be resource key
to find localization in resource bundle.

I recommend you to read
http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications
.html.

-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] 

I tried this and it seems to work.  Is this a correct way of doing it?

Label gender = new Label(gender, new StringResourceModel(${gender},
this, model)); add(gender);
Obviously the StringResourceModel uses the property file for the page.


-Original Message-
From: Bernhard Michal [mailto:michal.bernh...@tigra.cz]

Why don't you use special model for each component?

Because this is very specific thing - CompoundPropertyModel is not
supposed for this kind of model value's processing stuff.

For example for activeString:

add(new Label(activeString, new AbstractReadOnlyModelString() {

   @Override
   public String getObject() {
 return getString(yourModel.getActiveString());
   }

}));

Anyway if you want it you can still write your own implementation of
CompoundPropertyModel...


-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com]

I am trying to display a page using my CompoundPropertyModel however
some of the values coming from the model need to be localized before
displaying to the user.  This is being done inside of a wizard step.

For example:
My model has the following properties

String gender
boolean active
 
Gender is either male or female

I have a getter in my object which is getActiveString which returns Yes
or No based on the T/F of the Boolean.public String
getActiveString() {if (active) { return Yes;} else {return No;}}

 
The html is:

span wicket:id=gender/span

span wicket:id=activeString/span

 

The java code is:

add(new Label(gender));
add(new Label(activeString));


The issue is that I need to localize the gender value.  The activeString
also needs to be localized. 
How would one do this?  I need to store the values in the model as they
are since it is being persisted to a db.  However for certain users the
data needs to be shown in their particular language when presented on
the page.

 Any ideas?

 

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



Strong Password Validation using Ajax (with Fallback)

2009-10-16 Thread Bernhard Grünewaldt

Hello,

Is there such a thing as a Strong Password Validator?
I found a jquery plugin which is nice:
http://bassistance.de/jquery-plugins/jquery-plugin-password-validation/

But it lacks the serverside Java implementation and i18n.
Does anyone know of such a component?
The code isn't that complex, but if it is already there why implement it
yourself.

thx

Bernhard


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



Re: Open source Wicket blog - Open Source CMS with Wicket

2009-10-14 Thread Bernhard Grünewaldt

Hello,

It is very interesting to have a wicket blog,
but for me even more interesting would be a cms based on wicket
that integrates very smoothly into an existing wicket webapp.

At the moment we use typo3 together with our java webapp.

Would be nice to have a solution where everything is java
and the same framework :)

Is there such a thing?


Bernhard

Maarten Bosteels schrieb:

I got some really cool ideas from the elephas code, but it seems the project
has stalled a bit ?
The last commit was 18 dec 2008

Maarten

On Wed, Oct 14, 2009 at 2:30 PM, ralf.eichin...@pixotec.de wrote:


added elephas blogging system to Wiki:
http://cwiki.apache.org/confluence/display/WICKET/Products+based+on+Wicket


Quoting danisevsky danisev...@gmail.com:

 It would be nice, I am very interested.

BTW there is another great open-source blogging system -
http://code.google.com/p/elephas/

2009/10/14 Anton Veretennikov anton.veretenni...@gmail.com

 I'm interested. This will be definitely something desirable for many

website builders.
I want to assist in developing because I need such functionality in
several sites.

-- Tony

On Wed, Oct 14, 2009 at 2:30 PM, Daniel Frisk dan...@jalbum.net wrote:

Hi,

we have developed a blog tool in Wicket for our website. I just wanted

to

see if there is any interest in having that as an open source project?
The code would have to be adopted for general use and be untangled from

some

dependencies that we don't want to open source, so I just want to check

if

there is any interest before doing the initial work. Not promising

anything

so don't start haunting me, but let me know if you are interested.

Check it out at:
http://jalbum.net/blog

// Daniel
jalbum.net

-
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






This message was sent using IMP, the Internet Messaging Program.


-
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: Open source Wicket blog - Open Source CMS with Wicket

2009-10-14 Thread Bernhard Grünewaldt

Found it myself.

Anyone have experience with brix?

http://code.google.com/p/brix-cms/


Bernhard Grünewaldt schrieb:

Hello,

It is very interesting to have a wicket blog,
but for me even more interesting would be a cms based on wicket
that integrates very smoothly into an existing wicket webapp.

At the moment we use typo3 together with our java webapp.

Would be nice to have a solution where everything is java
and the same framework :)

Is there such a thing?


Bernhard

Maarten Bosteels schrieb:
I got some really cool ideas from the elephas code, but it seems the 
project

has stalled a bit ?
The last commit was 18 dec 2008

Maarten

On Wed, Oct 14, 2009 at 2:30 PM, ralf.eichin...@pixotec.de wrote:


added elephas blogging system to Wiki:
http://cwiki.apache.org/confluence/display/WICKET/Products+based+on+Wicket 




Quoting danisevsky danisev...@gmail.com:

 It would be nice, I am very interested.

BTW there is another great open-source blogging system -
http://code.google.com/p/elephas/

2009/10/14 Anton Veretennikov anton.veretenni...@gmail.com

 I'm interested. This will be definitely something desirable for many

website builders.
I want to assist in developing because I need such functionality in
several sites.

-- Tony

On Wed, Oct 14, 2009 at 2:30 PM, Daniel Frisk dan...@jalbum.net 
wrote:

Hi,

we have developed a blog tool in Wicket for our website. I just 
wanted

to
see if there is any interest in having that as an open source 
project?
The code would have to be adopted for general use and be untangled 
from

some
dependencies that we don't want to open source, so I just want to 
check

if

there is any interest before doing the initial work. Not promising

anything

so don't start haunting me, but let me know if you are interested.

Check it out at:
http://jalbum.net/blog

// Daniel
jalbum.net

-
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






This message was sent using IMP, the Internet Messaging Program.


-
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




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



Feedbackpanel for each Error Level

2009-10-12 Thread Bernhard Grünewaldt

Hello,

I know how to add a Feedbackpanel and how to filter it by specific forms 
a.s.o.
But I want three feedbackpanels. One for warn, one for error and one 
for info.


I didn't find a implementation of IFeedbackMessageFilter which does 
that. (Or I don't know how it could do that)


Is there a way to do that?

Something like:

## pseudocode:
   FeedbackPanel f = new FeedbackPanel(warn);
   f.showOnly(FeedbackPanel.WARN);
   add(f);
##

would be nice.

thx

Bernhard



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



Re: Feedbackpanel for exact one Error Level

2009-10-12 Thread Bernhard Grünewaldt

Hello,

I opened an issue in Jira with the code attached to it.

https://issues.apache.org/jira/browse/WICKET-2517

Perhaps it could be included into wicket source code.

--

That's almost what I am looking for, but it accepts all errors to a 
certain level. I want exact ONE level to be accepted.


With ErrorLevelFeedbackMessageFilter:
 Info Level displays: error, warn and info
 Error Level displays: error
 Warn Level displays: error, warn


What I want is:
 Info Level should display: info
 Error Level should display: error
 Warn Level should display: warn


Example:

error(error);
info(info);
warn(warn);

FeedbackPanel errorFeedback = new FeedbackPanel(error);
		errorFeedback.setFilter(new 
ErrorLevelFeedbackMessageFilter(FeedbackMessage.ERROR));

add(errorFeedback);

FeedbackPanel infoFeedback = new FeedbackPanel(info);
		infoFeedback.setFilter(new 
ErrorLevelFeedbackMessageFilter(FeedbackMessage.INFO));

add(infoFeedback);

FeedbackPanel warnFeedback = new FeedbackPanel(warn);
		warnFeedback.setFilter(new 
ErrorLevelFeedbackMessageFilter(FeedbackMessage.WARNING));

add(warnFeedback);

Produces:
--

div class=feedback wicket:id=warnwicket:panel
  ul wicket:id=feedbackul class=feedbackPanel

li wicket:id=messages class=feedbackPanelERROR
  span wicket:id=message class=feedbackPanelERRORerror/span
/lili wicket:id=messages class=feedbackPanelWARNING
  span wicket:id=message class=feedbackPanelWARNINGwarn/span
/li
  /ul
/wicket:panel/div
div class=feedback wicket:id=infowicket:panel

  ul wicket:id=feedbackul class=feedbackPanel
li wicket:id=messages class=feedbackPanelERROR
  span wicket:id=message class=feedbackPanelERRORerror/span
/lili wicket:id=messages class=feedbackPanelINFO
  span wicket:id=message class=feedbackPanelINFOinfo/span
/lili wicket:id=messages class=feedbackPanelWARNING
  span wicket:id=message class=feedbackPanelWARNINGwarn/span

/li
  /ul
/wicket:panel/div
div class=feedback wicket:id=errorwicket:panel
  ul wicket:id=feedbackul class=feedbackPanel
li wicket:id=messages class=feedbackPanelERROR
  span wicket:id=message class=feedbackPanelERRORerror/span
/li
  /ul

/wicket:panel/div
/wicket:panel/div



Maarten Bosteels schrieb:

http://wicket.apache.org/docs/1.4/org/apache/wicket/feedback/ErrorLevelFeedbackMessageFilter.html

On Mon, Oct 12, 2009 at 9:33 AM, Bernhard Grünewaldt 
bernh...@gruenewaldt.net wrote:


Hello,

I know how to add a Feedbackpanel and how to filter it by specific forms
a.s.o.
But I want three feedbackpanels. One for warn, one for error and one
for info.

I didn't find a implementation of IFeedbackMessageFilter which does that.
(Or I don't know how it could do that)

Is there a way to do that?

Something like:

## pseudocode:
  FeedbackPanel f = new FeedbackPanel(warn);
  f.showOnly(FeedbackPanel.WARN);
  add(f);
##

would be nice.

thx

Bernhard



-
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: Feedbackpanel for exact one Error Level

2009-10-12 Thread Bernhard Grünewaldt

thx, thats perfect.
I am still not used to private subclassing :(

Hauke Ingmar Schmidt schrieb:

Hej,


I know how to add a Feedbackpanel and how to filter it by specific forms
a.s.o.
But I want three feedbackpanels. One for warn, one for error and one
for info.

I didn't find a implementation of IFeedbackMessageFilter which does that.
(Or I don't know how it could do that)

Is there a way to do that?


You need to set an IFeedbackMessageFilter on the Feedback panel, e.g.:

FeedbackPanel fbp = new FeedbackPanel(feedback, new
IFeedbackMessageFilter() {
public boolean accept(FeedbackMessage message) {
return 
message.getLevel()==FeedbackMessage.ERROR;
}
});

Bye
Hauke Ingmar

-
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



[wicket-1.4] parameterizing ResourceModel for wicket:message

2009-10-06 Thread Bernhard Grünewaldt

Hello,

I am using a properties.xml file for my wicket:message tags.
And soon I wondered if there is a way to parameterize these messages,
like it worked for apache struts.

With wicket I can just say
  entry key=testfoo/entry
and use
  wicket:message key=test /


In Struts something like
  mymessage = foo {0}
- and -
  bean:message key=mymessage  arg0=bar/
was possible, which produced foo bar

Is there already a way to do this?
And if not, do you think it is worth being implemented?

I searched the mailing lists and the wiki fo a solution but didn't find 
something similar.



thx,

Bernhard Grünewaldt



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



Re: [wicket-1.4] parameterizing ResourceModel for wicket:message

2009-10-06 Thread Bernhard Grünewaldt

thx,
that works.
should have looked closer at the api ;)



Matthias Keller schrieb:

Hi Bernhard

Have a look at StringResourceModel, though I think it's not possible to 
use it directly with wicket:message but you can use it easily in a label.

It supports both MessageFormat style and model-style replacements.

Matt

Bernhard Grünewaldt wrote:

Hello,

I am using a properties.xml file for my wicket:message tags.
And soon I wondered if there is a way to parameterize these messages,
like it worked for apache struts.

With wicket I can just say
  entry key=testfoo/entry
and use
  wicket:message key=test /


In Struts something like
  mymessage = foo {0}
- and -
  bean:message key=mymessage  arg0=bar/
was possible, which produced foo bar

Is there already a way to do this?
And if not, do you think it is worth being implemented?

I searched the mailing lists and the wiki fo a solution but didn't 
find something similar.



thx,

Bernhard Grünewaldt



-
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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Bernhard Michal
Afaik there is no way to set this behavior by some flag. But

1) You can extend TextField to wrap it's model with model which on
getObject() trim (ie. remove begging and trailing spaces) returning
string if Model's type is Sting (in other cases it doesn't make
sense)... when value is setted into model trimming is done by wicket
(see FormComponent#shouldTrimInput) automatically (in older version you
have to do this manually by overriding FormComponent#convertInput()
method)

2) you can do aspect (AspectJ?) to do the same as 1) - with aspect there
is no need to make new class of TextField's type so there is no need to
change the code base...

3) you can override implementation of coverters

override Application#newConverterLocator() to

protected IConverterLocator newConverterLocator() {
ConverterLocator locator = new ConverterLocator();
locator.set(String.class, new IConverter() {

   public Object convertToObject(String value,
Locale locale) {
return convertToString(value,
locale);
}

public String convertToString(Object value,
Locale locale) {
return value.toString().trim();
// see trim() which remove trailing and beginning spaces
}
 });

return locator;
}

I didn't test it but you've got the idea... But this solution is really
bad, because if you want to turn off this behaviour (trimming) in some
cases
you can't do it without overriding for example Component#getConverter()
to convert it in default way and it's a mess.

I recommend you to trim it by hand on Model level (make some wrapper
model to do it so) or on tier (layer) where you obtain data (data acces
layer? service level?). It depends on if spaces have some business
meaning. If yes do it on model level otherwise on that layer.

Best wishes

MB

-Original Message-
From: David Chang [mailto:david_q_zh...@yahoo.com] 
Sent: Friday, October 02, 2009 5:25 AM
To: users@wicket.apache.org
Subject: Can Wicket automatically remove beginning and trailing spaces
in a text field?

How to set it up in a Wicket application? I would like to set it up in
the application level.

Thanks!


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



image html element's (img) src attribute processing

2009-09-24 Thread Bernhard Michal

Hello everyone.

I noticed that wicket automatically translate url in img's src attribute
in html to the right url regarding to changed url context. 
I mean when I've got eg. link img src=/img/someimage.png and that
page is rendered in some context for example /appContext/ the src
attribute is automatically changed to something like this: img
src=/../img/someimage.png (notice two dots) to reflect changed
context (and link 
still the same resource)

1) Where exactly is the code which doing this?
2) How can I obtain this changed url for static resources?

I am asking this because I've got some static resources (javascripts)
and I need to know their relative url regarding to changed context.

Thank you for your response.

Best wishes

MB





 

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



RE: image html element's (img) src attribute processing

2009-09-24 Thread Bernhard Michal
Great! Thank you very much.

I get new url through
IRequestCodingStrategy#rewriteStaticRelativeUrl(String url):

String newUrl =
RequestCycle.get().getProcessor().getRequestCodingStrategy().rewriteStat
icRelativeUrl(urlToChange);

MB

-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Thursday, September 24, 2009 1:33 PM
To: users@wicket.apache.org
Subject: Re: image html element's (img) src attribute processing

1) Where exactly is the code which doing this?
http://wicket.apache.org/docs/1.4/org/apache/wicket/request/IRequestCodi
ngStrategy.html
2) How can I obtain this changed url for static resources?
You can create an resource reference to your image resource.
http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wic
ket/ResourceReference.html


On Thu, Sep 24, 2009 at 6:13 AM, Bernhard Michal
michal.bernh...@tigra.czwrote:


 Hello everyone.

 I noticed that wicket automatically translate url in img's src 
 attribute in html to the right url regarding to changed url context.
 I mean when I've got eg. link img src=/img/someimage.png and that 
 page is rendered in some context for example /appContext/ the src 
 attribute is automatically changed to something like this: img 
 src=/../img/someimage.png (notice two dots) to reflect changed 
 context (and link still the same resource)

 1) Where exactly is the code which doing this?
 2) How can I obtain this changed url for static resources?

 I am asking this because I've got some static resources (javascripts) 
 and I need to know their relative url regarding to changed context.

 Thank you for your response.

 Best wishes

 MB







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




--
Pedro Henrique Oliveira dos Santos

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



Setting font for ModalWindow title bar

2007-08-28 Thread Bernhard
Hello,

is it possbile to change the font for the title bar of a ModalWindow?

Many thanks
Bernhard
---

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