on 04-22-2008 3:52 PM
Hi,
I am nearly going crazy (see also [here|;)...
So, here are the facts:
- Lifecycle designer 8
I have a Table POSITIONS which consists of 2 columns.
|-data
|--BodyPage (binding: none, )
|---- POSITIONS (binding: $record.IT_ITEM)
|------ LINE (binding: DATA[*], repeat row for each data item)
|----
WAERK (binding: WAERK)
|----
NETWR (binding: NETWR)
I want to concatenate field WAERK and NETWR into field NETWR.
I tried thouthands of possible codings, but I always get the value WAERK twice in my field NETWR...
E.g. I tried on hierarchy level "data" at event "ready:form":
var it_item_waerk = xfa.resolveNodes("data.BodyPage.Positions.Line[*].WAERK");
var it_item_netwr = xfa.resolveNodes("data.BodyPage.Positions.Line[*].NETWR")
for (var i = 0; i < it_item_waerk.length; i++) {
xfa.host.messageBox("I: " + i);
xfa.host.messageBox("WAERK: " + it_item_waerk.item(i).rawValue + " NETWR1: " + it_item_netwr.item(i).rawValue);
it_item_netwr.item(i).rawValue = it_item_waerk.item(i).rawValue + " " +
it_item_netwr.item(i).rawValue;
xfa.host.messageBox("NETWR2: " + it_item_netwr.item(i).rawValue);
}
But in the second message box the value
it_item_netwr.item(i).rawValue
already contains the value
it_item_waerk.item(i).rawValue
although the concatenation is in the folowing step
it_item_netwr.item(i).rawValue = it_item_waerk.item(i).rawValue + " " +
it_item_netwr.item(i).rawValue;
In the end the value NETWR contains WAERK twice (e.g. "USD USD 123")...
In addition to that the value "I" always jumps from 0 to its real value without clicking the "OK" button of the message box...
Who can give me an explanation for that?
Which event should I use for my coding?
THANKS.
Can you try as below.
Place a 3rd field, in the LINE subform with no binding. and hide the NETWR and WAERK fields.
On that field write script in form: ready; formcalc
text1 = $.parent.NETWR
text2 = $.parent.WAERK
$ = Concat(text1, text2)
May be in your coding you are using the same field for the next iteration also. try to clear the value for each iteration.
pavan meda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
try the same code with out binding the NETWR field in the form.
By default when form loads these concatenation vales need to display in NETWR , best place is initilize method of NETWR.
Regards.
malli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.