Re: StatelessForm redirect

2011-03-28 Thread Clint Checketts
Ah, the trouble is in your NPE:

java.lang.NullPointerException
   at index.AbcPage.validateParams(
AbcPage.java:258)

As long as that exception remains unhandled, the pages won't hand off. The
Form has to resubmit back to the page the form lives on since that is where
the form listener is waiting.

If you feel confident and wish to totally bypass wicket's form processing,
instead of a Form you could use a WebMarkupContainer and in the
onComponentTag set the Action attribute to the page you want to redirect to.
I did something similar long ago when I was first learning Wicket. I don't
recommend it, but it is a possible solution.

-Clint

On Mon, Mar 28, 2011 at 10:01 PM, lovewicket  wrote:

> I tried to put the following in my application class, but unfortunately got
> the same results (application tries to load the current page and then
> redirect the request):
>
>
> getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413610.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: StatelessForm redirect

2011-03-28 Thread lovewicket
I tried to put the following in my application class, but unfortunately got
the same results (application tries to load the current page and then
redirect the request):

getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413610.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: StatelessForm redirect

2011-03-28 Thread Clint Checketts
Wicket uses a 2 step render :
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/settings/IRequestCycleSettings.html

Have you tried using setRenderStrategy(ONE_PASS_RENDER ONE_PASS_RENDER) in
your application?

-Clint


On Mon, Mar 28, 2011 at 7:37 PM, lovewicket  wrote:

> Yes. I have the following in my application class:
>
> mount(new QueryStringUrlCodingStrategy("/searchresults",
> SearchResultsPage.class));
>
> It didn't work. I am not sure why wicket doesn't directly go to the
> specified page instead of loading the current page again and then going to
> the specified page. I would assume, in a stateless environment, this would
> fail everytime. By the way, if I change StatelessForm to Form, it all
> works,
> but it creates a session which is not desired (since we were having memory
> issues with sessions).
>
> As a workaround, I stored the parameters as a hidden field on the page (can
> verify this via Page Source), but when I tried to retrieve them via
> getMarkupAttributes() it came out blank so I have to assume that the
> attributes are added at the last rendering stage and are not read back in
> on
> form submit.
>
> I would really appreciate any ideas. Thanks.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413429.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: Set all form fields to output markup id automatically

2011-03-28 Thread Jeremy Thomerson
On Sun, Mar 27, 2011 at 11:43 PM, Bruno Borges wrote:

> For now, I simply did this:
>
>  object autoMarkupId extends IComponentInstantiationListener {
> def onInstantiation(component: Component) {
>if (component.isInstanceOf[FormComponent[_]]) {
>   component.setOutputMarkupId(true)
>   component.setMarkupId(component.getId())
>}
> }
>  }
>
>  getComponentInstantiationListeners().add(autoMarkupId);
>
> I've been playing with this technic, of having all Form components
> outputing
> their ids as is. Of course, this is application-specific, and Wicket should
> not take this to its core.
>

I personally would suggest *not* having that second line
"component.setMarkupId(component.getId())" there.  Let Wicket generate the
IDs for you so that they're all unique on a page.  Your approach above
breaks using two EmailAddressTextField (fake example class) components on
the same page.

Designers should use css class to style.  An occasional ID that isn't
attached to a Wicket component can also help (div surrounding content
section, etc).

But it seems that improves development time, when the web designer codes CSS
> and HTML with the application running on his machine. No more code like
>
>  wicket:id="foo" id="foo"
>
> Now, I'm considering to implement a different way to define a Wicket
> component in the HTML:
>
>   
>   
>
>  add(new WebMarkupContainer("foo"));
>
> What you guys think of this?
>

This approach of coding in the markup and automagic generation of components
has been discussed numerous times.  It's not in line with Wicket's core
principles, so we won't add it, but we've made it easy enough to add it to
your own app.  However, watch out: the example you give above is useless -
it just creates a markup container.  So, the next request will be "let me
configure that component by adding attributes in the markup; maybe I can
have 'property='firstName'' to show that this should be a label that
displays the first name".  Now you're programming in markup - you might as
well use PHP!  :P

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: StatelessForm redirect

2011-03-28 Thread lovewicket
Yes. I have the following in my application class:

