You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vladimir Kovalyuk <ko...@gmail.com> on 2009/06/25 17:00:28 UTC

How to turn ModalWindow form into multipart form?

How to turn ModalWindow form into multipart form?
The problem is that the markup code for that particular form is hard-coded
into modal.js script (surprise!, surprise!).

ModalWindow form submission problems han't been fixed yet, I mean rc5

Re: How to turn ModalWindow form into multipart form?

Posted by Matej Knopp <ma...@gmail.com>.
If you use modal window with form you have to submit the form using
AjaxButton - which rules out multipart form. Also when you have form
in ModalWindow the window itself should be placed in Wicket Form.
(forms can be nested) - which is stated in javascript.

-Matej

On Fri, Jun 26, 2009 at 10:49 AM, Vladimir K<ko...@gmail.com> wrote:
>
> yes it do has.
>
> near line 1095 of modal.js:
>
> Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption,
> idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft,
> idBottomRight, idBottom, idCaptionText, isFrame) {
>        var s =
>                        "<div class=\"wicket-modal\" id=\""+idWindow+"\" style=\"top: 10px; left:
> 10px; width: 100px;\"><form
> style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
>                        "<div id=\""+idClassElement+"\">"+
>
> And it seems hacky and buggy.
>
> In our case we would use regular submit for FileUploadField instead of ajax
> if it wasn't hardcoded. Now we need to hack ModalWindow some way. I don't
> like iframe approach 'cause it forces user to submit twice at the time when
> regular submit should have worked.
>
> If you don't know this very hardcoded form leads to problem reflecting
> request parameters to form components models because in java we have a stack
> of forms and submit request contains just data of this particular form. As
> the result form components of enclosing forms receive empty data and then
> ... at least unexpected validation problems.
> There has been a jira issue already that contains workaround description. I
> have to go right now. I'll find it later.
>
>
> igor.vaynberg wrote:
>>
>> modalwindow has a hardcoded form?
>>
>>
>> On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<ko...@gmail.com>
>> wrote:
>>> How to turn ModalWindow form into multipart form?
>>> The problem is that the markup code for that particular form is
>>> hard-coded
>>> into modal.js script (surprise!, surprise!).
>>>
>>> ModalWindow form submission problems han't been fixed yet, I mean rc5
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24216939.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to turn ModalWindow form into multipart form?

Posted by Eyal Golan <eg...@gmail.com>.
Vladimir,
no. We didn't patched wicket.jar.
We have overridden ModalWindow:
Say you call it AbstractCustomModalWindow
I force the user to use it with Page:
        setPageCreator(new ModalWindow.PageCreator() {
            private static final long serialVersionUID = 1L;

            public Page createPage() {
                return getModalWebPage();
            }
        });
and
protected abstract WebPage getModalWebPage();
I also did:
private static final String JAVASCRIPT = "/myCompany/js/modal.js";
and: add(HeaderContributor.forJavaScript(JAVASCRIPT));

and in the modal.js we overridden 'Wicket.Window.getMarkup' to build our own
stylish markup ...

Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Tue, Jun 30, 2009 at 5:43 PM, Vladimir K <ko...@gmail.com> wrote:

>
> Eyal,
>
> did you mean you have patched wicket.jar with modal.js on your own? I'm
> going to omit patching wicket.jar.
>
> We'll replace ModalWindow with regular page for a while. I don't understand
> why ModalWindow hasn't been implemented with regular wicket ajax engine. It
> would be easier to fix something.
>
> Matej,
>
> are you going to fix ModalWindow somehow to be capable of taking
> FileUploadField and UploadProgressBar components?
>
>
> egolan74 wrote:
> >
> > we overridden modal.js and changed the appearance of the modal window
> >
> > Eyal Golan
> > egolan74@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> > necessary
> >
> >
> > On Fri, Jun 26, 2009 at 11:49 AM, Vladimir K <ko...@gmail.com> wrote:
> >
> >>
> >> yes it do has.
> >>
> >> near line 1095 of modal.js:
> >>
> >> Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption,
> >> idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft,
> >> idBottomRight, idBottom, idCaptionText, isFrame) {
> >>        var s =
> >>                        "<div class=\"wicket-modal\" id=\""+idWindow+"\"
> >> style=\"top: 10px; left:
> >> 10px; width: 100px;\"><form
> >>
> >>
> style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
> >>                        "<div id=\""+idClassElement+"\">"+
> >>
> >> And it seems hacky and buggy.
> >>
> >> In our case we would use regular submit for FileUploadField instead of
> >> ajax
> >> if it wasn't hardcoded. Now we need to hack ModalWindow some way. I
> don't
> >> like iframe approach 'cause it forces user to submit twice at the time
> >> when
> >> regular submit should have worked.
> >>
> >> If you don't know this very hardcoded form leads to problem reflecting
> >> request parameters to form components models because in java we have a
> >> stack
> >> of forms and submit request contains just data of this particular form.
> >> As
> >> the result form components of enclosing forms receive empty data and
> then
> >> ... at least unexpected validation problems.
> >> There has been a jira issue already that contains workaround
> description.
> >> I
> >> have to go right now. I'll find it later.
> >>
> >>
> >> igor.vaynberg wrote:
> >> >
> >> > modalwindow has a hardcoded form?
> >> >
> >> >
> >> > On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<kovalyuk@gmail.com
> >
> >> > wrote:
> >> >> How to turn ModalWindow form into multipart form?
> >> >> The problem is that the markup code for that particular form is
> >> >> hard-coded
> >> >> into modal.js script (surprise!, surprise!).
> >> >>
> >> >> ModalWindow form submission problems han't been fixed yet, I mean rc5
> >> >>
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24216939.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > -----
> > Eyal Golan
> > egolan74@gmail.com
> >
> > Visit: JVDrums
> > LinkedIn: LinkedIn
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24273227.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to turn ModalWindow form into multipart form?

Posted by Vladimir K <ko...@gmail.com>.
Eyal,

did you mean you have patched wicket.jar with modal.js on your own? I'm
going to omit patching wicket.jar.

We'll replace ModalWindow with regular page for a while. I don't understand
why ModalWindow hasn't been implemented with regular wicket ajax engine. It
would be easier to fix something.

Matej,

are you going to fix ModalWindow somehow to be capable of taking
FileUploadField and UploadProgressBar components?


egolan74 wrote:
> 
> we overridden modal.js and changed the appearance of the modal window
> 
> Eyal Golan
> egolan74@gmail.com
> 
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
> 
> P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> 
> 
> On Fri, Jun 26, 2009 at 11:49 AM, Vladimir K <ko...@gmail.com> wrote:
> 
>>
>> yes it do has.
>>
>> near line 1095 of modal.js:
>>
>> Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption,
>> idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft,
>> idBottomRight, idBottom, idCaptionText, isFrame) {
>>        var s =
>>                        "<div class=\"wicket-modal\" id=\""+idWindow+"\"
>> style=\"top: 10px; left:
>> 10px; width: 100px;\"><form
>>
>> style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
>>                        "<div id=\""+idClassElement+"\">"+
>>
>> And it seems hacky and buggy.
>>
>> In our case we would use regular submit for FileUploadField instead of
>> ajax
>> if it wasn't hardcoded. Now we need to hack ModalWindow some way. I don't
>> like iframe approach 'cause it forces user to submit twice at the time
>> when
>> regular submit should have worked.
>>
>> If you don't know this very hardcoded form leads to problem reflecting
>> request parameters to form components models because in java we have a
>> stack
>> of forms and submit request contains just data of this particular form.
>> As
>> the result form components of enclosing forms receive empty data and then
>> ... at least unexpected validation problems.
>> There has been a jira issue already that contains workaround description.
>> I
>> have to go right now. I'll find it later.
>>
>>
>> igor.vaynberg wrote:
>> >
>> > modalwindow has a hardcoded form?
>> >
>> >
>> > On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<ko...@gmail.com>
>> > wrote:
>> >> How to turn ModalWindow form into multipart form?
>> >> The problem is that the markup code for that particular form is
>> >> hard-coded
>> >> into modal.js script (surprise!, surprise!).
>> >>
>> >> ModalWindow form submission problems han't been fixed yet, I mean rc5
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24216939.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 
> -----
> Eyal Golan
> egolan74@gmail.com
> 
> Visit: JVDrums 
> LinkedIn: LinkedIn 
> 

-- 
View this message in context: http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24273227.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to turn ModalWindow form into multipart form?

Posted by Eyal Golan <eg...@gmail.com>.
we overridden modal.js and changed the appearance of the modal window

Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Fri, Jun 26, 2009 at 11:49 AM, Vladimir K <ko...@gmail.com> wrote:

>
> yes it do has.
>
> near line 1095 of modal.js:
>
> Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption,
> idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft,
> idBottomRight, idBottom, idCaptionText, isFrame) {
>        var s =
>                        "<div class=\"wicket-modal\" id=\""+idWindow+"\"
> style=\"top: 10px; left:
> 10px; width: 100px;\"><form
>
> style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
>                        "<div id=\""+idClassElement+"\">"+
>
> And it seems hacky and buggy.
>
> In our case we would use regular submit for FileUploadField instead of ajax
> if it wasn't hardcoded. Now we need to hack ModalWindow some way. I don't
> like iframe approach 'cause it forces user to submit twice at the time when
> regular submit should have worked.
>
> If you don't know this very hardcoded form leads to problem reflecting
> request parameters to form components models because in java we have a
> stack
> of forms and submit request contains just data of this particular form. As
> the result form components of enclosing forms receive empty data and then
> ... at least unexpected validation problems.
> There has been a jira issue already that contains workaround description. I
> have to go right now. I'll find it later.
>
>
> igor.vaynberg wrote:
> >
> > modalwindow has a hardcoded form?
> >
> >
> > On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<ko...@gmail.com>
> > wrote:
> >> How to turn ModalWindow form into multipart form?
> >> The problem is that the markup code for that particular form is
> >> hard-coded
> >> into modal.js script (surprise!, surprise!).
> >>
> >> ModalWindow form submission problems han't been fixed yet, I mean rc5
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24216939.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to turn ModalWindow form into multipart form?

Posted by Vladimir K <ko...@gmail.com>.
yes it do has.

near line 1095 of modal.js:

Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption,
idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft,
idBottomRight, idBottom, idCaptionText, isFrame) {
	var s =
			"<div class=\"wicket-modal\" id=\""+idWindow+"\" style=\"top: 10px; left:
10px; width: 100px;\"><form
style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
			"<div id=\""+idClassElement+"\">"+

And it seems hacky and buggy.

In our case we would use regular submit for FileUploadField instead of ajax
if it wasn't hardcoded. Now we need to hack ModalWindow some way. I don't
like iframe approach 'cause it forces user to submit twice and regular
submit should have worked.

If you don't know this very hardcoded form leads to problem reflecting
request parameters to form components models because in java we have a stack
of forms and submit request contains just data of this particular form. As
the result form components of enclosing forms receive empty data and then
... at least unexpected validation problems.
There has been a jira issue already that contains workaround description. I
have to go right now. I'll find it later.


igor.vaynberg wrote:
> 
> modalwindow has a hardcoded form?
> 
> 
> On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<ko...@gmail.com>
> wrote:
>> How to turn ModalWindow form into multipart form?
>> The problem is that the markup code for that particular form is
>> hard-coded
>> into modal.js script (surprise!, surprise!).
>>
>> ModalWindow form submission problems han't been fixed yet, I mean rc5
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-turn-ModalWindow-form-into-multipart-form--tp24204896p24216939.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to turn ModalWindow form into multipart form?

Posted by Igor Vaynberg <ig...@gmail.com>.
modalwindow has a hardcoded form?


On Thu, Jun 25, 2009 at 8:00 AM, Vladimir Kovalyuk<ko...@gmail.com> wrote:
> How to turn ModalWindow form into multipart form?
> The problem is that the markup code for that particular form is hard-coded
> into modal.js script (surprise!, surprise!).
>
> ModalWindow form submission problems han't been fixed yet, I mean rc5
>

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