Re: Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Pedro Santos
On Sat, Mar 19, 2011 at 10:00 PM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> You mean?
>
> Markup, main panel:
>
> 
>  
> 
>
>
the markup will look like:


 



  


OK, but why does it work with Internet Explorer 7.  Strange.
>

If you add a root form component inside the modal window the generated
markup will have 2 nested form tags which is illegal. Each browser have its
own tolerance for illegal HTML


>
> -Original Message-
> From: Pedro Santos [mailto:pedros...@gmail.com]
> Sent: Saturday, March 19, 2011 8:02 PM
> To: users@wicket.apache.org
> Subject: Re: Ajax modal window does not allow submit form under open
> browsers
>
> To submit a form inside a modal window you must enclose it by a form in
> the main panel and use an AJAX submit component. Please open a ticket +
> quickstart if the issue remains.
>
> On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
> berlin.br...@primerica.com> wrote:
>
> > When I use the ajax modal window and under Firefox/Chrome/Safari, the
> > ajax form submit does not happen.  When I open the ajax debug window,
> > it looks like a request is made.
> >
> > Has anyone had issues with modal windows, form submission and firefox?
> >
> > Internet Explorer 7 works fine.
> >
> > Version of Wicket: 1.4.13
> >
> > Here is the error in the debug window:
> >
> > RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> > 'calloutForm449' that is not in document.
> > ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> > 'calloutForm449' that is not in
> >
> > Pseduo Code:
> >
> > import
> > org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> > ...
> >
> >
> > final ModalWindow modalWindow = new ModalWindow( "modalWindow"); final
>
> > Panel basicPanel = new BasicPanel( modalWindow.getContentId());
> >
> > modalWindow.setInitialWidth( 600 );
> > mainPanel.add(modalWindow);
> > modalWindow.setContent(basicPanel);
> >
> >
> > ...
> >
> > public class BasicPanel extends Panel {
> >
> >  public BasicPanel(final String id) {
> >...
> >final Form form = new Form("calloutForm");
> >add(form);
> >  }
> > }
> >
> > ** Panel for Modal Window Markup:
> >
> > 
> >  ...
> > 
> >
> >
> > ** Output from ajax debug window.
> >
> > The form looks like it is available.
> >
> >   > id="calloutForm4d8" method="post"
> > action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel
> > :m odalWindow:content:calloutForm::IFormSubmitListener::" > > style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;o
> > ve rflow:hidden"> > id="calloutForm4d8_hf_0" />
> >  
> > > class="content_panel_table">
> > 
> >  ...
> >  
> > 
> > 
> >
> >
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
> -
> 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: Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Brown, Berlin [GCG-PFS]
You mean?

Markup, main panel:


  
 

OK, but why does it work with Internet Explorer 7.  Strange.

-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Saturday, March 19, 2011 8:02 PM
To: users@wicket.apache.org
Subject: Re: Ajax modal window does not allow submit form under open
browsers

To submit a form inside a modal window you must enclose it by a form in
the main panel and use an AJAX submit component. Please open a ticket +
quickstart if the issue remains.

On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> When I use the ajax modal window and under Firefox/Chrome/Safari, the 
> ajax form submit does not happen.  When I open the ajax debug window, 
> it looks like a request is made.
>
> Has anyone had issues with modal windows, form submission and firefox?
>
> Internet Explorer 7 works fine.
>
> Version of Wicket: 1.4.13
>
> Here is the error in the debug window:
>
> RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id 
> 'calloutForm449' that is not in document.
> ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id 
> 'calloutForm449' that is not in
>
> Pseduo Code:
>
> import 
> org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> ...
>
>
> final ModalWindow modalWindow = new ModalWindow( "modalWindow"); final

