cancel
Showing results for 
Search instead for 
Did you mean: 

Change binding of field at runtime

Former Member
0 Kudos

Hello experts,

I have inserted a decimal field without default binding in my adobe form. Now I try to implement a dynamic binding of this field. So I inserted javascipt code in "initialize" of this field as follows:

this.bind.match="dataRef";

this.bind.ref="DATA[2].field1";

I got no syntax error and no output data. If I fill the default binding of the binding-tab of this field like

DATA[2].field1

I will get the correct output data!

Do you have any ideas, whatu2019s wrong?

Thanks

M.Albrecht

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hello expert,

thank you for your suggestions to solve the problem.

There is one important point, which squeeze me not to change the ABAP coding. The ABAP which collect the data for the form must not be changed! It feeds a SMARTFORMS form and it should feed an AdobeForm in future as well. With a customizing flag I will change between SMARTFORMS and AdobeForms. So I am forced to use the data source for AdobeForms as well.

When I process a table with body and footer I have only one problem: always in the last record of the table I must print some values in the footer. I know that a static binding to the last record in footer will bring the correct output. But the tables have different number of records, so that I thought a dynamic binding which I can change at runtime could be the solution.

But now I think that this isn't possible. So I will try to feed the footer-fields with javascript when the last record of the body is processed. I will post my solution as soon as I have implemented it in the form.

Thanks to all!

matt
Active Contributor
0 Kudos

Please keep conversations civil. What is considered arrogant by one person, may be considered banter by another.

Now, I've not done Adobe forms for a long time - I even had to look up the transaction - but though you can't change the abap that supplies the data, can you not add ABAP into the interface to do the additional work?

Former Member
0 Kudos

Yes, you are right! I was a little bit exercised about this kind of conversation. Maybe this is due to the fact, that I am new in a forum.

Your suggestion to add the ABAP in the interface is a very goog idea. I will implement this solution! In the mean time I had worked out a solution with javascript. But this variant is no good way, because the performance will be more bad. When you print many hundreds of forms you will see it.

So I decided to implement your suggestion and expand the interface.

Thank you!

OttoGold
Active Contributor
0 Kudos

How to deal with SAP-standard Adobe forms: /people/otto.gold/blog/2010/05/06/how-to-deal-with-sap-standard-adobe-forms

OttoGold
Active Contributor
0 Kudos

Hello, I wonder how did you like our suggestions and how did you solve your problem? We expect you share the solution with us. To provide feedback is a part of good manner here. Regards Otto

Former Member
0 Kudos

Hello experts,

I am sorry for my late reply, but I was very busy and had no time to work with the form. But I will give you a feedback as soon as I can.

Thank you for your advices!

Former Member
0 Kudos

Hi M.Albrecht,

For me, if i want to dynamic change the value during runtime i will directly assign the value using rawValue property.

if( <condition>)

this.rawValue = DATA[2].field1.value;

Hope this helps.

regards,

Xiang Li

ChrisSolomon
Active Contributor
0 Kudos

Check the Adobe forums....the Livecycle forums on the official forums or better yet, check the Javascript forums on www.acrobatusers.com/

OttoGold
Active Contributor
0 Kudos

I have enever tried this, so cannot provide a "proper" solution.

But why don´t you create few fields with the static binding and create a field with no binding but with script which copies the value from one of the fields with value (from the static binding) at runtime? Based on the condition...

Or you can directly assign the value into the field from different parts of the context without the extra fields suggested as option one and address the context value you need the value from in the script directly.

regards Otto

Former Member
0 Kudos

Hello, thank you for your advice. I have already tried this, before I posted my problem and it works. But that's no good solution for my core problem. I didn't mention it but basically I want to print a table with x body-lines and one footer. The values in the footer line are part of the last record of the table! So I looked for a solution to access the last record of the table dynamically at runtime.

OttoGold
Active Contributor
0 Kudos

Then you didn´t read any of my zillion posts about it, nor the blogs and didn´t get how the forms work.

If you want to have things separated in the layout you´d better separate them in your data, means: use your background coding (ABAP) and an extra DDIC definitions to separate the table into a table and a structure (single row) what will make all things much easier for you in the form design phase.

Regards Otto

Former Member
0 Kudos

Hello Otto,

you are right, I haven't read any of your posts. But I won't tolerate that you allege that I didn´t get how the forms work! Sorry but you seem to me very arrogant. So please stay away with your proposals for solution!