You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2004/05/11 22:58:16 UTC

[woody/cforms] submit a form to a new window

Hello,

this time I have a question. Maybe someone had it too and solved it.

I have a form with a repeater widget. Each item shall have a 
link/button, which opens a PDF in a new window. Of course I can build a 
link by passing all parameters of the PDF to the form (i.e. handle the 
document generation independent from woody/cforms), but I don't want 
this. If I have a server side form model I also want to use this for 
this type of tasks. So I have a submit widget named 'displayDocument' 
for each item and on server side I decide which document to show.

Now it becomes difficult. I can hack JavaScript setting the form's 
target to _new and submit the form. The document is shown correctly in 
the new window, but the form in the old window is no longer usable: 
"page submitted twice". When looking into woody javascript the reason is 
obvious. An additional requirement would be to offer "save link target 
as", but this does not work with a javascript link hack. Any idea how to 
solve it?

Joerg

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


Re: [woody/cforms] submit a form to a new window

Posted by Joerg Heinicke <jo...@gmx.de>.
On 12.05.2004 21:06, JD Daniels wrote:

> You condused me :)

I feared that when writing the mail :)

> I have the same problem... calling the forms action in the new window wont
> stop the original window from being unaware the form has been called will
> it?

What does "calling the forms action in the new window" mean? Calling the 
form's @action URL? The original window does not know that another 
window called that URL. And if you submit the form in the original 
window it gets the old state as it has still the old continuation in the 
form's @action.

Better now?

Joerg

> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
> 
> Found it myself:
> Instead of hacking the document link with Javascript, that submits the
> form, etc., I set the correct link in the stylesheet: The URL is the
> same as the form's @action with an additional request parameter
> woody_submit_id set to the wi:action's @id. Additionally the link gets
> @target of course. So for the client it's just a link while for the
> server it is like a form submit. The form in the client still works, no
> "submitted twice" etc. And "save link target as" also works.
> 
> Joerg
> 
> On 11.05.2004 22:58, Joerg Heinicke wrote:
> 
> 
>>Hello,
>>
>>this time I have a question. Maybe someone had it too and solved it.
>>
>>I have a form with a repeater widget. Each item shall have a
>>link/button, which opens a PDF in a new window. Of course I can build a
>>link by passing all parameters of the PDF to the form (i.e. handle the
>>document generation independent from woody/cforms), but I don't want
>>this. If I have a server side form model I also want to use this for
>>this type of tasks. So I have a submit widget named 'displayDocument'
>>for each item and on server side I decide which document to show.
>>
>>Now it becomes difficult. I can hack JavaScript setting the form's
>>target to _new and submit the form. The document is shown correctly in
>>the new window, but the form in the old window is no longer usable:
>>"page submitted twice". When looking into woody javascript the reason is
>>obvious. An additional requirement would be to offer "save link target
>>as", but this does not work with a javascript link hack. Any idea how to
>>solve it?
>>
>>Joerg

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


RE: [woody/cforms] submit a form to a new window

Posted by JD Daniels <jd...@datatrio.com>.
You condused me :)

I have the same problem... calling the forms action in the new window wont
stop the original window from being unaware the form has been called will
it?

JD

-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
Sent: May 12, 2004 9:39 AM
To: users@cocoon.apache.org
Subject: Re: [woody/cforms] submit a form to a new window


Found it myself:
Instead of hacking the document link with Javascript, that submits the
form, etc., I set the correct link in the stylesheet: The URL is the
same as the form's @action with an additional request parameter
woody_submit_id set to the wi:action's @id. Additionally the link gets
@target of course. So for the client it's just a link while for the
server it is like a form submit. The form in the client still works, no
"submitted twice" etc. And "save link target as" also works.

Joerg

On 11.05.2004 22:58, Joerg Heinicke wrote:

> Hello,
>
> this time I have a question. Maybe someone had it too and solved it.
>
> I have a form with a repeater widget. Each item shall have a
> link/button, which opens a PDF in a new window. Of course I can build a
> link by passing all parameters of the PDF to the form (i.e. handle the
> document generation independent from woody/cforms), but I don't want
> this. If I have a server side form model I also want to use this for
> this type of tasks. So I have a submit widget named 'displayDocument'
> for each item and on server side I decide which document to show.
>
> Now it becomes difficult. I can hack JavaScript setting the form's
> target to _new and submit the form. The document is shown correctly in
> the new window, but the form in the old window is no longer usable:
> "page submitted twice". When looking into woody javascript the reason is
> obvious. An additional requirement would be to offer "save link target
> as", but this does not work with a javascript link hack. Any idea how to
> solve it?
>
> Joerg


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



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


Re: [woody/cforms] submit a form to a new window

Posted by Joerg Heinicke <jo...@gmx.de>.
Found it myself:
Instead of hacking the document link with Javascript, that submits the 
form, etc., I set the correct link in the stylesheet: The URL is the 
same as the form's @action with an additional request parameter 
woody_submit_id set to the wi:action's @id. Additionally the link gets 
@target of course. So for the client it's just a link while for the 
server it is like a form submit. The form in the client still works, no 
"submitted twice" etc. And "save link target as" also works.

Joerg

On 11.05.2004 22:58, Joerg Heinicke wrote:

> Hello,
> 
> this time I have a question. Maybe someone had it too and solved it.
> 
> I have a form with a repeater widget. Each item shall have a 
> link/button, which opens a PDF in a new window. Of course I can build a 
> link by passing all parameters of the PDF to the form (i.e. handle the 
> document generation independent from woody/cforms), but I don't want 
> this. If I have a server side form model I also want to use this for 
> this type of tasks. So I have a submit widget named 'displayDocument' 
> for each item and on server side I decide which document to show.
> 
> Now it becomes difficult. I can hack JavaScript setting the form's 
> target to _new and submit the form. The document is shown correctly in 
> the new window, but the form in the old window is no longer usable: 
> "page submitted twice". When looking into woody javascript the reason is 
> obvious. An additional requirement would be to offer "save link target 
> as", but this does not work with a javascript link hack. Any idea how to 
> solve it?
> 
> Joerg


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