Skip to content

Web Framework 18.1

Web Framework Improvements

  1. Added DD-remember support to WebApp

The needed changes have been made in WebApp to support DD-remember.

The public web DEO methods DDFieldRemember, DDFieldRememberLast, and DDFieldUnRemember have been added to file/field bindable web DEOs. They work just like their window's counterpart. This provides a suggested mechanism for setting dynamic DEO field defaults. This can be end-user controlled or developer controlled.

Just like in Windows, this can be used to set dynamic defaults and retains (via remember-last). When applied to parent autofind fields, the parent will be found during a clear, providing a way to set parent record defaults as well. As in Windows, this is meant to replace the need for using the deprecated Retain and RetainAll.

WebApp.src has an example of a Remember menu group. While this works, it is probably not how you would use this feature. Instead, you will either create buttons next to DEOs that do this or manually set defaults within your code. If you set these manually, you can either send the messages DDFieldRemember, DDFieldRememberLast, and DDFieldUnRemember to the appropriate DEO or you would send remember messages directly to the DDO using Field_RememberedValue, ClearRememberedDefaults, and ClearAllRememberedDefaults.

Retain and RetainAll were not working properly in WebApps and now they are. They should still be avoided. They are supported as legacy DD features.

  1. Better WebApp DDO Sync behavior during a request resync

WebApps do a more efficient job of re-syncing DDOs and they now properly support diamond relationships.

  1. Initial support for multi-row lists/grids

The cWebColumn now has pbNewLine, piColSpan, and piRowSpan properties which can be used to make a row display itself over multiple lines. Note that due to this change, the HTML structure of lists and grids changed where each row now consists of a table.

  1. Optimized list scrolling

Optimized list scrolling by off-loading work to the video card. This is done by using the translateY CSS transformation when supported by the browser.

  1. Added support for fixed width columns

The column's piWidth value will be interpreted as a pixel value instead of a weight ratio by setting pbFixedWidth to true.

  1. Fixed the cWebDateForm

Improved support for older browsers and slower machines.

  1. Fixed the password field issue on mobile devices

Password fields switched back to regular text fields on blur.

  1. Fixed focus issue on the cWebGroup

The cWebGroup was reporting itself as having the focus like a control while a container shouldn't be able to take the focus.

  1. Fixed the ShowInfoBalloon function

The function never showed the info balloon immediately while it should.

  1. Improved the loading process of dialogs and views

    Improved the loading process of dialogs and views so they can be initialized synchronously within the same call. See the new property pbOverrideStateOnShow on cWebWindow for more details.

  2. Fixed the setter of pbEnabled for the cWebList

    Fixed the setter of pbEnabled for the cWebList in the JavaScript engine which was causing errors if called during initialization.

  3. Changed the way views and dialogs are loaded

    We have changed the way views and dialogs are loaded with the goal to improve initialization of a view/dialog based on parameters. The view now has a new property pbOverrideStateOnShow which controls this new behavior. If this property is set to true, a view/dialog immediately becomes in sync as soon as Show is sent. Instead of going back to the client to see if the view/dialog was already being loaded, it immediately marks the view as being synchronized and performs the necessary operations (check rights, clear DDOs, rebuild constraints). This means that you can now immediately perform finds on the DDOs, and their state will simply override any existing state that might have been on the client already. Thus, we don’t need to store values in web properties and then perform the actual finds in OnShow anymore.

    Old code:

    Object oCustomerDialogOldStyle is a cWebModalDialog
        Set piColumnCount to 10
        Set psCaption to "Customer Maintenance Old Style"
        Set piWidth to 600
        Set piHeight to 400
        Set pbOverrideStateOnShow to False
    
        Procedure ShowCustomer Handle hoOpeningView RowID riCustomer
            WebSet psCustomerRowId to (SerializeRowID(riCustomer))
            Send Popup hoOpeningView
        End_Procedure
    
        { WebProperty = True }
        Property String psCustomerRowId ""
    
        Set pbServerOnShow to True
    
        Procedure OnShow
            String sRowID
            WebGet psCustomerRowId to sRowID
            Send FindByRowId of oCustomer_DD Customer.File_Number (DeserializeRowID(sRowID))
            WebSet psCustomerRowId to ""
        End_Procedure
    

    Now becomes:

    Object oCustomerDialogNewStyle is a cWebModalDialog
        Set piColumnCount to 10
        Set psCaption to "Customer Maintenance New Style"
        Set piWidth to 600
        Set piHeight to 400
        Set pbOverrideStateOnShow to True
    
        Procedure ShowCustomer Handle hoInvokingView RowID riCustomer
            Send Popup hoInvokingView
            Send FindByRowId of oCustomer_DD Customer.File_Number riCustomer
        End_Procedure
    

    As the code samples show, this simplifies the code quite a lot and reduces the need for web properties to temporarily store the parameters until the next call when the view was actually in sync. It also improves performance by reducing the need for this separate OnShow call. Importantly, when a dialog is opened, you won’t see the old values (from its last usage) flashing away into the new values anymore.

    A small side note is that web properties are not reset to their initial value, so if you change a web property later on, you’ll have to make sure that it is changed back yourself.

    The property replaces the pbClearDDOsAfterHide property which was added to prevent old (probably deleted) records from being refound while initializing dialogs. The new pbOverrideStateOnShow also prevents that from happening. Like the old property, pbOverrideStateOnShow defaults to false for the cWebView and to true for cWebModalDialog. The change is backwards compatible so that dialogs initializing with the old way still function properly (regardless of the value of pbOverrideStateOnShow).

    Prompt dialogs can also be improved with this new behavior. Instead of waiting for the OnShow to initialize, they can now do this immediately by augmenting the Show procedure. The change is illustrated below.

    Old code:

    Set pbServerOnShow to True
    
    Procedure OnShow
        Send InitializePromptList of oPromptList
    End_Procedure
    

    Now becomes:

    Procedure Show
        Forward Send Show
        Send InitializePromptList of oPromptList
    End_Procedure
    
  4. Fixed cWebEdit

    Fixed cWebEdit which didn't perform the field validations when leaving the field. This happened because the key handler was not forwarded to its base class.

  5. All controls now set their object names

    All controls now set their object names as data-dfobj attributes in the HTML so that the corresponding object can be found while debugging and by the previewer.

  6. Fixed the cWebImage bug

    Fixed the cWebImage bug where under Chrome it wouldn't show the image if psUrl was set to the same URL twice.

  7. Fixed a bug in the cWebList

    Fixed a bug in the cWebList where having pbShowLabel set to false and peLabelPosition set to lpTop caused JavaScript errors.

  8. Structs and Arrays support with web properties

    Structs and Arrays are now supported with web properties. While the creation of struct and array web-properties is a powerful feature making it easy to store large amounts of data, developers should be aware that the data is sent back and forth with every request/response cycle. This could impact performance. Note that RowId data-types are not supported for any type of web-property including structs and arrays. If you need to store RowIds, serialize them to a string using the SerializeRowId() function.

See Also

What's New in DataFlex 2015 - 18.1