mount(new QueryStringUrlCodingStrategy("/searchresults",
SearchResultsPage.class));

It didn't work. I am not sure why wicket doesn't directly go to the
specified page instead of loading the current page again and then going to
the specified page. I would assume, in a stateless environment, this would
fail everytime. By the way, if I change StatelessForm to Form, it all works,
but it creates a session which is not desired (since we were having memory
issues with sessions).

As a workaround, I stored the parameters as a hidden field on the page (can
verify this via Page Source), but when I tried to retrieve them via
getMarkupAttributes() it came out blank so I have to assume that the
attributes are added at the last rendering stage and are not read back in on
form submit.

I would really appreciate any ideas. Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413429.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: StatelessForm redirect

2011-03-28 Thread Clint Checketts
Do you get the same error when mounting the page using a
QueryStringEncodingStrategy?

On Monday, March 28, 2011, lovewicket  wrote:
> It looks like onSubmit, request first comes to the current page and then it
> gets forwarded to the results page. I am not sure why this is the case. In
> stateless application, loading the current page again fails the validation
> because the parameters that are needed to build the current page are not
> there. I even tried to store these as a hidden field, but on form submit
> they come up blank.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3412643.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: [OT] Apache Wicket Merchandise, nominees Spring roundup

2011-03-28 Thread Martin Grigorov
Hehe :-)
Thanks Attila!

I'd like to nominate Igor for everything he did and still does for Wicket
and Open Source as whole!
I'm also one of the technical reviewers of his book and I can say there are
really useful recipes even for more experienced users like me!

Nominating second place is really hard:
- Juergen for making markup management even more robust and flexible
- Pedro for keeping me away from problems with IE ;-)
- Michael and Attila for their work on wicketstuff

I'd like to buy a beer for everyone of you! :-)

On Mon, Mar 28, 2011 at 9:07 PM, Attila Király wrote:

> Hi!
>
> I nominate Martin Grigorov for his continuous, dedicated work on wicket and
> friendly help for users.
>
> Attila
>
> 2011/3/28 nino martinez wael 
>
> > Hi guys
> >
> > Been a while, but theres cash in the shop[1] again so that means it's
> > time to give out some merchandise :)
> >
> > So lets round up some nominees for the very prestigious Apache Wicket
> > Merchandise community AWARD program..
> >
> > I nominate
> >
> > Igor for doing his Wicket cookbook[2]
> > Michael O'Cleirigh for work on maintaining wicketstuff
> >
> >
> > Please reply to this thread with other nominees, state name and reason
> > why you think the nominee are the best contributer to the wicket
> > community.. After April 15 I'll put up a poll so we all can decide who
> > should be the lucky winner..
> >
> >
> > [2]https://www.packtpub.com/apache-wicket-cookbook/book
> > [1]http://www.cafepress.com/apachewicket
> > regards Nino
> >
> > -
> > 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 


Re: StatelessForm redirect

2011-03-28 Thread lovewicket
It looks like onSubmit, request first comes to the current page and then it
gets forwarded to the results page. I am not sure why this is the case. In
stateless application, loading the current page again fails the validation
because the parameters that are needed to build the current page are not
there. I even tried to store these as a hidden field, but on form submit
they come up blank.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3412643.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: [OT] Apache Wicket Merchandise, nominees Spring roundup

2011-03-28 Thread Bruno Borges
I nominate Michael for his great work at WicketStuff and Pedro who's
brazilian like me and representing Latin America (and will probably own me a
beer the next time he comes to Rio)... :-)


Bruno Borges
www.brunoborges.com.br
+55 21 76727099

"The glory of great men should always be
measured by the means they have used to
acquire it."
 - Francois de La Rochefoucauld



On Mon, Mar 28, 2011 at 3:08 PM, Josh Kamau  wrote:

> I nominate Martin Grigorov a and Pedro Santos. Thanks to them, none of my
> questions has gone un answered in this forum.
>
> josh.
>
> On Mon, Mar 28, 2011 at 8:45 PM, nino martinez wael <
> nino.martinez.w...@gmail.com> wrote:
>
> > Hi guys
> >
> > Been a while, but theres cash in the shop[1] again so that means it's
> > time to give out some merchandise :)
> >
> > So lets round up some nominees for the very prestigious Apache Wicket
> > Merchandise community AWARD program..
> >
> > I nominate
> >
> > Igor for doing his Wicket cookbook[2]
> > Michael O'Cleirigh for work on maintaining wicketstuff
> >
> >
> > Please reply to this thread with other nominees, state name and reason
> > why you think the nominee are the best contributer to the wicket
> > community.. After April 15 I'll put up a poll so we all can decide who
> > should be the lucky winner..
> >
> >
> > [2]https://www.packtpub.com/apache-wicket-cookbook/book
> > [1]http://www.cafepress.com/apachewicket
> > regards Nino
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Re: [OT] Apache Wicket Merchandise, nominees Spring roundup

2011-03-28 Thread Josh Kamau
I nominate Martin Grigorov a and Pedro Santos. Thanks to them, none of my
questions has gone un answered in this forum.

josh.

On Mon, Mar 28, 2011 at 8:45 PM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Hi guys
>
> Been a while, but theres cash in the shop[1] again so that means it's
> time to give out some merchandise :)
>
> So lets round up some nominees for the very prestigious Apache Wicket
> Merchandise community AWARD program..
>
> I nominate
>
> Igor for doing his Wicket cookbook[2]
> Michael O'Cleirigh for work on maintaining wicketstuff
>
>
> Please reply to this thread with other nominees, state name and reason
> why you think the nominee are the best contributer to the wicket
> community.. After April 15 I'll put up a poll so we all can decide who
> should be the lucky winner..
>
>
> [2]https://www.packtpub.com/apache-wicket-cookbook/book
> [1]http://www.cafepress.com/apachewicket
> regards Nino
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: [OT] Apache Wicket Merchandise, nominees Spring roundup

2011-03-28 Thread Attila Király
Hi!

I nominate Martin Grigorov for his continuous, dedicated work on wicket and
friendly help for users.

Attila

2011/3/28 nino martinez wael 

> Hi guys
>
> Been a while, but theres cash in the shop[1] again so that means it's
> time to give out some merchandise :)
>
> So lets round up some nominees for the very prestigious Apache Wicket
> Merchandise community AWARD program..
>
> I nominate
>
> Igor for doing his Wicket cookbook[2]
> Michael O'Cleirigh for work on maintaining wicketstuff
>
>
> Please reply to this thread with other nominees, state name and reason
> why you think the nominee are the best contributer to the wicket
> community.. After April 15 I'll put up a poll so we all can decide who
> should be the lucky winner..
>
>
> [2]https://www.packtpub.com/apache-wicket-cookbook/book
> [1]http://www.cafepress.com/apachewicket
> regards Nino
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


[OT] Apache Wicket Merchandise, nominees Spring roundup

2011-03-28 Thread nino martinez wael
Hi guys

Been a while, but theres cash in the shop[1] again so that means it's
time to give out some merchandise :)

So lets round up some nominees for the very prestigious Apache Wicket
Merchandise community AWARD program..

I nominate

Igor for doing his Wicket cookbook[2]
Michael O'Cleirigh for work on maintaining wicketstuff


Please reply to this thread with other nominees, state name and reason
why you think the nominee are the best contributer to the wicket
community.. After April 15 I'll put up a poll so we all can decide who
should be the lucky winner..


[2]https://www.packtpub.com/apache-wicket-cookbook/book
[1]http://www.cafepress.com/apachewicket
regards Nino

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



RE: HTML comment tag

2011-03-28 Thread Brown, Berlin [GCG-PFS]
Oops, I didn't see this, is this the same thing?

java.lang.Object
  org.apache.wicket.protocol.http.documentvalidation.Comment 

-Original Message-
From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
Behalf Of James Carman
Sent: Monday, March 28, 2011 1:04 PM
To: users@wicket.apache.org
Subject: Re: HTML comment tag

We do this in our application by doing:

add(new Label("debugInfo", new
DebugInfoModel()).setEscapeModelStrings(false).setRenderBodyOnly(true));

private static class DebugInfoModel extends LoadableDetachableModel
{
@Override
protected String load()
{
return MessageFormat.format("",
WebApplication.get().getFrameworkSettings().getVersion(),
System.getProperty("java.vendor") + " " + 
System.getProperty("java.version"),
versionOf(Hibernate.class),
versionOf(ApplicationContext.class),
versionOf(OracleDriver.class),
WebApplication.get().getServletContext().getServerInfo(),
System.getProperty("os.version"));
}
}

On Mon, Mar 28, 2011 at 1:00 PM, Brown, Berlin [GCG-PFS] 
 wrote:
> They may contain information like a build number, version number of 
> application for debugging purposes that I can see on the rendered HTML 
> output.
>
> I was thinking of sub-classing label because the output of a comment 
> is similar to that kind of markup.
>
> -Original Message-
> From: Pedro Santos [mailto:pedros...@gmail.com]
> Sent: Monday, March 28, 2011 12:19 PM
> To: users@wicket.apache.org
> Subject: Re: HTML comment tag
>
> An reusable behavior can be archived using the MarkupComponentBorder.
> On a side note, why do you want to write commented model values in 
> markup?
>
> On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] < 
> berlin.br...@primerica.com> wrote:
>
>> This is simple code and works, do you think this is a way to add 
>> dynamic HTML comments that use some Wicket model?
>> Or have you done something else?
>>
>> I am not as familiar with onComponentTagBody.
>>
>> public class HtmlComment extends Label {
>>
>>    /**
>>     * @see
>>
> org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
>> MarkupStream,
>>     *      org.apache.wicket.markup.ComponentTag)
>>     */
>>    @Override
>>    protected void onComponentTagBody(final MarkupStream markupStream, 
>> final ComponentTag openTag) {
>>        replaceComponentTagBody(markupStream, openTag, "");
>>    }
>>
>> }
>>
>> and the output will be in the final HTML output:
>>
>> 
>>
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
> -
> 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: HTML comment tag

2011-03-28 Thread James Carman
We do this in our application by doing:

add(new Label("debugInfo", new
DebugInfoModel()).setEscapeModelStrings(false).setRenderBodyOnly(true));

private static class DebugInfoModel extends LoadableDetachableModel
{
@Override
protected String load()
{
return MessageFormat.format("",
WebApplication.get().getFrameworkSettings().getVersion(),
System.getProperty("java.vendor") + " " +
System.getProperty("java.version"),
versionOf(Hibernate.class),
versionOf(ApplicationContext.class),
versionOf(OracleDriver.class),
WebApplication.get().getServletContext().getServerInfo(),
System.getProperty("os.version"));
}
}

On Mon, Mar 28, 2011 at 1:00 PM, Brown, Berlin [GCG-PFS]
 wrote:
> They may contain information like a build number, version number of
> application for debugging purposes that I can see on the rendered HTML
> output.
>
> I was thinking of sub-classing label because the output of a comment is
> similar to that kind of markup.
>
> -Original Message-
> From: Pedro Santos [mailto:pedros...@gmail.com]
> Sent: Monday, March 28, 2011 12:19 PM
> To: users@wicket.apache.org
> Subject: Re: HTML comment tag
>
> An reusable behavior can be archived using the MarkupComponentBorder.
> On a side note, why do you want to write commented model values in
> markup?
>
> On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] <
> berlin.br...@primerica.com> wrote:
>
>> This is simple code and works, do you think this is a way to add
>> dynamic HTML comments that use some Wicket model?
>> Or have you done something else?
>>
>> I am not as familiar with onComponentTagBody.
>>
>> public class HtmlComment extends Label {
>>
>>    /**
>>     * @see
>>
> org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
>> MarkupStream,
>>     *      org.apache.wicket.markup.ComponentTag)
>>     */
>>    @Override
>>    protected void onComponentTagBody(final MarkupStream markupStream,
>> final ComponentTag openTag) {
>>        replaceComponentTagBody(markupStream, openTag, "");
>>    }
>>
>> }
>>
>> and the output will be in the final HTML output:
>>
>> 
>>
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
> -
> 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: HTML comment tag

2011-03-28 Thread Brown, Berlin [GCG-PFS]
They may contain information like a build number, version number of
application for debugging purposes that I can see on the rendered HTML
output.

I was thinking of sub-classing label because the output of a comment is
similar to that kind of markup. 

