You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by teacup <m_...@yahoo.com> on 2007/07/22 14:21:53 UTC

Popup New Window With A Button in Tapestry

Hello, members:

Mostly we use a Javascript to pop up a new window. I am writing a Tapestry
application, where I want to pop up a new Window (say popup.html). The
popup.html page will have its popup.page and popup.java too. The parent page
(say parent.html) has a form where user enters a string in a text field (or
checks on several check boxes) and then hit a button (say Submit). This
button will pop up a new window popup.html, but the problem is I want to
pass the string value (or check box values) from the form to popup.java so
that this class sets up a certain variable (say list) for later use - e.g.
when user enters some more data on popup.html and hit another button (say
again Submit) then a listener method in popup.java will take all values from
popup.html form and then use 'list' for data processing.

How do I pass data from parent.html to popup.java? I know I can store 'list'
in the user's session that popup.java can retrieve. But as soon as the user
hits 'Submit' button on parent.html page, a new window will open and no
listener method in parent.java will be called (that can save user's entries
- string or check box values), right? I want to use a button, not a
hyperlink, on parent.html page.

So how do I solve my problem of saving user's entries in parent.html for
popup.java to use? Is there any other way to do this besides saving it in
user's session? Thanks.
-- 
View this message in context: http://www.nabble.com/Popup-New-Window-With-A-Button-in-Tapestry-tf4124923.html#a11730507
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Popup New Window With A Button in Tapestry

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Sorry, I don't have code like this handy, but the steps would be:

- your submit button or form listener sets a flag/data on the Home page
- the home page renders the response to the submit
- the home page checks the flag and conditionally includes javascript
   to open the Popup page from onLoad

Your Popup.java will implement IExternalPage to make it easy to pass
the data you mention in the link generated by the ExternalService.

So it's like using PopupLink on ExternalLink but put it on onLoad.

Cheers,
Nick.


teacup wrote:
> How do you include a popup javascript (say popup.js) in the response from the
> listener method in Home.java?  In Home.html you press a 'Submit' button that
> fires the listener in Home.java, but I am not sure how the listener return a
> javascript in response that will popup a new window.  Please explain.  A
> piece of code will be much better.  Thanks.
> 
> 
> Nick Westgate wrote:
>>>> Handle the submit and conditionally include popup javascript in the
>>>> response.

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


Re: Popup New Window With A Button in Tapestry

Posted by teacup <m_...@yahoo.com>.
How do you include a popup javascript (say popup.js) in the response from the
listener method in Home.java?  In Home.html you press a 'Submit' button that
fires the listener in Home.java, but I am not sure how the listener return a
javascript in response that will popup a new window.  Please explain.  A
piece of code will be much better.  Thanks.


Nick Westgate wrote:
> 
>>> Handle the submit and conditionally include popup javascript in the
>>> response.
> 
> 
> 
> teacup wrote:
>> Hello, members:
>> 
>> Mostly we use a Javascript to pop up a new window. I am writing a
>> Tapestry
>> application, where I want to pop up a new Window (say popup.html). The
>> popup.html page will have its popup.page and popup.java too. The parent
>> page
>> (say parent.html) has a form where user enters a string in a text field
>> (or
>> checks on several check boxes) and then hit a button (say Submit). This
>> button will pop up a new window popup.html, but the problem is I want to
>> pass the string value (or check box values) from the form to popup.java
>> so
>> that this class sets up a certain variable (say list) for later use -
>> e.g.
>> when user enters some more data on popup.html and hit another button (say
>> again Submit) then a listener method in popup.java will take all values
>> from
>> popup.html form and then use 'list' for data processing.
>> 
>> How do I pass data from parent.html to popup.java? I know I can store
>> 'list'
>> in the user's session that popup.java can retrieve. But as soon as the
>> user
>> hits 'Submit' button on parent.html page, a new window will open and no
>> listener method in parent.java will be called (that can save user's
>> entries
>> - string or check box values), right? I want to use a button, not a
>> hyperlink, on parent.html page.
>> 
>> So how do I solve my problem of saving user's entries in parent.html for
>> popup.java to use? Is there any other way to do this besides saving it in
>> user's session? Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Popup-New-Window-With-A-Button-in-Tapestry-tf4124923.html#a11742483
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Popup New Window With A Button in Tapestry

Posted by Davor Hrg <hr...@gmail.com>.
this should be no problem for any html page tapestry or not,

first make you form work without popup, just redirect.

then add this to your form:

<form ... target="MyPopupForm">
or
<form ... target="_blank">

this will cause the form to submit data into a popup window just
like it was normal redirect inside original window.

for binding data it's no different than any tapestry page,
however I'm not sure how to make a form in one page
and submit data to a different form/page in tapestry, since
tapestry relies on it's own naming for rewinding the form...

