We have a case where we use cWebDynamicObjectContainer to show a cWebList with multiple columns. We are using Dataflex 20.1.
Depending on what choices the user does, the cWebList gets a number of different columns.
Some columns are Ascii columns and some are numeric and so on. Everything works great except that we tried to set peDatatype and add a psMask to the numeric columns.
This triggers errors if we click on a row. The framework tries to set webProperties (I think) and when it does that it mixes up the column object names. So some Ascii columns get peDatatype = TypeNumber.
We have a simple container like this:
Code:
Object oExportResultContainer is a cWebDynamicObjectContainer
Set piColumnCount to 12
Set piColumnSpan to 0
Set pbFillHeight to True
Procedure pLoadReportResult String sSQL tProReport stReport Boolean bExport
Handle hoGrid hoCol
Integer i
Send ResetContainer of oExportResultContainer
Get CreateDynamicObject of oExportResultContainer (RefClass(cReportResultList)) "oReportList" "" to hoGrid
For i from 0 to ((SizeOfArray(stReport.stProReportFields))-1)
Get CreateDynamicObject of oExportResultContainer (RefClass(cWebColumn)) ("oCol_" + stReport.stProReportFields[i].sFieldName) "oReportList" to hoCol
Send InitDynamicProp of hoCol "psCaption" stReport.stProReportFields[i].sFieldName
Send InitDynamicProp of hoCol "piWidth" 50
Send InitDynamicProp of hoCol "peAlign" alignLeft
If (stReport.stProReportFields[i].sFieldType = "Number") Begin
Send InitDynamicProp of hoCol "peDataType" typeNumber
Send InitDynamicProp of hoCol "psToolTip" "Number"
Send InitDynamicProp of hoCol "piPrecision" 2
End
Else Begin
Send InitDynamicProp of hoCol "peDataType" typeASCII
Send InitDynamicProp of hoCol "psToolTip" "String"
End
Loop
Send Activate of oExportResultContainer
Send ClearGrid of hoGrid
Send GridRefresh of hoGrid
End_Procedure
End_Object // oExportResultContainer
When running the procedure above we get a grid that looks great. But when clicking on a row we get the error "Not compiled expression can´t be run...".
When debugging we see that the Private Function ConvertFromTransport inside cWebBaseDEO.pkg gets the wrong data attached to the wrong column objects. So peDatatype is wrong which is what is causing the error that is coming from "ConvertFromClient" function.
In the attached picture, Self is = 15695 - oCol_anm1 but the variable sValue = "Q-ProCustomer" is the data in another column object that has a name and handle called 15693 - oCol_CustomerName (This column has the psCaption "KUNDNAMN" in the second picture.
Also we set the psToolTip on every column to the datatype for debugging and the tooltips show the correct datatype for every column.
So, has anyone seen this and what can we do about it?
We can stop setting peDatatype TypeNumber and just keep everything in string datatype, then it will work without errors but this will bite us eventually somehow I´m sure .