-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Monday, March 28, 2011 12:19 PM
To: users@wicket.apache.org
Subject: Re: HTML comment tag

An reusable behavior can be archived using the MarkupComponentBorder.
On a side note, why do you want to write commented model values in
markup?

On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> This is simple code and works, do you think this is a way to add 
> dynamic HTML comments that use some Wicket model?
> Or have you done something else?
>
> I am not as familiar with onComponentTagBody.
>
> public class HtmlComment extends Label {
>
>/**
> * @see
>
org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
> MarkupStream,
> *  org.apache.wicket.markup.ComponentTag)
> */
>@Override
>protected void onComponentTagBody(final MarkupStream markupStream, 
> final ComponentTag openTag) {
>replaceComponentTagBody(markupStream, openTag, "");
>}
>
> }
>
> and the output will be in the final HTML output:
>
> 
>



--
Pedro Henrique Oliveira dos Santos


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



Re: just having another question how to clear form fields

2011-03-28 Thread Pedro Santos
Set a null/empty value in their model plus notify the component about
changed models e.g. Component#modelChanged.
e.g.
form = new Form(new CompoundPropertyModel(new Bean())
form.add(new Field("someProperty");
(...)
form.add(new SubmitComponent("id"){
 onSubmit(){
form.setDefaultModelObject(new Bean());//set empty values
also calls Component#modelChanged method
}});

On Mon, Mar 28, 2011 at 1:29 PM, hariharansrc wrote:

> after clicking submit button the values are still there in field itself how
> to clear the field values
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/how-to-call-javascript-function-on-form-submission-tp3408147p3412291.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
>
>


-- 
Pedro Henrique Oliveira dos Santos


Re: just having another question how to clear form fields

2011-03-28 Thread hariharansrc
after clicking submit button the values are still there in field itself how
to clear the field values

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-call-javascript-function-on-form-submission-tp3408147p3412291.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: HTML comment tag

2011-03-28 Thread Pedro Santos
An reusable behavior can be archived using the MarkupComponentBorder.
On a side note, why do you want to write commented model values in markup?

On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> This is simple code and works, do you think this is a way to add dynamic
> HTML comments that use some Wicket model?
> Or have you done something else?
>
> I am not as familiar with onComponentTagBody.
>
> public class HtmlComment extends Label {
>
>/**
> * @see
> org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
> MarkupStream,
> *  org.apache.wicket.markup.ComponentTag)
> */
>@Override
>protected void onComponentTagBody(final MarkupStream markupStream,
> final ComponentTag openTag) {
>replaceComponentTagBody(markupStream, openTag, "");
>}
>
> }
>
> and the output will be in the final HTML output:
>
> 
>



-- 
Pedro Henrique Oliveira dos Santos


Re: Highlight current/clicked AjaxLink

2011-03-28 Thread Mansour Al Akeel
Josh, I tried to run the app, but I couldn't resolve an issue with
maven. May be you have seen something similar before. I had deleted the 
corresponding wicket/1.4.12 direcotry 
from maven repo to forse it to re download, but no luck. I am using maven 3. Do 
I need to install all these required projects manaully ?


Apache Maven 3.0.1 (r1038046; 2010-11-23 05:58:32-0500)
Java version: 1.6.0_24
Java home: /opt/sun-jdk-1.6.0.24/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux" version: "2.6.36-gentoo-r5" arch: "amd64" Family: "unix"


[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
com.josh:demoapp:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for 
org.mortbay.jetty:maven-jetty-plugin is missing. @ line 174, column 12
[WARNING] 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 163, column 12
[WARNING] 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 178, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
[WARNING] 
[INFO] 
[INFO] 
[INFO] Building demoapp 1.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] >>> maven-jetty-plugin:6.1.22:run (default-cli) @ demoapp >>>
[WARNING] The POM for org.apache.wicket:wicket:jar:1.4.12 is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[WARNING] The POM for org.apache.wicket:wicket-extensions:jar:1.4.12 is 
invalid, transitive dependencies (if any) will not be available, enable debug 
logging for more details
[WARNING] The POM for org.apache.wicket:wicket-guice:jar:1.4.12 is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[WARNING] The POM for com.google.inject:guice-servlet:jar:2.0 is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[WARNING] The POM for com.wideplay.warp:warp-persist:jar:2.0 is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[WARNING] The POM for org.hibernate:hibernate-entitymanager:jar:3.5.1-Final is 
invalid, transitive dependencies (if any) will not be available, enable debug 
logging for more details
[WARNING] The POM for org.hibernate:hibernate-validator:jar:4.0.2.GA is 
invalid, transitive dependencies (if any) will not be available, enable debug 
logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ demoapp 
---
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ demoapp ---
[WARNING] File encoding has not been set, using platform encoding 
ANSI_X3.4-1968, i.e. build is platform dependent!
[INFO] Compiling 25 source files to 
/home/mansour/downloads/demoapp/demoapp/target/classes
[INFO] -
[ERROR] COMPILATION ERROR : 
[INFO] -
[ERROR] error: error reading 
/home/mansour/.m2/repository/org/apache/wicket/wicket/1.4.12/wicket-1.4.12.jar; 
error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/org/apache/wicket/wicket-extensions/1.4.12/wicket-extensions-1.4.12.jar;
 error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/org/apache/wicket/wicket-guice/1.4.12/wicket-guice-1.4.12.jar;
 error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/com/google/inject/guice-servlet/2.0/guice-servlet-2.0.jar;
 error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/com/wideplay/warp/warp-persist/2.0/warp-persist-2.0.jar;
 error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/org/hibernate/hibernate-entitymanager/3.5.1-Final/hibernate-entitymanager-3.5.1-Final.jar;
 error in opening zip file
[ERROR] error: error reading 
/home/mansour/.m2/repository/org/hibernate/hibernate-validator/4.0.2.GA/hibernate-validator-4.0.2.GA.jar;
 error in opening zip file
[INFO] 7 errors 
[INFO] -
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Tot

Re: Highlight current/clicked AjaxLink

2011-03-28 Thread Mansour Al Akeel
Marco, thank you.
I have implemented already the pages as a panel to be replaced, and this
was a requirement to do it with ajax. So I can not follow this route at
this point. But what you have here is the exact functionality I am
after. It will be nice if I can disable the current link, but I need to
at least show it's current in the style.


On Mon Mar 28,2011 08:46 am, Marco Springer wrote:
> Hi Mansour
> 
> For reloading different pages I'm using BookmarkablePageLink
> (non-ajax), that have the option for "setAutoEnable(true)'.
> When this option is set for each BookmarkablePageLink and one
> BookmarkablePageLink is clicked on the website, the generated HTML for
> that link is changed.
> For example:
> My current page is Home and the other available page link is the Gallery.
> 
> Home
> Gallery
> 
> After clicking on the Gallery button:
> Home
> Gallery
> 
> I think this does the job perfectly, in my case... Perhaps you can
> apply it for your case as well.
> 
> For a more detailed description:
> http://wicketstuff.org/wicket14/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.BookmarkablePageLinkPage
> 
> G'luck
> 
> Marco.
> 
> On 28 March 2011 07:48, Mansour Al Akeel  wrote:
> > Josh,
> > Yes each link is reloading a different page, and the list of the links
> > is not rebuilt. Only the contents part of the page.
> > What would your css alternative solution be ? How can I get the clicked
> > link disabled and assing it a class, excluding the rest of the links,
> > without breaking the ajax functionality for the AjaxLink ?
> >
> > On Mon Mar 28,2011 07:51 am, Josh Kamau wrote:
> >> hi.
> >>
> >> Have you tried something like
> >>
> >> ?myLink.add(new AttributeAppender(...));
> >>
> >> or
> >>
> >> myLink.add(new AttributeModifier(...))
> >>
> >> this methods can add/modify a css class in a markup element.
> >>
> >> Please check the javadocs for method details if this is what you want.
> >>
> >> However, if i were in your situation, i would use css only to archieve this
> >> , that is , if each link reloads a different page.
> >>
> >>
> >> Josh.
> >
> > -
> > 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



HTML comment tag

2011-03-28 Thread Brown, Berlin [GCG-PFS]
This is simple code and works, do you think this is a way to add dynamic
HTML comments that use some Wicket model?
Or have you done something else?
 
I am not as familiar with onComponentTagBody.
 
public class HtmlComment extends Label {
 
/**
 * @see
org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
MarkupStream,
 *  org.apache.wicket.markup.ComponentTag)
 */
@Override
protected void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, "");
}
 
}
 
