• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to share the same events for multiple components?

 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a tabbed pane with three tabs. Each tab contains the same components. For eg
Tab 1 contains the following

one Label - Login ID
one Text field - Login ID field
one button - Login
one text area - Generate some data
two buttons - Clear and Exit.

I have written one method createPage() and it will place all these components in the tab.
The same method will be used to create components in other tabs, such as Tab 2 and Tab 3.
Is it a good idea to use the same page in other tabs without creating a new components?
I want to handle the events for Login , Clear and Exit buttons. Can we share the same events
to all these buttons?

Give me some pointer

bye for now
sat
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look into the AbstractAction class that is the good start for you. But i would say that if you really want to reuse the components then take care that you clear the old data carefully. You will have a lot of issues associated with that.

I would personally prefer to have the same method re create the components bnut then it is a personal opinion
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sam,

Thanks. It works fine.

bye for now
sat
 
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic