locked
How to HIDE or SHOW fields / controls inside a TABLE ROW or LIST ROW as part of a collection? RRS feed

  • Question

  • I have a collection being shown in a Table in the HTML client.  Within each Table Row, I have groups to set up display of a number of fields and controls.

    I need to be able to respond to a button click or control event as well as in PostRender for each row be able to show or hide a subset of fields based on whether a bool is true or false.

    For example, a collection of ORDERS and an ORDER might have a "RETURNED" bool.  And if the RETURNED bool is TRUE I want to SHOW an editable text-area for a string field that allows entry of a description of why the item was returned or perhaps a drop down showing the state of the returned item.  Maybe I also want to show fields for "RETURNED_ON" and "PROCESSED_BY" if the RETURNED bool is true.  It if it false, then I don't want any of these controls to show up as that buries the data in every table row with a bunch of fields that I only need to show now and then.

    However, what I am finding is that elements on the PostRender event DO NOT have an IsVisible property at all.  They do have a 'hidden' property but that does absolutely nothing to hide a visible element.  

    Do I need to trace up the parentNode and then find control by name on the parent node to see sibling controls in a table row?  (I can't use by name at the screen object as this is a collection of like-named controls in a list or table.)

    Once I have the PostRender code working to show or hide some fields for the initial table render, then the next step is to respond to button clicks or property changes so that if a table row has an entity where the user checks or uses a flipswitch to say "Yes, RETURNED" then I need to show/hide the related fields for that table row.  I assume I add a listener and event and then run up the parentNode to find the siblings and set their visibility.

    In summary, if there is any examples of this kind of behavior within a table row or list row, I would love to see them.  So far, I only see hide/show examples on non-collection items.  Second, why does IsVisible not show up or work and why does hidden not work when set to false?


    Thursday, November 7, 2013 9:49 PM

All replies