{"id":279,"date":"2010-08-13T20:20:03","date_gmt":"2010-08-14T01:20:03","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=279"},"modified":"2021-03-09T07:54:56","modified_gmt":"2021-03-09T12:54:56","slug":"powerbuilder-bug-autosize-height-and-font-color","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-bug-autosize-height-and-font-color\/","title":{"rendered":"PowerBuilder Bug &#8211; Autosize height and font color"},"content":{"rendered":"<p>This bug occurs in version 11.5.1 Build 4608. I&#8217;m not sure of other versions at this point.<\/p>\n<p>One of the many great features of the datawindow is the ability to create expressions on various object properties. This can greatly reduce coding for &#8216;eye candy&#8217; type stuff throughout an application. A very common use is to change the text color of a row based on some criteria. I ran into an issue with this on a grid datawindow which had some columns which where set up to &#8216;autosize height&#8217;. Autosize height on a column (and the band the column is contained within), allows for a dynamic expansion (moving downward) of the display when the data (usually character data) is larger than the current size of the column.<\/p>\n<p>Here is an example of the issue I came across:<\/p>\n<p><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue1.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-280\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue1-300x55.png\" alt=\"\" width=\"300\" height=\"55\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue1-300x55.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue1-150x27.png 150w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue1.png 372w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>First we have the rows as retrieved showing in red.<\/p>\n<p>When we click the checkbox the color is changed to black via an expression on the font.color property. However, in my case I got this.<\/p>\n<p><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue2.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-281\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue2-300x59.png\" alt=\"\" width=\"300\" height=\"59\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue2-300x59.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue2-150x29.png 150w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/08\/autosizeissue2.png 370w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The solution is to redraw the datawindow object. This is supposed to happen automatically but to make sure we will call setredraw() on the datawindow ourselves.<\/p>\n<p>Create event with the following<\/p>\n<pre name=\"code\" class=\"VB\">\/\/ posted from itemchanged to fix PB bug with text color on autosized height columns\ndw_1.setredraw(TRUE)<\/pre>\n<p>In the itemchanged event on the datawindow (dw_1 in the above example), post a call to this new event.<\/p>\n<pre name=\"code\" class=\"VB\">parent.event post we_autosizeon()<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This bug occurs in version 11.5.1 Build 4608. I&#8217;m not sure of other versions at this point. One of the many great features of the datawindow is the ability to create expressions on various object properties. This can greatly reduce coding for &#8216;eye candy&#8217; type stuff throughout an application. A very common use is to&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[21,12],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/279"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":9,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":1794,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/279\/revisions\/1794"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}