Converting Attributes/Grid nodes from versions prior to 13.1


K2BTools 13.2 includes an improvement of how cards are generated in the UI that simplifies the HTML structure associated with them, minimizes the amount of code generated to implement some features, and allows customization by the developer.

In previous versions, cards were implemented using a combination of a series of nested tables and controls in the web form and events in the events part. This implementation had some problems:

  1. The generated HTML structure was unnecesarily complex. This implied that the associated CSS was also complex and difficult to customize.
  2. The event code generated for each card was basically the same for all cards, and solved a very simple feature: Collapsing/Opening the card.
  3. No personalization options were offered to developers. The HTML structure was hardcoded in the pattern and developers had no options to change it.

In K2BTools 13.2 onwards this feature is implemented using a UC 2.0 object with the advantages mentioned before.

However, migration problems may occur if developers manually referenced controls in the HTML structure associated with cards. This usually happened when the developer wanted to:

  • Change the card's title in runtime.
  • Collapse/Open a card in event code.
  • The "Section Class" property in Attributes nodes now applies only to the card's content.

When is it necessary to execute the conversion process?

You may need to run the conversion process if errors like the following appear after migrating to a version from 13.2 onwards:

* Invalid attribute 'GridTitle_{GridName}'

* 'Caption' invalid property.

* Invalid attribute 'TextBlock_Attributes_{AttributesNodeId}'

* 'Caption' invalid property.

* Invalid attribute 'CollapsibleImage_{GridName}'

* Unknown function 'FromImage'

* ''ToggleCollapsibleSection({GridName / AttributesNodeId})'' is an undefined subroutine.

* src0212: 'ComponentSubtitle_{Entity Manager component code}' invalid control.

Fixing compatibility issues

Solving this problem involves automatic and manual steps. Start with executing the "Fix K2BT_Component UC compatibility" action found in the K2BTools -> Advanced menu in the GeneXus IDE.

This action will scan the KB and find code that is now invalid.

  • When possible, it will convert the code to use the new UC.
  • If this is not possible, it will comment it out and indicate in the output that a manual intervention is necessary.

This action will also find Attributes nodes where the Section Class property was manually modified and list those objects in the output so that the developer can check the UI for those objects manually.

To simplify the manual steps, the complete output issued by this action is saved in the OutputLogs folder inside the KB's folder.

Solving issues manually - Commented code

The main question at this point is to see what the commented code was inteded to do, and rewrite it using the UC 2.0.

If the code was intended to collapse/open the card, you can use the "SetIsOpen" method in the UC and the "Open" readonly property, for example:


Solving issues manually - Modified section classes

Check if the UI changed from the previous version to the current one. In many cases the UI stayed the same and no further actions are required.

If the UI changed the Section Class (or the class referenced in it) must be updated to match the previous version's UI.

If the previous version included no borders for the card, you may use the "Show borders" property to restore that behavior.