Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Form field visibility is inheriting visibility of field in ListGrid

    This is a strange one. I'm not sure where to look, so hoping you can point me in a direction.

    In one class we are showing a ListGrid set to use datasource X. A button in that Canvas opens a separate window with a new form in it that also uses datasource X. Only four of the fields from the datasource are added to the form by creating new FormItems and calling form.setFields().

    These fields are flagged as detail="true" in the ds.xml so they are not visible in the ListGrid initially. The problem is they aren't visible in the form either. If I use the collumn picker to show them in the grid, then click the button to show the form then they do show up on the form.

    The form fields are also 'inheriting' the width attribute from the ListGridField. If I change the width of the ListGridField then open the form the FormItem width now matches the ListGridField.

    Is there something that we could be doing that would cause this? I know we've used similar patterns to this elsewhere but haven't run into this problem.

    #2
    We're not aware of anything that would cause this.
    Without more information, a couple of possibilities spring to mind:

    1) The application code is picking up the ListGrid field properties and applying them to the form items somehow. Something like an innocent looking function call that actually ends up passing the ListGridField object directly to the Form as part of its fields block. Obviously that's something you'd have to analyze within your application (perhaps try removing the ListGrid definition altogether and see if you can see code that was relying on it being there and copying attributes in the code flow that creates the FormItems, etc)

    2) The listGrid may be writing properties directly onto the DataSource field definitions rather than writing them just onto the actual field objects within the ListGrid.
    You could probably check whether this is occurring by using the developer console to look at the result of someDataSource.getField("fieldName"); and seeing if it's being updated directly as you change the visibility of the field within the ListGrid [check for "showIf" changing as well as more obvious visibility properties].

    If the latter, this could still be application code, or there might be some framework issue we're unaware of. If it is something the framework is doing, most likely in debugging this you'll be able to come up with a reproducible pattern (which, as always, we'll be happy to take a look at)

    Regards
    Isomorphic Software

    Comment


      #3
      Point 2 is what is happening. I've confirmed by looking at one of the fields in the ListGrid with DataSource.get("OrderLine").getField("returnReason") in the dev console. It first appears with showIf: false. If I then use the column chooser to add it to the grid it changes to showIf: showIf().

      I'm beginning to think it is a framework issue as it is showing up in multiple places in our app. None of them are doing anything different with the datasource from our normal practice. Just using DataSource.get() to get it and ListGrid.setDataSource() and DynamicForm.setDataSource().

      We're currently using SmartClient Version: v8.3p_2013-03-13/PowerEdition Deployment (built 2013-03-13), but we're about to update to a more current version. Will let you know if it still occurs and if we can create a standalone test case.

      Comment

      Working...
      X