if you are talking about tapestry 4 then..
you could for example submit the data to your page,
then pass data to desired page and let that page render instead.

I haven't used tapestry 4 for a while, so someone else could give
you more details about form handling .... or check the docs...


Davor Hrg

On 7/23/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>
> Handle the submit and conditionally include popup javascript in the
> response.
>
> Cheers,
> Nick.
>
>
> teacup wrote:
> > Hello, members:
> >
> > Mostly we use a Javascript to pop up a new window. I am writing a
> Tapestry
> > application, where I want to pop up a new Window (say popup.html). The
> > popup.html page will have its popup.page and popup.java too. The parent
> page
> > (say parent.html) has a form where user enters a string in a text field
> (or
> > checks on several check boxes) and then hit a button (say Submit). This
> > button will pop up a new window popup.html, but the problem is I want to
> > pass the string value (or check box values) from the form to popup.javaso
> > that this class sets up a certain variable (say list) for later use -
> e.g.
> > when user enters some more data on popup.html and hit another button
> (say
> > again Submit) then a listener method in popup.java will take all values
> from
> > popup.html form and then use 'list' for data processing.
> >
> > How do I pass data from parent.html to popup.java? I know I can store
> 'list'
> > in the user's session that popup.java can retrieve. But as soon as the
> user
> > hits 'Submit' button on parent.html page, a new window will open and no
> > listener method in parent.java will be called (that can save user's
> entries
> > - string or check box values), right? I want to use a button, not a
> > hyperlink, on parent.html page.
> >
> > So how do I solve my problem of saving user's entries in parent.html for
> > popup.java to use? Is there any other way to do this besides saving it
> in
> > user's session? Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Popup New Window With A Button in Tapestry

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Handle the submit and conditionally include popup javascript in the response.

Cheers,
Nick.


teacup wrote:
> Hello, members:
> 
> Mostly we use a Javascript to pop up a new window. I am writing a Tapestry
> application, where I want to pop up a new Window (say popup.html). The
> popup.html page will have its popup.page and popup.java too. The parent page
> (say parent.html) has a form where user enters a string in a text field (or
> checks on several check boxes) and then hit a button (say Submit). This
> button will pop up a new window popup.html, but the problem is I want to
> pass the string value (or check box values) from the form to popup.java so
> that this class sets up a certain variable (say list) for later use - e.g.
> when user enters some more data on popup.html and hit another button (say
> again Submit) then a listener method in popup.java will take all values from
> popup.html form and then use 'list' for data processing.
> 
> How do I pass data from parent.html to popup.java? I know I can store 'list'
> in the user's session that popup.java can retrieve. But as soon as the user
> hits 'Submit' button on parent.html page, a new window will open and no
> listener method in parent.java will be called (that can save user's entries
> - string or check box values), right? I want to use a button, not a
> hyperlink, on parent.html page.
> 
> So how do I solve my problem of saving user's entries in parent.html for
> popup.java to use? Is there any other way to do this besides saving it in
> user's session? Thanks.

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


AW: Popup New Window With A Button in Tapestry

Posted by Peter Schröder <Pe...@freenet-ag.de>.
http://wiki.apache.org/tapestry/PopupLinkSubmit 

-----Ursprüngliche Nachricht-----
Von: teacup [mailto:m_asifalvi@yahoo.com] 
Gesendet: Sonntag, 22. Juli 2007 14:22
An: users@tapestry.apache.org
Betreff: Popup New Window With A Button in Tapestry


Hello, members:

Mostly we use a Javascript to pop up a new window. I am writing a Tapestry
application, where I want to pop up a new Window (say popup.html). The
popup.html page will have its popup.page and popup.java too. The parent page
(say parent.html) has a form where user enters a string in a text field (or
checks on several check boxes) and then hit a button (say Submit). This
button will pop up a new window popup.html, but the problem is I want to
pass the string value (or check box values) from the form to popup.java so
that this class sets up a certain variable (say list) for later use - e.g.
when user enters some more data on popup.html and hit another button (say
again Submit) then a listener method in popup.java will take all values from
popup.html form and then use 'list' for data processing.

How do I pass data from parent.html to popup.java? I know I can store 'list'
in the user's session that popup.java can retrieve. But as soon as the user
hits 'Submit' button on parent.html page, a new window will open and no
listener method in parent.java will be called (that can save user's entries
- string or check box values), right? I want to use a button, not a
hyperlink, on parent.html page.

So how do I solve my problem of saving user's entries in parent.html for
popup.java to use? Is there any other way to do this besides saving it in
user's session? Thanks.
-- 
View this message in context: http://www.nabble.com/Popup-New-Window-With-A-Button-in-Tapestry-tf4124923.html#a11730507
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


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