Re: SSL Links and buttons

2010-10-25 Thread sonxurxo

Hi Ernesto and others,

Yes that's what I mentioned before, I'm able to do what you say, or to
redirect to the HTTP page but not showing the validation errors, but not
both HTTP and show errors. 
By the way, if you check for secureForm.hasError(), will it catch a
situation where there's not literally a validation error but a
business-logic error? (e.g. when, in the onSubmit() method of your login
form, you check that the password is incorrect, it's not a wicket-validation
error, and then you invoke "manually" the error() method of the panel
containing the form to show the message but not the error() method of the
form itself). Will it detect those situations? I'm trying and
secureForm.hasError() always return false, no matter there are even
wicket-validation errors or not.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SSL-Links-and-buttons-tp3001634p3013201.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: how to add ImageAjaxLink into datatable???

2010-10-25 Thread Michael O'Cleirigh

Hi,

The Column provides the component that is used for the cell in the table.

Look at subclassing property column and overriding this method:

public void populateItem(Item>  item, String componentId, 
IModel  rowModel)
{
item.add(new Label(componentId, createLabelModel(rowModel)));

}


Instead of adding a label to the cell add in your ImageAjaxLink (or 
whatever panel you need).


I would recommend creating a new concrete class to hold the new column 
but you could use a dynamic inner class for prototyping purposes.


Regards,

Mike

hi, i want to inserto in my datatable an image like this:

private ImageAjaxLink mailImg;

mailImg = new ImageAjaxLink("mailImg", bean.isMail()));

now my table is:

columns.add(new PropertyColumn(new StringResourceModel("label.col5", this,
null), "col5"));

provider = new TotalConsPagoProveedoresProvider("col1", false);
table = new DefaultDataTable("table", columns, provider, Integer.valueOf(new
StringResourceModel("rowsPerPage", this, null).getString())){

again, how can i add "mailImg" in "columns" of my table

tks!




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



Re: Fwd: Nested CompoundModel

2010-10-25 Thread Pedro Santos
If you have n MyPanelData on a page, you will be fine with the
RepeatingView. Otherwise use the Listview to generate the correct number of
items with MyPanel each render.

On Mon, Oct 25, 2010 at 8:19 PM, Jan Ferko  wrote:

>  well, I have all fields which have to be create dynamicaly grouped in one
> panel. So whole panel is
>
> 2010/10/25 Jeremy Thomerson 
>
> > What part is dynamic / dependent on the form?
> >
> > On Sun, Oct 24, 2010 at 3:59 PM, Jan Ferko  wrote:
> >
> > > Thanks a lot, it worked great.
> > >
> > > I have one more question. I have to create same panel multiple times ,
> > > based
> > > on user output into the form and i have list of panel data model object
> > > inside my form data object. Is it better to generate panels in page
> class
> > > and then passed list of panels into form constructor and use ListView
> or
> > > generate it inside form with RepeatingView and create new instance of
> > > PanelData in Cycle and setting it on Panel and saving it to list like
> > > this...
> > >
> > > RepeatingView rp = new RepeatingView();
> > > for(int i =0; i< n; i++){
> > >   WebMarkupContainer parent = new WebMarkupContainer(rp.newChildID());
> > >
> > > }
> > >
> > > 2010/10/22 Jeremy Thomerson 
> > >
> > > > On Fri, Oct 22, 2010 at 11:38 AM, Sven Meier 
> wrote:
> > > >
> > > > > Hi Jan,
> > > > >
> > > > > when are data2 and data3 initialized? They seems to be null when
> you
> > > put
> > > > up
> > > > > your models.
> > > > >
> > > > > Most of the time it's a bad idea to pull something out of a model
> and
> > > put
> > > > > it back into another model.
> > > > > Do this instead:
> > > > >
> > > > >this.add(new MyPanel(id2, new PropertyModel(model, "data2")));
> > > > >
> > > > > Then in MyPanel:
> > > > >
> > > > >public MyPanel(id, model){
> > > > > super(id, new CompoundPropertyModel(model));
> > > > >
> > > > > This has the following advantages:
> > > > > - MyPanel's model is always in sync with the model of MyForm.
> > > > > - MyPanel's usage of CompoundPropertyModel is hidden from the
> > outside.
> > > If
> > > > > MyPanel want's to utilize a CompoundPropertyModel (because it
> doesn't
> > > set
> > > > > the model on its contained components), it should set it up by
> > itself.
> > > > >
> > > > > HTH
> > > > >
> > > > > Sven
> > > >
> > > >
> > > > Sven is spot-on, and this method he showed you above will absolutely
> > save
> > > > you some bugs down the road!
> > > >
> > > > Thanks Sven!!
> > > >
> > > > --
> > > > Jeremy Thomerson
> > > > http://wickettraining.com
> > > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > > >
> > >
> > >
> > >
> > > --
> > > Jan Ferko,
> > > julyl...@gmail.com
> > >
> >
> >
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>
>
>
> --
> Jan Ferko,
> julyl...@gmail.com
>



-- 
Pedro Henrique Oliveira dos Santos


Error "After 1 minute the Pagemap null is still locked"

2010-10-25 Thread Alec Swan
Hello,

Our production server stopped processing AJAX requests today. I looked
in the log files and noticed a "After 1 minute the Pagemap null is
still locked".
The exception stack trace is shown below followed by a dump of the
thread that was blocking the page.

We are using Wicket 1.4.2, Tomcat 6.0 and Java 6.

Could anybody help troubleshoot this problem?

Thanks,

Alec

EXCEPTION

2010-10-25 21:55:32,501 GMT ERROR [TP-Processor12]
org.apache.wicket.RequestCycle -
org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
null is still locked by: Thread[TP-Processor1,5,main], giving up
trying to get the page for path: 4:offersForm:offers:1:editOfferLink
Begin of stack trace of Thread[TP-Processor1,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
java.io.BufferedInputStream.read(BufferedInputStream.java:317)
org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)

org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)

org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)
End of stack trace of Thread[TP-Processor1,5,main]
org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
null is still locked by: Thread[TP-Processor1,5,main], giving up
trying to get the page for path: 4:offersForm:offers:1:editOfferLink
Begin of stack trace of Thread[TP-Processor1,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
java.io.BufferedInputStream.read(BufferedInputStream.java:317)
org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)

org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)

org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)
End of stack trace of Thread[TP-Processor1,5,main]
at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
at 
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(

Re: ArrayList, Label and Model

2010-10-25 Thread Andreas Petersson

try the following:

Building.this

sent from my smartphone.



I am still curious what I should use isntead of "this" to display data not
in Form.



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



Re: Fwd: Nested CompoundModel

2010-10-25 Thread Jan Ferko
 well, I have all fields which have to be create dynamicaly grouped in one
panel. So whole panel is

2010/10/25 Jeremy Thomerson 

> What part is dynamic / dependent on the form?
>
> On Sun, Oct 24, 2010 at 3:59 PM, Jan Ferko  wrote:
>
> > Thanks a lot, it worked great.
> >
> > I have one more question. I have to create same panel multiple times ,
> > based
> > on user output into the form and i have list of panel data model object
> > inside my form data object. Is it better to generate panels in page class
> > and then passed list of panels into form constructor and use ListView or
> > generate it inside form with RepeatingView and create new instance of
> > PanelData in Cycle and setting it on Panel and saving it to list like
> > this...
> >
> > RepeatingView rp = new RepeatingView();
> > for(int i =0; i< n; i++){
> >   WebMarkupContainer parent = new WebMarkupContainer(rp.newChildID());
> >
> > }
> >
> > 2010/10/22 Jeremy Thomerson 
> >
> > > On Fri, Oct 22, 2010 at 11:38 AM, Sven Meier  wrote:
> > >
> > > > Hi Jan,
> > > >
> > > > when are data2 and data3 initialized? They seems to be null when you
> > put
> > > up
> > > > your models.
> > > >
> > > > Most of the time it's a bad idea to pull something out of a model and
> > put
> > > > it back into another model.
> > > > Do this instead:
> > > >
> > > >this.add(new MyPanel(id2, new PropertyModel(model, "data2")));
> > > >
> > > > Then in MyPanel:
> > > >
> > > >public MyPanel(id, model){
> > > > super(id, new CompoundPropertyModel(model));
> > > >
> > > > This has the following advantages:
> > > > - MyPanel's model is always in sync with the model of MyForm.
> > > > - MyPanel's usage of CompoundPropertyModel is hidden from the
> outside.
> > If
> > > > MyPanel want's to utilize a CompoundPropertyModel (because it doesn't
> > set
> > > > the model on its contained components), it should set it up by
> itself.
> > > >
> > > > HTH
> > > >
> > > > Sven
> > >
> > >
> > > Sven is spot-on, and this method he showed you above will absolutely
> save
> > > you some bugs down the road!
> > >
> > > Thanks Sven!!
> > >
> > > --
> > > Jeremy Thomerson
> > > http://wickettraining.com
> > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > >
> >
> >
> >
> > --
> > Jan Ferko,
> > julyl...@gmail.com
> >
>
>
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>



-- 
Jan Ferko,
julyl...@gmail.com


how to add ImageAjaxLink into datatable???

2010-10-25 Thread jeikrak

hi, i want to inserto in my datatable an image like this:

private ImageAjaxLink mailImg;

mailImg = new ImageAjaxLink("mailImg", bean.isMail()));

