You need to sign in to do that
Don't have an account?

Using 1 controller for 2 Pages ..
Folks,
Probably a dumb question -- is it a bad practise to use 1 controller for 2 different visualforce pages ? 1 page is a main page & the other is a pop-up from the main page.
Pls advise.
Thanks.
All Answers
Hi Doug,
This is what I am supposed to & planning to do ..
1. I will have a VF page VF1 with a dataTable inside it.
2. One of the columns(C1) of the dataTable is a commandLink on click of which I need to open a pop-up window (VF2).
3. This pop-up window is a drill down on the details about the column C1. So this VF2 will also contain a data table and some other stuff.
I plan to use the same controller for both the pages because for page 2 I will use the data that is initialized(init method) on the controller class for page 1. Hope I am not confusing here :-)
I haven't tried such approach before but as you said this should work I guess. Also I dont have any navigation or reference to pages from the pop-up. So I just put some data on the pop-up and will call one action method .. thats about it ...
Here a simple example of implementing a popup using the YUI library.
http://wiki.apexdevnet.com/index.php/Visualforce_Popup
enjoy.
Hello Ron,
Seeing your post, i tried implementing YUI for one of my requirements. Here is how it goes-
I am using YUI to open VF pop up screens with a set of values dynamically rendered from the controller with a logic.
The problem is that, these values are not updated dynamically as per the requirement whenever the logic is re-run in the controller. I can see the method being executed in the debug log, but the SelectList is not getting refreshed with the new set of values fetched from the controller.
I am really clueless as to why is this happening
Not sure if i am missing out something or is this a bug with the way YUI works with visualforce pages??
Any help will be highly appreciated!!
Many Thanks,
Achin