and the output will be in the final HTML output:
 



Re: [1.5RC2] impossible to add cookies

2011-03-28 Thread Vytautas R.
Hi,
 for me this part did work:

store:
new CookieUtils().save(ID, value);

load:
new CookieUtils().load(ID);


On Mon, Mar 28, 2011 at 4:11 PM, Pedro Santos  wrote:

> Hi, just tested http://wicketstuff.org/wicket/authentication2 and the
> example set the cookie in response without problems.
> Open a ticket + quickstart reproducing the problem please.
>
> On Sun, Mar 27, 2011 at 8:48 PM, adriclad  wrote:
>
> > Anybody had the same problem ?
> >
> > May I have to refer the bug in a jira ticket for the 1.5-RC3 ?
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/1-5RC2-impossible-to-add-cookies-tp3380554p3409846.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
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Best regards,
Vytautas R.
---
www.xaloon.org
www.allcarindex.com


Re: Development / Deployment mode problem

2011-03-28 Thread MattyDE
My first clue: Are you using wicket:container Tags in your markup? In
Deployment Mode this tags could not be rendered to the markup by Application
Settings.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Development-Deployment-mode-problem-tp3411737p3411751.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



Development / Deployment mode problem

2011-03-28 Thread Tejash Tarun
Hi,

I have used a jquery control full calendar from
http://arshaw.com/fullcalendar/.
I have used that control in a wicket application, where in one page there
are two tabs, and in one tab there  are some text-fields and in the other
this calendar control.

