Displaying a hyperlink column in a K2 SmartForms ListView
K2 has a hyperlink data type that can be used in both K2 SmartObjects as well as K2 SmartForm Views. This can be useful when you want to display a dynamic hyperlink.
For this example we will have a column in a K2 SmartForms ListView that displays a hyperlink to navigate to the K2 blackpearl’s ViewFlow of the specific activity’s K2 Workflow.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
First, we add a new property to our K2 SmartObject with type Hyperlink.
This property of type Hyperlink will be bound to one of the fields returned from our datasource.
It is important that the value returned from SQL, to be used as the hyperlink, is returned in a specific format.
This format is the basic Xml for a standard hyperlink control:
We now go to our K2 SmartForms ListView and bind the column to our hyperlink SmartObject field.
On our List method we assign the output bindings accordingly (not physically necessary, if your SmartObject is mapped correctly K2 will automatically bind the method’s return values).
The final result – a K2 SmartForms ListView with a column specifically for dynamic hyperlinks.
More about K2 SmartForms