Results 1 to 10 of 11

Thread: cWebDynamicObjectContainer mixes up objectnames

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2013
    Location
    Nässjö Sweden
    Posts
    604

    Exclamation cWebDynamicObjectContainer mixes up objectnames

    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.
    Click image for larger version. 

Name:	ConvFromTransportErr.jpg 
Views:	59 
Size:	183.4 KB 
ID:	16006Click image for larger version. 

Name:	ConvFromTransportErr2.jpg 
Views:	47 
Size:	69.0 KB 
ID:	16007
    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 .
    Last edited by Albin; 23-Feb-2023 at 03:46 AM.
    Software Developer Prosmart System AB
    www.prosmart.se

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •