This topic is locked
[SOLVED]

 Conditionally hiding DIV in Child record View page

3/15/2018 12:23:08 PM
ASPRunner.NET General questions
S
swiersman author

Hi All,
This is my first time using relational tables in ASPRunner, but I hope someone has a answer for this:

  1. I created an app that is called "ServiceCenter". It has a number of fields it pulls from the parent table.
  2. It also has a child table included called "Details".
  3. Everything works great when Adding, Editing and Viewing records.
  4. When I go to conditionally hide one of the DIVs in "Service Center" in the EVENTS\dbo.ServiceCenter\View Page\JavaScript OnLoad and insert the following it works great:
    var xxxxxx = Runner.getControl(pageid,'xxxxx');

    if(xxxxxx.getValue()=='xxxxxxx)
    document.getElementById("xxxxxxxxx").style.display = 'none';
    end if


  5. When I go to conditionally hide one of the DIVs in "Details" (Child table) in either the EVENTS\dbo.Details\View Page\JavaScript OnLoad or EVENTS\dbo.Details\List Page\JavaScript OnLoad with the above script nothing happens.
    Does anyone know how to solve this or if you can conditionally hide a div in a child table?
    Many Thanks,
    Scott

admin 3/15/2018

I'm not really sure what are "divs in a child table". Is that something that you added manually?
Anyway, the same code should work as long as you specified a correct ID of HTML element.

I
i.NoLim 3/16/2018



I'm not really sure what are "divs in a child table". Is that something that you added manually?
Anyway, the same code should work as long as you specified a correct ID of HTML element.



I think he's talking about an HTML <div> tag.
I agree with admin. I have a similar set up as yours and the following code works for me.
https://xlinesoft.com/asprunnernet/docs/hidefield_js.htm

S
swiersman author 3/16/2018

Thanks All,
Upon further investigation, it looks like that java script API and the below script can only be used for ADD/EDIT/VIEW.
Since this is a child table, it appears in the parent application as a section which shows the child table LIST page and I can not use this script.
Is there any other script I could use, or any other way to force the View page to be shown instead of the LIST page for the child section?
Many Thanks,
Scott

I
i.NoLim 3/16/2018

I'm a little confused as to what exactly needs to be done. You want to display the "View page" of the specific entry in the "Details" table that matches the "Service Center" entry when clicking the "Show details" button?
Are never going have multiple entries in the "Details" table that are linked to a single entry in "Service Center?"

S
swiersman author 3/21/2018

Sorry for the confusion.
Background:

  1. The Main form is utilizing the dbo.ServiceCenter table.
  2. The "dbo.ServiceCenter" is the parent table and the "dbo.DEPLOYMENT TASKS" is the child table joined by the ID column
  3. The DEPLOYMENT TASKS form shows up as a Details Section in the Main forms View "Fields order and totals" page.
  4. When the project is built; in View, the LIST page of DEPLOYMENT TASK Details section is showing.
  5. This all works great.



Issue:
I need to hide a certain field in the DEPLOYMENT TASK Details section (LIST PAGE) based upon one fields' value within the dbo.DEPLOYMENT TASK table.

The code snippets provided say they work for ADD, EDIT and VIEW but do not work for LIST.
I was hoping someone knew how to conditionally hide a field in a LIST page based upon one fields value within a table I guess is what it comes down to.
Sorry for any confusion , hope someone can help.
Scott

admin 3/21/2018
S
swiersman author 4/6/2018



Hiding a field on the List page:

https://xlinesoft.com/asprunnernet/docs/hidefield.htm


Perfect! Many Thanks....
Scot