Hi can you explain how and when to use multiple datasources defined against the the definition. My issue as follows. I have a contact screen which uses datasource contact1. The panel with the fields I want to use in another "screen" as well. However the context is slightly different. In the primary case the contact screen is the standalone version. In the other case the contact screen is used to drive a master-detail. No I can define in the datasource the current row changed event. However when I use the screen in standalone mode I do not need to fetch details. Somehow I need to execute my populateDetail procedure only when I am in the master-detail and not in the standalone version. How can I best accomplish this. Defining datasource2 is not helping as all my pl/sql code references datasource1 as well as my single rowedit screen and grid of course. I guess I can use a session variable when in one or the other mode and execute the populate detail depending on the value of that session variable. |
Hi Raymond, Concerning your issue, if your master-details screen has the master contacts as a grid, i would use the If your master-detail screen has the master contact as a single-record form as well, then you could do it by setting a session variable and check it in the One remark on the use of multiple datasources defined against the same datasource definition:
Working with the same datasource in multiple screens at the same time is something to avoid in my opinion, so in these cases i create a second datasource or datasource definition. There are lot's of more use cases for having multiple datasources on a single datasource definition, but this post will get way too big to list them all ;-) Best, |
Yes that makes sense. My issue is I have these two panels, one grid the other is the single row edit screen. They are used in 2 or 3 places in the application. If I read you correct you suggest to copy the panels and adjust the datasource in the grid and fields in the single row screen so they all have their own datasource. That would then mean that I need to copy the package as well.
(16 Mar '14, 07:35)
Raymond
If the single record edit screen is always called from the master multi record panel (like doubleclick the master record to edit the record in a dialog), then it is easier to use the same datasource for these 2 panels.
(16 Mar '14, 08:56)
Michiel A
Ok but I do have to duplicate the "panel set" for use in other places correct?
(16 Mar '14, 09:17)
Raymond
or is there a way to use the same panels but change the datasource at runtime?
(16 Mar '14, 09:18)
Raymond
if the 'panel set' could be active in your application at two places at the same time, i would copy them. Changing datasource at runtime is not possible.
(16 Mar '14, 09:36)
Michiel A
thanks it is all clear now.
(16 Mar '14, 09:38)
Raymond
showing 5 of 6
show 1 more comments
|
The only issue I found with the the reason i advised to use selectionChanged event on grid is to solve your issue that you had with two panels on the same datasource where one (the grid) had to query details and the other one not. Using the current row changed event wont solve it since it triggers on both screens, that's why my advice to use the grid selectionChanged for this particular case. Normally you would use the datasource current row changed event.
(17 Mar '14, 03:40)
Michiel A
I followed your advise and duplicated my two panels and defined a second datasource for the second set. I modified the package to deal with both sets of panels with the use of api_application.getclientevent() and api_application.getevent(). Great pointers and everything is now coming together nicely.
(17 Mar '14, 07:16)
Raymond
|