You can change the caption of text widget dynamically using dynamic classes and CSS. Not always a recommended way but it is a workaround if you are looking to manipulate text on the client side.
On your caption text widget, in dynamic classes add an expression based on the attribute value (condition) to change the caption. For example,
if $currentObject/Name = 'Name123' then 'customCaption' else ''
Here customCaption is a CSS class. In definition of this CSS class, you can provide the updated caption and hide previous one like this
.customCaption {
position: relative;
visibility: hidden;
}
.customCaption:after {
content: 'updated caption';
visibility: visible;
position: absolute;
top: 0;
left: 0;
}
Another option could be to use another attribute in the entity for caption. And whenever your value attribute changes, change the caption attribute accordingly. This will show the updated caption on your page taken from the caption attribute in the entity.
Hi Nathan,
thank you, but how can i specify parameter using expression for text caption. don’t think it is possible. hope i am wrong.
what I need is some thing like this:
if $param value is ‘aa’ then caption ‘abcdef’
else if $param value is ‘bb’ then caption ‘xxxxx’
Thanks Umar!!