• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing a value

 
Roger Swillens
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody help me.

I've got 2 view classes with their own viewcontroller.
In view 1 i'v got a combo box with a observablelist wicht show me some values.

What i want is to put an new value to the combobox through the controller of view2.

When i make the observablelist static it works but i think that isn't a nice way.

Can somebody give me a Tip or an example.

thanks
 
Ramesh Pramuditha Rathnayake
Ranch Hand
Posts: 178
2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be better if you state how did you try it without using static..?

But I can suggest you,
you can use a method called getObservableList() returning the observable list in the first class so that you can access that observable list in second class. When accessing do not create a new instance of first class. I think you know why..
 
Campbell Ritchie
Marshal
Posts: 52600
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we need to see some code please, before we can help.

Having to make something static usually means there is an error. Maybe you have got something else static which shouldn't be.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!