But now for my local server which is on development mode everything is fine.
But when I deploy my application on any deployment server then, in Chrome
and Safari
calendar comes for the first time when i go to the calendar tab. But when I
navigate to the other tab and come back again then calendar never comes
again. This works fine for FF and IE.

So my question is: Why is this difference in Deployment/Development mode ??
How to solve this issue ??

Thanks in advance.


Re: [1.5RC2] impossible to add cookies

2011-03-28 Thread Pedro Santos
Hi, just tested http://wicketstuff.org/wicket/authentication2 and the
example set the cookie in response without problems.
Open a ticket + quickstart reproducing the problem please.

On Sun, Mar 27, 2011 at 8:48 PM, adriclad  wrote:

> Anybody had the same problem ?
>
> May I have to refer the bug in a jira ticket for the 1.5-RC3 ?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/1-5RC2-impossible-to-add-cookies-tp3380554p3409846.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
>
>


-- 
Pedro Henrique Oliveira dos Santos


Re: Error during headers validation since migration to 1.5

2011-03-28 Thread Pedro Santos
Hi adrien, yes, with a quickstart reproducing the error please.

On Sun, Mar 27, 2011 at 8:54 PM, adriclad  wrote:

> No answer...
>
> May I write a Jira ticket for 1.5-RC3 to inform this bug ?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Error-during-headers-validation-since-migration-to-1-5-tp3355890p3409851.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
>
>


-- 
Pedro Henrique Oliveira dos Santos


RE: issue with

2011-03-28 Thread hrbaer
thanks - that's it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411433.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

2011-03-28 Thread Wilhelmsen Tor Iver
> And idea how to avoid that behaviour?

resetButton.setDefaultFormProcessing(false);

- Tor Iver

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



Re: issue with

2011-03-28 Thread Josh Kamau
Hi

You can add a wicket button on your form and implement onClick/onSubmit on
the button.

There many buttons including ajax enabled ones. See javadocs for details.

Something like


...
   


myForm.add(new Button("myButton"){
 @Override
public void onSubmit() {
//do your stuff here
}

})

Josh.


>


Re: issue with

2011-03-28 Thread hrbaer
Meanwhile I tried to add another submit button and just labeling that as a
reset button.
This is almost working but after calling the onSubmit method of my "reset
button" the onSubmit method of my form get's triggered as well?!

This is my button:
-
Button resetButton  = new Button("reset") {

public void onSubmit() {
doSomething();
}
};
add( resetButton );
-

And idea how to avoid that behaviour?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411408.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

2011-03-28 Thread hrbaer
Hi all,

let's assume there is a form with an input field an two buttons: submit and
reset.
Within the java code I add a new form component (extends Form) with an input
field and implement the onSubmit() method.

But: Is there a chance to implement some onReset() method so I can do some
more stuff apart from cleaning the input field (which I cannot influence)?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411379.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: make link invisible via onclick

2011-03-28 Thread Josh Kamau
Hi,

How about something like this.

private Boolean isLinkVisible = true ;
...


final Link link = new Link("test"){

  @Override
 public void onClick(){
  isLinkVisible = false ;
}

@Override
public void isVisible(){
   return isLinkVisible ;
}

}

Kind regards.

Josh


RE: make link invisible via onclick

2011-03-28 Thread hrbaer
this works like a charm - thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/make-link-itself-invisible-via-onclick-tp3411327p3411347.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: make link invisible via onclick

2011-03-28 Thread Wilhelmsen Tor Iver
> is there a possibility to make a link invisible itself via onClick?


> link.setVisible( false );

Sure: Just use "this" instead of "link", since "this" in the onClick() will be 
the anonymous object based on Link.

- Tor Iver

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



make link invisible via onclick

2011-03-28 Thread hrbaer
Hi,

is there a possibility to make a link invisible itself via onClick?
At the moment I get an error "The local variable link may not have been
initialized".

code:
--
final Link link = new Link( "test" ) {

@Override
public void onClick() {
  link.setVisible( false );
}
};
--

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/make-link-invisible-via-onclick-tp3411327p3411327.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: Best way to periodically refresh an inmethod DataGrid?

2011-03-28 Thread Chris Colman
I ended up doing it all server side - overriding onSelectionChanged* and
setting a selectedItem attribute. We then override isSelectedItem and
return true if the given item 'equals' selectedItem - must make sure
your IModel and domain classes all override equals and test for class
match and non null operand.

>-Original Message-
>From: Martin Grigorov [mailto:mgrigo...@apache.org]
>Sent: Friday, 25 March 2011 10:35 PM
>To: users@wicket.apache.org
>Subject: Re: Best way to periodically refresh an inmethod DataGrid?
>
>If you update the just the selected row then the selection will be
lost.
>You may try with some JavaScript gymnastics to save the selection and
>restore it later.
>Use AjaxRequestTarget.prependJavascript() for the saving code and
>.appendJavascript() for the restoring code.
>
>The JavaScript to deal with selection is different for the different
>browsers, so better find a JS library that does it for you.
>
>Good luck!
>
>On Thu, Mar 24, 2011 at 11:38 PM, Coleman, Chris <
>chris.cole...@thalesgroup.com.au> wrote:
>
>> We've got a wicket app with an inmethod DataGrid and it displays fine
and
>> we use an AjaxSelfUpdatingTimerBehaviour to update the grid every 5
>seconds.
>> That part works fine - as data changes in the database the changes
are
>> reflected in the table in the browser
>>
>> However, if we select an item the selection dissappears when the very
>next
>> refresh occurs. How do we refresh the DataGrid in such a way that it
>> remembers its selected item after a refresh?
>>
>>
>>
>>
>>
DISCLAIMER:-
-
>-
>> This e-mail transmission and any documents, files and previous e-mail
>> messages
>> attached to it are private and confidential. They may contain
proprietary
>> or copyright
>> material or information that is subject to legal professional
privilege.
>> They are for
>> the use of the intended recipient only.  Any unauthorised viewing,
use,
>> disclosure,
>> copying, alteration, storage or distribution of, or reliance on, this
>> message is
>> strictly prohibited. No part may be reproduced, adapted or
transmitted
>> without the
>> written permission of the owner. If you have received this
transmission
>in
>> error, or
>> are not an authorised recipient, please immediately notify the sender
by
>> return email,
>> delete this message and all copies from your e-mail system, and
destroy
>any
>> printed
>> copies. Receipt by anyone other than the intended recipient should
not be
>> deemed a
>> waiver of any privilege or protection. Thales Australia does not
warrant
>or
>> represent
>> that this e-mail or any documents, files and previous e-mail messages
>> attached are
>> error or virus free.
>>
>>

-
>-
>>
>>
>
>
>--
>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