now my table is:

columns.add(new PropertyColumn(new StringResourceModel("label.col5", this,
null), "col5"));

provider = new TotalConsPagoProveedoresProvider("col1", false);
table = new DefaultDataTable("table", columns, provider, Integer.valueOf(new 
StringResourceModel("rowsPerPage", this, null).getString())){

again, how can i add "mailImg" in "columns" of my table

tks!

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-add-ImageAjaxLink-into-datatable-tp3011459p3011459.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: Real world Wicket Reference projects?

2010-10-25 Thread Alexander Morozov

Check the Wiki

https://cwiki.apache.org/WICKET/products-based-on-wicket.html
https://cwiki.apache.org/WICKET/websites-based-on-wicket.html

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Real-world-Wicket-Reference-projects-tp3010502p3010614.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: Fwd: Nested CompoundModel

2010-10-25 Thread Jeremy Thomerson
What part is dynamic / dependent on the form?

On Sun, Oct 24, 2010 at 3:59 PM, Jan Ferko  wrote:

> Thanks a lot, it worked great.
>
> I have one more question. I have to create same panel multiple times ,
> based
> on user output into the form and i have list of panel data model object
> inside my form data object. Is it better to generate panels in page class
> and then passed list of panels into form constructor and use ListView or
> generate it inside form with RepeatingView and create new instance of
> PanelData in Cycle and setting it on Panel and saving it to list like
> this...
>
> RepeatingView rp = new RepeatingView();
> for(int i =0; i< n; i++){
>   WebMarkupContainer parent = new WebMarkupContainer(rp.newChildID());
>
> }
>
> 2010/10/22 Jeremy Thomerson 
>
> > On Fri, Oct 22, 2010 at 11:38 AM, Sven Meier  wrote:
> >
> > > Hi Jan,
> > >
> > > when are data2 and data3 initialized? They seems to be null when you
> put
> > up
> > > your models.
> > >
> > > Most of the time it's a bad idea to pull something out of a model and
> put
> > > it back into another model.
> > > Do this instead:
> > >
> > >this.add(new MyPanel(id2, new PropertyModel(model, "data2")));
> > >
> > > Then in MyPanel:
> > >
> > >public MyPanel(id, model){
> > > super(id, new CompoundPropertyModel(model));
> > >
> > > This has the following advantages:
> > > - MyPanel's model is always in sync with the model of MyForm.
> > > - MyPanel's usage of CompoundPropertyModel is hidden from the outside.
> If
> > > MyPanel want's to utilize a CompoundPropertyModel (because it doesn't
> set
> > > the model on its contained components), it should set it up by itself.
> > >
> > > HTH
> > >
> > > Sven
> >
> >
> > Sven is spot-on, and this method he showed you above will absolutely save
> > you some bugs down the road!
> >
> > Thanks Sven!!
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>
>
>
> --
> Jan Ferko,
> julyl...@gmail.com
>



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


RE: Wicket Merchandise store back in action

2010-10-25 Thread John Owen
Awesome!

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Friday, October 22, 2010 12:52 PM
To: users@wicket.apache.org
Subject: Re: Wicket Merchandise store back in action

done and say if its ok

2010/10/22 nino martinez wael 

> and great idea :)
>
> 2010/10/22 nino martinez wael 
>
> ok i'll look into it..
>>
>> 2010/10/21 Jeremy Thomerson 
>>
>> Nino,
>>>
>>>  I want a Wicket sticker that I can stick on the back of my laptop
>>> display!
>>>
>>>
>>> On Mon, Oct 13, 2008 at 7:31 AM, Nino Saturnino Martinez Vazquez Wael <
>>> nino.marti...@jayway.dk> wrote:
>>>
>>> > Hi Guys
>>> >
>>> > The store are open again, now with permission from Apache. And yes the
>>> BIB
>>> > are back:) Please say if there are missing some products or something..
>>> >
>>> > Knock yourself out:
>>> > http://www.cafepress.com/apachewicket
>>> >
>>> > --
>>> > -Wicket for love
>>> >
>>> > Nino Martinez Wael
>>> > Java Specialist @ Jayway DK
>>> > http://www.jayway.dk
>>> > +45 2936 7684
>>> >
>>> >
>>> > -
>>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> > For additional commands, e-mail: users-h...@wicket.apache.org
>>> >
>>> >
>>>
>>>
>>> --
>>> Jeremy Thomerson
>>> http://wickettraining.com
>>> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>>>
>>
>>
>

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



Re: SSL Links and buttons

2010-10-25 Thread Ernesto Reinaldo Barreiro
Hi,

I'm also interested on solving this as I will need to implement a
similar use case in a coming application. The main problem I see in
solving it is that on

protected IRequestTarget checkSecureOutgoing(IRequestTarget target) {

}

even if you check for ListenerInterfaceRequestTarget  and your Secure form e.g.

if (target instanceof IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget 
interfaceRequestTarget =
(IListenerInterfaceRequestTarget) target;
Component c = 
interfaceRequestTarget.getTarget();

if(SecureForm.class.isAssignableFrom(c.getClass())) {
SecureForm secureForm = 
(SecureForm)c;
if(secureForm.hasError()) {
return target;
}
}
}

, to return the same target when you have validation errors,
ListenerInterfaceRequestTarget seem to be using logic from
PageRequestTarget

public void respond(RequestCycle requestCycle)
{
// Should page be redirected to?
if (requestCycle.isRedirect())
{
// Redirect to the page
requestCycle.redirectTo(page);
}
else
{
// Let page render itself
page.renderPage();
}
}

to redirect to a "new" version of the page and as the request arrives
over HTTPS then you get redirected to the page, showing validation
errors, but over "https". I don't see yet how to switch it to HTTP.

Regards,

Ernesto


On Mon, Oct 25, 2010 at 8:58 AM, sonxurxo  wrote:
>
> Hi all.
> I've been dealing with this and I don't have a working solution yet. The
> problem that my previously posted solution had is that when the form
> validation fails, it falls into an infinite redirect loop.
> Playing with my custom HttpsRequestCycleProcessor all I have achieved is to
> make it redirect to the right page, but "in its HTTPS version", when it
> should be HTTP (remember, HTTPS form embedded in a HTTP page). Or if I point
> my custom HttpsRequestCycleProcessor to redirect it to the HTTP version, it
> falls in that infinite redirect cycle or it loose the form data.
> Any hint? Any idea? How could I override checkSecureIncoming and
> checkSecureOutgoing methods to be aware of those situations? Thank you in
> advance
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/SSL-Links-and-buttons-tp3001634p3009814.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



Wicket frontend and Restlet backend

2010-10-25 Thread Daniele Dellafiore
Hi.

I have recently used restlet and found it great. Expecially, the REST
approach helps you creating a more well crafted web application.
Now I like to use wicket for the frontend and I wondered how to mix
the two stuff: I wanted to keep the REST API and I'd like the web
client uses the exact same backend.

That is, instead of injecting a service in the web client that
direcyly access the JPA backend, I injected a  client based on
Restlet.
So I make an HTTP call to the backend to persist, read and search the data.

What do you think about such approach? Do you foresee any limitations?

I like it a lot:

Clean separation of responsability: you tend to do stuff better, cause
you firsst think at the REST API for a task, then the web frontend
follow in a natural
I have an app with a REST API that's the same I use "internally".
The client starts/stop/restart real faster as long as it is not
connected to any spring/jpa/database connection. It's just wicket.
Mocking is easy for unit testing.
I can develop a second frontend based on the exact same backend
instance, for mobile, new web prototype, another mashup.

