Hi, let say I got a field that is data driven, and I want to add something, for example, a - character after.
So, instead of showing "Field Value", it should show "Field Value -".
How can I add the "-" after the data driven value?.
(I've tried + "-" and some stuff like that without success)
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Is there a relationship between the element bound to the rawValue and the element you want bound to the caption. Something like;
<accountDetail>
<productName>Test</productName>
<productQty>3</productQty>
</accountDetail>
So if the rawValue is bound to productQty then the following code in the initialise event will set the caption value;
this.caption.value.text.value = this.dataNode.parent.productName.value + "-";
this.dataNode refers to the element the rawValue is bound to, so this.dataNode.parent refers to accountDetail, etc.
Regards
Bruce
Views
Replies
Total Likes
on what event are you trying to do this? the exit event?
Views
Replies
Total Likes
No, in the data binding.
Views
Replies
Total Likes
mhmmm, you are using javascript?? cuz using the operator '+' should be working if you are using it this way:
var strField = textField15.rawValue + "-";
if you are trying to change the value directly, use the operator '+='
TextField15.rawValue += "-";
Views
Replies
Total Likes
I've tried that in the caption property of the text field, but it's not working (it works in the rawValue though)
I've tried this:
this.caption.value += " -";
or this:
this.caption.value = caption.value + " -";
Neither worked.
Views
Replies
Total Likes
How about in the initialize event of your field:
this.rawValue = this.dataNode.value + " - ";
Kyle
Views
Replies
Total Likes
But, rawValue always is related with the value of the text field, not with the caption. I need to alter the caption.
Views
Replies
Total Likes
To alter a caption you would use this.caption.value.text.value.
Kyle
Views
Replies
Total Likes
That works, but it copies the same value into the field .
Views
Replies
Total Likes
So, let's clear some things up. You want a value from a data binding to go into your caption with some added hard coded text?
If so, what's the data binding string itself ($.MyData.CaptionCollection.Caption)? Do you use dynamic properties?
Kyle
Views
Replies
Total Likes
Yes, I want the caption of the text field to contain a text from my data source + a hardcoded string, in this case, a "-".
The binding is something like accountDetail.productName.
Not sure what you mean by dynamic properties, I set this value clicking in the gree caption text link thingy and then I searched for my source of data.
Views
Replies
Total Likes
Hi,
Is there a relationship between the element bound to the rawValue and the element you want bound to the caption. Something like;
<accountDetail>
<productName>Test</productName>
<productQty>3</productQty>
</accountDetail>
So if the rawValue is bound to productQty then the following code in the initialise event will set the caption value;
this.caption.value.text.value = this.dataNode.parent.productName.value + "-";
this.dataNode refers to the element the rawValue is bound to, so this.dataNode.parent refers to accountDetail, etc.
Regards
Bruce
Views
Replies
Total Likes
Bruce, hi, that works, but I'm having the same problem as before, it changes also the dataField rawValue also.
So, instead of having:
"My product name": value
I end up having
"My product name": "My product name"
It is like the caption value is copied to the field value.
Views
Replies
Total Likes
Nevermind, it worked if I put that code in the initialize event.. weird, I wonder why.
I guess I have to long way still ahead to learn how Designer works .
Thanks Bruce!.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies