How to use dynamic classes for an input text box?

0
Hi all, Im trying to use dynamic classes for an input text box, I want to add two different styles, based on expression. I have gone through documentation but it is not clear. If anyone have any suggestions, please share here.   Thanks  
asked
3 answers
2

Hi Vijay,

     To apply the dynamic class navigate to text box properties and navigate to dynamic classes , In that for eg : If i have classes Active and Inactive means 

If if $currentObject/OTP = empty  and then trim($currentObject/OTP) != '' 'Active' else 'Inactive'

answered
1

Hi Vijay,

Adding dynamic class for the text is possible so want to use the same expression you are using to show the value to user use the same expression for dynamic class as well. Select the text widget and go to the properties and select styling there you can find the dynamic class.

Add the expression with current object or based on the data view you configured… or list view… Example, I have a name attribute.

 

So need to highlight the attributes name if it’s not empty.

 

Expression: if trim($currentobject/name) !=‘ ‘ then ‘active’ else ‘ ‘ So active will be act as a dynamic class for that particular attribute widget so you need to add the styling for that in VScode

 

.active{

Background-color : red

}

Regs,

subash JS

answered
1

Hi Vijay,

 

Open text box we a dynamic class option

image.png

 

Add CSS based on condition

image.png

answered