What I did not try yet is to make both server and web frontend run on
the same OSGI server.
Any advice on running wicket on a Felix/Karaf instance?

-- 
Daniele Dellafiore
http://danieledellafiore.net

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



Re: WiQuery Dialog when used with Ajax

2010-10-25 Thread Ernesto Reinaldo Barreiro
David?

Answers inlined

>
> Is it possible with WiQuery to add jQuery code which is to be run before the
> dialog opens, and to use the return value from this code to determine
> whether or not the dialog opens at all? I have such code working already
> with plain javascript, it runs when an AjaxLink is clicked. I would like to
> get this working with WiQuery so as to use the look and feel of the dialog.
> The alternative presumably is to extend one of the jQuery dialog plugins.
>

Why not keep this state on the page or panel at server side? and then
use AJAX round trip to check that condition. You could
still use your decorator (I guess) with Dialog (ask you link is still
an AJAX link after all).

> Running the javascript first enables me to bring up a confirmation dialog if
> a link is clicked when a wizard is in progress. The wizard creates a hidden
> field in a panel, and the javascript can check for the existence and style
> of this field to determine if the user is in the middle of a wizard. This is
> better than storing a flag in the session, as the back-button could cause
> the Wicket session and the page dispalyed to get out of synch.
>

Not quite following you here. If wizard is in progress why not have a
flag on server side and again use AJAX to get back to the server  and
do logic you need whatever you need there. You don't need to store
things in the directly session to have state .

Ernesto

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



Re: WiQuery Dialog when used with Ajax

2010-10-25 Thread drf

Ernesto , thank you very much, this is great. It should not be too difficult
to change the content (in your example, a Label) to a Panel with buttons for
ok, cancel etc. 

Is it possible with WiQuery to add jQuery code which is to be run before the
dialog opens, and to use the return value from this code to determine
whether or not the dialog opens at all? I have such code working already
with plain javascript, it runs when an AjaxLink is clicked. I would like to
get this working with WiQuery so as to use the look and feel of the dialog.
The alternative presumably is to extend one of the jQuery dialog plugins.

Running the javascript first enables me to bring up a confirmation dialog if
a link is clicked when a wizard is in progress. The wizard creates a hidden
field in a panel, and the javascript can check for the existence and style
of this field to determine if the user is in the middle of a wizard. This is
better than storing a flag in the session, as the back-button could cause
the Wicket session and the page dispalyed to get out of synch.

Here is the code I have now:

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
  return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()) { 
 private static final long serialVersionUID = 1L; 

 @Override 
 public CharSequence preDecorateScript(CharSequence script) { 
String leaveWizardConfirmationMessage = new ResourceModel
(WIZARD_CANCEL_CONFIRMATION_MESSAGE_TEXT_RESOURCE).getObject();
 
String javascript = "if
(document.getElementById('"+WIZARD_CANCEL_CONFIRMATION_HIDDEN_FIELD_NAME+"')
"+
   "&&
document.getElementById('"+WIZARD_CANCEL_CONFIRMATION_HIDDEN_FIELD_NAME+"').style.display!='none')"+
   " {if (!confirm('"+leaveWizardConfirmationMessage+"')) return 
false;}";
return javascript  + script;
 } 
   };
}



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WiQuery-Dialog-when-used-with-Ajax-tp3009441p3009910.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: back-button causes Wicket state and page displayed to be out of synch

2010-10-25 Thread Daniel Stoch
Hi,

On Fri, Oct 22, 2010 at 12:53 PM, drf  wrote:
>
> I have encountered the following serious issue:
>
> My application consists of one WebPage which has an AjaxTabbedPanel. Each
> tab has an associated panel which includes several menu items (links) which
> can be selected. This works well.
> However, if the user selects the back-button (once back, then once forward)
> they can come back to the page with a different tab displayed than the one
> selected before the back-button was used. If a menu link is then clicked on,
> an exception is thrown. This appears to be because the Wicket on the server
> is now out of synch with the html displayed. Wicket thinks a different panel
> is selected than the one the user sees now.

Turn off page caching in a browser for ajax pages.

--
DS

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