aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Button click on the pop up should click button on another page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Button click on the pop up should click button on another page" Watch "Button click on the pop up should click button on another page" New topic
Author

Button click on the pop up should click button on another page

veda Cherak
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Hi ,
I have a page1 with TextField,ComboBox and hidden button.
When I try to enter values in TextField it opens a new pop up(page 2) with few options and enter button. Then when I click enter button I want to click the hidden button on the page 1.
How can I achieve this ?
My basic idea is to populate the ComboBox when I click the Enter Button on page 2.

Please suggest.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

veda it wrote:My basic idea is to populate the ComboBox when I click the Enter Button on page 2.


Then just do it. Write code which does it and execute that code. I don't see why you need weird stuff like clicking hidden buttons.
veda Cherak
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Yes I don't really need a hidden button but it was my option.
As the ComboBox and EnterButton are on two different pages and I didn't know a way to populate it on EnterButton click.

I have all my logic on HiddenButton which retrieves data from the DB and populates the ComboBox working right now. So I though if I can invoke this button click from
the other Page EnterButton my problem will be solved.

Please let me know if there is a better way.



Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Then move all the logic of the HiddenButton into a separate 'public' method(you can continue to invoke this from the actionListener of that button if you need). Then, call this method from the popup...


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
veda Cherak
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Ranganathan Kaliyur Mannar wrote:Then move all the logic of the HiddenButton into a separate 'public' method(you can continue to invoke this from the actionListener of that button if you need). Then, call this method from the popup...


Thanks you Ranga. I tried a different way to enable this button but the solution you gave is much better so will implement it .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Button click on the pop up should click button on another page