I have 3 pages which does nearly sale thing, I have created 3 pages and 3 respective controllers. Is there way i could reuse my visualfoce page and controller.
1) the best practice would be creating the components and include them in the respective visualforce page. 2) Create a separate class for the funtionality and call them in the controller,This will help to reuse the same code for similar functionality.
1) the best practice would be creating the components and include them in the respective visualforce page. 2) Create a separate class for the funtionality and call them in the controller,This will help to reuse the same code for similar functionality.
1) is understood 2) you try to say that, I create a Class with all the fucntionalities and when i want to use the functionality, i will create object of this class and use the fucntiuuons inside it.
Also, Can i use the same controller for 3 different pages. If i can, are there no conflicts during usage of page. what will be the scope in this case.
The scope will be separate for each controller instance. Are you trying to achive wizard control ? Are just want to use the same controller for all the 3 pages ? You can use the same controller and use an extensioncontroller to add any more functionalities.
1) the best practice would be creating the components and include them in the respective visualforce page.
2) Create a separate class for the funtionality and call them in the controller,This will help to reuse the same code for similar functionality.
Regards,
BDatla
All Answers
1) the best practice would be creating the components and include them in the respective visualforce page.
2) Create a separate class for the funtionality and call them in the controller,This will help to reuse the same code for similar functionality.
Regards,
BDatla
1) is understood
2) you try to say that, I create a Class with all the fucntionalities and when i want to use the functionality, i will create object of this class and use the fucntiuuons inside it.
Also, Can i use the same controller for 3 different pages. If i can, are there no conflicts during usage of page. what will be the scope in this case.
Are you trying to achive wizard control ? Are just want to use the same controller for all the 3 pages ?
You can use the same controller and use an extensioncontroller to add any more functionalities.
Regards,
BDatla
I have page which derives information from controller and displays and also is information is modified on screen it is saved back to controller.
Based on your comments,
Page 1 - Controller1
Page 2- Controller2
Page 3 - Controller3
controller 4 for Common functionalities(used by all 3 other controllers)
Do you think, this is right logically
Yes, I think it is right logically assuming 4th one is main controller and remaining are controller extensions.
Regards,
BDatla