> Panel basicPanel = new BasicPanel( modalWindow.getContentId());
>
> modalWindow.setInitialWidth( 600 );
> mainPanel.add(modalWindow);
> modalWindow.setContent(basicPanel);
>
>
> ...
>
> public class BasicPanel extends Panel {
>
>  public BasicPanel(final String id) {
>...
>final Form form = new Form("calloutForm");
>add(form);
>  }
> }
>
> ** Panel for Modal Window Markup:
>
> 
>  ...
> 
>
>
> ** Output from ajax debug window.
>
> The form looks like it is available.
>
>   id="calloutForm4d8" method="post"
> action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel
> :m odalWindow:content:calloutForm::IFormSubmitListener::" > style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;o
> ve rflow:hidden"> id="calloutForm4d8_hf_0" />
>  
> class="content_panel_table">
> 
>  ...
>  
> 
> 
>
>
>
>


--
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: Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Pedro Santos
To submit a form inside a modal window you must enclose it by a form in the
main panel and use an AJAX submit component. Please open a ticket +
quickstart if the issue remains.

On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> When I use the ajax modal window and under Firefox/Chrome/Safari, the
> ajax form submit does not happen.  When I open the ajax debug window, it
> looks like a request is made.
>
> Has anyone had issues with modal windows, form submission and firefox?
>
> Internet Explorer 7 works fine.
>
> Version of Wicket: 1.4.13
>
> Here is the error in the debug window:
>
> RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> 'calloutForm449' that is not in document.
> ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> 'calloutForm449' that is not in
>
> Pseduo Code:
>
> import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> ...
>
>
> final ModalWindow modalWindow = new ModalWindow( "modalWindow");
> final Panel basicPanel = new BasicPanel( modalWindow.getContentId());
>
> modalWindow.setInitialWidth( 600 );
> mainPanel.add(modalWindow);
> modalWindow.setContent(basicPanel);
>
>
> ...
>
> public class BasicPanel extends Panel {
>
>  public BasicPanel(final String id) {
>...
>final Form form = new Form("calloutForm");
>add(form);
>  }
> }
>
> ** Panel for Modal Window Markup:
>
> 
>  ...
> 
>
>
> ** Output from ajax debug window.
>
> The form looks like it is available.
>
> 
>  action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel:m
> odalWindow:content:calloutForm::IFormSubmitListener::" > style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;ove
> rflow:hidden"> id="calloutForm4d8_hf_0" />
>  
> class="content_panel_table">
> 
>  ...
>  
> 
> 
>
>
>
>


-- 
Pedro Henrique Oliveira dos Santos


Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Brown, Berlin [GCG-PFS]
When I use the ajax modal window and under Firefox/Chrome/Safari, the
ajax form submit does not happen.  When I open the ajax debug window, it
looks like a request is made.
 
Has anyone had issues with modal windows, form submission and firefox?
 
Internet Explorer 7 works fine.
 
Version of Wicket: 1.4.13
 
Here is the error in the debug window:
 
RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
'calloutForm449' that is not in document.
ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
'calloutForm449' that is not in 
 
Pseduo Code:
 
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
...
 

final ModalWindow modalWindow = new ModalWindow( "modalWindow");
final Panel basicPanel = new BasicPanel( modalWindow.getContentId());
 
modalWindow.setInitialWidth( 600 );
mainPanel.add(modalWindow);
modalWindow.setContent(basicPanel);
 

...
 
public class BasicPanel extends Panel {
 
  public BasicPanel(final String id) {
...
final Form form = new Form("calloutForm");
add(form);
  }
}

** Panel for Modal Window Markup:
 
 
  ...

 
 
** Output from ajax debug window.
 
The form looks like it is available.
 

   
 

 
 ...
 


 
 
 


Re: Edit page and LDM

2011-03-19 Thread fernandospr
Thanks again Martin. 
Now suppose that in the edit page I'm filling a form for a new object binded
through the LoadableDetachableModel (I mean no id was passed to the page
constructor so LoadableDetachableModel returned a new instance). 
Now before I hit save suppose I need to add another object to the first one
by filling another form in another page. 

