1. Roland Smith
  2. PowerBuilder
  3. Friday, 11 February 2022 16:28 PM UTC

Our application has a feature where which columns are visible or not can be decided by the end user and the settings are stored in the database.

When I loop through the columns to check the Visible property, all the columns return 1 (True). It appears to be returning the original Visible property, not the current value.

Anyone know how to get around this issue?

 

Roland Smith Accepted Answer Pending Moderation
  1. Friday, 11 February 2022 18:52 PM UTC
  2. PowerBuilder
  3. # 1

I figured out the problem.

I coded my object to work with DataWindow and DataStore objects. To do that, when passing a DataWindow I was setting the DW instance variable to the passed argument and then doing a ShareData to the DS instance variable. All functionality after that works exclusively with the DS.

That is why I was only getting original property values.

I added code to copy the visible property from the DW to the DS and now it works as expected.

Thanks for the suggestions.

 

Comment
  1. Miguel Leeuwe
  2. Friday, 11 February 2022 23:20 PM UTC
Very true, what I'm doing now is duplicating functions, one for a datawindow parameter and another for a datastore. I only have a few luckily.



  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 11 February 2022 23:22 PM UTC
We could do an enhancement request, but I'm not too optimistic about it. Maybe in the future.

Of course, we could go back to the good old days - pre-datastore - and use invisible dw controls :)
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 11 February 2022 23:25 PM UTC
What the heck, I just created the enhancement request. You never know ...

https://www.appeon.com/standardsupport/track/view?id=7942

  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 11 February 2022 18:09 PM UTC
  2. PowerBuilder
  3. # 2

We do something very similar and haven't had any problems, just like Brad says. Beware that you have to set the column's visibility, which will automatically make the header invisible too (though if I remember well we set both), but still ... check the column. Like Mike says: beware of any expressions in the visibility attributes.

regards.

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 11 February 2022 16:59 PM UTC
  2. PowerBuilder
  3. # 3

i always use evaluate in case there is an expression on an attribute such as visible.  emailed you a function so you can quickly check to see if it fixes it for you

 

 

 

 

 

 

 

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Friday, 11 February 2022 16:55 PM UTC
  2. PowerBuilder
  3. # 4

We've never had a problem with getting the property for visible. We have our own libraries to do grid arranging, which requires figuring out which columns are on/off when user saves the config. It hasn't failed us yet (and I'm pretty sure it was implemented in PB5 originally).

Show us your code Roland. Maybe someone can see what's wrong.

Also, which version of PB?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.