Skip to main content


 

Symptoms


I am working on a task where the client want to use an editable list view to store hyperlink as values. However, instead of using the default hyperlink input control, the client want to use the andltText Boxandgt control as the input field.

The problem is, if I changed the input control from andltHyperlinkandgt to andltText Boxandgt, when I want to edit on a row that already has hyperlink data, the value within the control will presented with html andltaandgt tag surrounding the values.

 

Diagnoses


Use two parameters and hidden fields.
 

Resolution

For the SmartObject, have two url properties:
- One of type text (textURL)
- Other of type hyperlink (hyperlinkURL)

On any viewform, have controls for both, but hide whatever is not needed.
When addingediting the URL, have an 'on change' rule for textURL to transfer the control to the hyperlinkURL control. K2 will handle transforming the text to hyperlink.
When viewingclicking the URL, just show the hyperlinkURL as a hyperlink control.

Note: If you are adding the URL in an editable list view, add a condition to only transfer if textURL if it contains a value.

Use default createsaveloaddelete methods.




 
Be the first to reply!

Reply