Can this be done in ASP?

Discussion in 'OT Technology' started by TrevorK, May 15, 2003.

  1. TrevorK

    TrevorK New Member

    Joined:
    Mar 12, 2002
    Messages:
    692
    Likes Received:
    0
    Location:
    Alberta
    What I want to do is have my records displayed, and the user can click something and all the child records are displayed underneath (While still displaying a list of various records).

    In context, I want to display a PO, and if the user click something (A link, a plus sign, whatever) I want to display the line items. But I want to give the user the chance to open multiple ones at a time, etc...

    Can this be done in ASP? Or do I need ASP.Net? Can someone point me in the right direction?
     
  2. Early Apex

    Early Apex Guest

    It can be done, but you're going to need to track the state (expanded/unexpanded) of each PO. You can do this by storing the value in the database (probably in your PO table), or by keeping a collection, dictionary, or array in a session variable that knows expanded state for each PO. (Or, just a list of POs that have been expanded.)

    Then, whenever you draw any page that creates your list of POs and line items:

    a. If using the first approach, check the recordset value for the PO to see if it's expanded or not.

    b. If using the second approach, flip through the collection/dict/array to determine expanded state of each PO.

    If you're not working with a fully-encapsulated middle tier, you'll need to open an rs for the line items for each expanded PO.

    The other half is setting the expanded state when a user clicks a PO link/plus sign. The next page you call should be passed the PO ID and the desired state (or the page can determine the existing state and reverse it). This "next page" can be an invisible, no-interface page that performs the state switch, or it can be incorporated into any page that displays the PO list.

    If using the db approach, the "next page" should perform an UPDATE command to set the "expanded" field to the new value. If using the second approach, the "next page" needs to find or create the appropriate collection/dict/array item and reverse its value. (Easier to do if you use boolean values for state here).

    Aw, crap. I just realized the db approach won't work in a multi-user environment without big modifications. Best to store user-specific interface hints in a session variable, rather than try to sort out in the db whose interface description belongs to whom.

    This is probably written very poorly. I'll see if I can come up with some code to show you.
     
  3. TrevorK

    TrevorK New Member

    Joined:
    Mar 12, 2002
    Messages:
    692
    Likes Received:
    0
    Location:
    Alberta
    Makes a bit of sense to me.

    An example would be great if you could come up with one.
     

Share This Page