I guess in this situation I should pass the LoadableDetachableModel to the
second Page through the constructor, create another LoadableDetachableModel
for the second object, bind it to the form, fill it, associate the second
object with the first one and finally return to the first page passing the
first LoadableDetachModel. 

Right?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390347.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: Edit page and LDM

2011-03-19 Thread Martin Grigorov
On Sat, Mar 19, 2011 at 8:15 PM, fernandospr  wrote:

> Thanks Martin, and what about passing directly the domain object to the
> constructor?
>
> Unless you save it as a member variable it is OK.
Just pass it to LDM's constructor and open yourself a beer ;-)


>  --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390135.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Wicket, GAE and Sessions

2011-03-19 Thread Martin Grigorov
Hi Per,

Did you solve your problems with HttpSessionDataStore ?
Recently I looked more in this area and I'm almost convinced that its
#isReplicated() should return false.
Just need a reason to change it, like ticket in our Jira from someone who
actually uses this data store.

My current understanding is that IDataStore#isReplicated() should return
true if the replication is made by itself.
In the case of HttpSessionDataStore the replication is done by the web
container so it should return false.


On Sat, Mar 19, 2011 at 8:06 PM, Per  wrote:

> Chris,
>
> glad to see you solved it. If you run into more complex situations later
> on,
> where your nesting gets deep and not as easy to spot, then I recommend
> using
> a Java profiler. I used it a lot to optimize session size (also for GAE),
> but it also helps to find indirect references to objects on your local box
> which may be hard to spot in a stacktrace from the server.
>
> Enjoy the ride, GAE plus Wicket is pretty awesome! At least in most cases
> :-)
> Per
>
> http://www.small-improvements.com
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-GAE-and-Sessions-tp3387297p3390125.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Edit page and LDM

2011-03-19 Thread fernandospr
Thanks Martin, and what about passing directly the domain object to the
constructor?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390135.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: Wicket, GAE and Sessions

2011-03-19 Thread Per
Chris,

glad to see you solved it. If you run into more complex situations later on,
where your nesting gets deep and not as easy to spot, then I recommend using
a Java profiler. I used it a lot to optimize session size (also for GAE),
but it also helps to find indirect references to objects on your local box
which may be hard to spot in a stacktrace from the server. 

Enjoy the ride, GAE plus Wicket is pretty awesome! At least in most cases
:-)
Per

http://www.small-improvements.com


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-GAE-and-Sessions-tp3387297p3390125.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: Edit page and LDM

2011-03-19 Thread Martin Grigorov
On Sat, Mar 19, 2011 at 3:44 PM, fernandospr  wrote:

> Hi,
>
> I need to build an edit page.
>
> I saw:
> https://cwiki.apache.org/WICKET/using-detachable-models-in-edit-pages.html
> and
> http://www.theserverside.com/news/1363828/Introducing-Apache-Wicket (Edit
> Contact part)
>
> But I guess they are no longer valid as the setModel method does not exist
> anymore. How is this done now?
>
the new name is setDefaultModel()

>
> Also, I've seen it's possible to pass an id or a model to the edit page
> constructor, not sure which is the best approach.
>
Both are fine. Just try to keep it as lightweight as possible. I.e. don't
keep references to heavy objects.

>
> Thanks.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3389748.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Wicket 1.5 setRedirect(true) flag

2011-03-19 Thread Martin Grigorov
There is no need of setRedirect(true) anymore.
Wicket will see that the new page has different url than the current one and
will redirect automatically.


On Sat, Mar 19, 2011 at 2:09 PM, Vytautas  wrote:

> Hey guys,
>simple question about page redirecting in wicket 1.5:
>
>how should i implement such scenario:
>
>@Override
>protected void onInitialize() {
>1. if (parameters are empty) {
>2.  setResponsePage(page to redirect);
>//1.4 version: setRedirect(true);
>return;
>}
>3. get parameters and go further
>super.onInitialize();
>}
>
>I would like to redirect to a correct page if parameters are not
> provided and do not proceed with markup for current panel/page
>Currently it seems wicket tries to render panel.
>
>Wicket version: 1.5-rc2
>
> Regards,
> Vytautas
> ---
> www.xaloon.org
> www.allcarindex.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Caching Streamed Images on browser

2011-03-19 Thread Pedro Santos
Browser respect cache control headers of the HTTP response, u can set your
caching rules there.

On Sat, Mar 19, 2011 at 5:39 AM, Arjun Dhar  wrote:

> Hi,
>  I have a resource (an Image which exists on the File System outside the
> Web
> Context).
> I stream the image resource. The problem really is that while the speed to
> download an image within web-context and outside is the same  the one
> within Web-Context is always cached by the browser.
>
> Am not sure this is a pure wicket question, but anyone know the rules for
> browser caching images? As long as the "src" link is the same and
> independent of session why would the browser not cache it?
>
> I also created a simple DownloadServlet and same result. URL -->
> "/DownloadServlet?file=abc".
>
>
> -
> Don't take life too seriously, your'e not getting out it alive anyway!
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Caching-Streamed-Images-on-browser-tp3389269p3389269.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


Handling first AJAX request when cookies are disabled

2011-03-19 Thread Don Ferguson
I'm struggling with a problem that probably has an easy solution.  When cookies 
are disabled, if the first action on viewing the site is an AJAX request, it 
fails because the jsessionid hasn't been written into the URL.  I notice that 
on other sites (such as wicketstuff), this doesn't happen because the first 
request gets a "302" (Temporarily Moved) to a URL that includes the jsessionid. 
 Is this being done by the servlet container (I'm using Jetty), or is it 
handled elsewhere in the stack?

One workaround to this problem is to setGatherExtenededBrowserInfo(true), but 
that results in the temporary display of an error page, which freaked out my 
boss.

Any ideas how to best handle this?  Thanks, and sorry if this has been 
discussed before.  I searched in vain.

-Don


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



Edit page and LDM

2011-03-19 Thread fernandospr
Hi,

I need to build an edit page.

I saw:
https://cwiki.apache.org/WICKET/using-detachable-models-in-edit-pages.html
and
http://www.theserverside.com/news/1363828/Introducing-Apache-Wicket (Edit
Contact part)

But I guess they are no longer valid as the setModel method does not exist
anymore. How is this done now?

Also, I've seen it's possible to pass an id or a model to the edit page
constructor, not sure which is the best approach.

Thanks.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3389748.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



Wicket 1.5 setRedirect(true) flag

2011-03-19 Thread Vytautas

Hey guys,
simple question about page redirecting in wicket 1.5:

how should i implement such scenario:

@Override
protected void onInitialize() {
1. if (parameters are empty) {
2.  setResponsePage(page to redirect);
//1.4 version: setRedirect(true);
return;
}
3. get parameters and go further
super.onInitialize();
}

I would like to redirect to a correct page if parameters are not 
provided and do not proceed with markup for current panel/page
Currently it seems wicket tries to render panel.

Wicket version: 1.5-rc2

Regards,
Vytautas
---
www.xaloon.org
www.allcarindex.com

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



Caching Streamed Images on browser

2011-03-19 Thread Arjun Dhar
Hi,
 I have a resource (an Image which exists on the File System outside the Web
Context).
I stream the image resource. The problem really is that while the speed to
download an image within web-context and outside is the same  the one
within Web-Context is always cached by the browser.

Am not sure this is a pure wicket question, but anyone know the rules for
browser caching images? As long as the "src" link is the same and
independent of session why would the browser not cache it?

I also created a simple DownloadServlet and same result. URL -->
"/DownloadServlet?file=abc".


-
Don't take life too seriously, your'e not getting out it alive anyway!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Caching-Streamed-Images-on-browser-tp3389269p3389269.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