No announcement yet.

Pulling my hair out trying to implement Master/Multiple detail screen

  • Filter
  • Time
  • Show
Clear All
new posts

  • Pulling my hair out trying to implement Master/Multiple detail screen

    Hi All,

    I have used Scriptcase for about 1 and 1/2 weeks now and am slowly but surely getting the hang of it.

    I have a Master/Detail form to which I have added more detail screens, 2 to be exact ( these two are not related to Master but rather to Detail1) so I set no links to the master form when creating "New Detail" under Master/Detail Form.

    Master = Person (Form application)
    Detail 1 = Person Authorised Funds (Form Editable Grid)
    Detail 2 = Authorised Fund Committees (Form Editable Grid)
    Detail 3 = Authorised Fund Chairperson (Form Editable Grid)

    Detail 1,2,3 should be updatable/editable.
    I would like to be able to filter Detail 2/3 according to the selected record in Detail 1.

    In PHPGrid or .NET I would have been able to "catch" row_click, get the focused row and load the other grids accordingly. I have no idea how to achieve this in Scriptcase.

    I have tried, AJAX/Java script methods on Detail 1, but they don't seem to fire. I have tried adding Application Link to Detail 1 but that didn't work. I am assuming that Scriptcase is doing something funny with the "Detail" linked app. [Update] Also tried Field Link but that is not possible on Editable Grid

    Any help would be greatly appreciated.
    Attached Files
    Last edited by resolution; 12-13-2013, 11:52 AM.

  • #2
    If you are not creating links then I wonder why it's working at all. There are several approaches to this problem but I'm not sure what's the best for you. If you change some data on your top, you need to change the filter on other parts and refresh. Also you need to be able to update on every screen.

    First thing: php is not .net or java. There is no such thing as a datasource or factory. Scriptcase is working in iframes and if you need fully data-aware pages you cannot do that with the master-detail relationship.

    You can - of course - use an ajax event to update things. But let's see if the following approach would work for you:

    First create three standard applications. Each application must be able to run well separately. The filter needs to be passed as a global variable. So your details Sql would be something like 'WHERE myfield = [glob_myfilter]'

    When you run your application then a message will popup to allow you to enter the global for testing purposes.
    To set keyvalues you need to use the field definitions or use an event (onvalidate) to set those.

    Next you need to create a container and put your applications in. Be aware that in a container all applications still run independently but they are combined in a kind of dashboard. If you load the container all the values for the global filter variables must be available.

    Now you have to apply some tricks to your main application. If you change your filter there you need to make sure that the other forms are changed too. If you fill the global variable of your filter and do a sc_redir to your container using _parent as target then the full form will be refreshed and all forms will show up using the latest filter.

    It is possible to do it more sophisticated, but for that you need to know the name of the iframes your applications are put. You need to hack into the generated html to find out. But you can change the url of the appropiate container. But that's a pretty technical issue as SC is not supporting that out of the box (which is a major wish imho).]

    Hope this helps.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thanks for the pointer Albert.

      I know about container applications but prefer the master detail concept I explained.

      I found the iFrame and managed a button on the Detail1 screen that called a method on the main form that refreshed detail 2 and 3. Was trying to get to pass the relevant detail1 key to refresh 2 & 3 but have given up on that for now as I have spent too much time already. To do what I wanted I think is actually pretty easy but I will figure it out when I have more time.

      For now I just need something functional and will split the screens.

      I appreciate the assistance.