Highlighted

Dynamically setting button caption from Data Source using JavaScript

_Frederik-Jan_R

03-09-2008

Dear,



We use Interactive Forms in combination with SAP to generate forms in multiple languages. We usually do this using textfields and then linking all of those textfields to data we send from SAP. The data of these 'labels' is in a different language depending what you send through.



For buttons however we cannot simply link them in Binding so we decided to use Js to do it. There are already several checks in Js in place so I know the basics, but I can't figure out how to (a) retrieve data from the data sources and (b) how to set the button's caption using Javascript ...



Any ideas?



Thanks in advance,

Frederik-Jan Roose

Replies

Highlighted

pguerett

03-09-2008

Which data sources are you refering to?



To get access to a caption you will need:



Objectname.caption.value.text.value



The object assist will not have text in it (it will have #text). Simply use text in javascript and you will be OK.
Highlighted

_Frederik-Jan_R

03-09-2008

Setting/Retrieving the button name works, thanks!



I'm still not sure on how to retrieve data however. With data I mean the fields that are available under the Data View palette. (bottom left corner, next to Hierarchy for me)
Highlighted

pguerett

04-09-2008

Depends on the type of connection ....are you making a web service call (getting back an xml structure) and want to use that or is the data connection to sample xml or a schema?