Audience
  • Developers
  • Form Designers
Required Knowledge
  • Views
  • Rules
  • Controls

Introduction

The latest How To topics are available in the K2 Five User Guide or the K2 Cloud User Guide’s How to section.

Control properties can now be changed at Runtime. The Control Properties section has been added to the Actions of the Rule Designer to provide the flexibility to change the properties of a control when an Event has executed.

Definitions:

Configuring the control properties in the Properties panel of the Layout step - Configuration is done in Design Time and applied in Runtime before any Rules are executed.

Using a Control Properties Action in the Rule Designer - Configuration is done in Design Time and applied in Runtime as part of a Rule execution.

Implementation Details

The following Control Properties Actions are available in the Rule Designer in the Control Interaction section:

View level:

Image

Form level:

Image

For detailed information, see the Control Properties Actions topic in the help file:

K2 Designer>Understanding Rules>Actions>Control Properties Actions

Example Scenario

We will use a View with a Picture control to show how the control size can be changed at runtime.

Follow the steps below to set up the scenario as described above:

  1. Create a View with a Picture control and a Button control.
  2. Select a picture in the Data Source section of the control properties.
    Image
  3. Go to the Rules section and add the following Rule:
    Events: When a control on the View raises an event
    Actions: Set a control's properties
    Image
  4. Configure the Set a control’s properties Action as follows:
    Image
  5. Finish the Rule and the View.
  6. Run the View. Note the size of the Picture control.
    Image
  7. Click on the Button control. The picture is resized according to the control properties specified in the Rule.
    Image