Skip to Content
Former Member
Oct 13, 2011 at 02:26 PM

Dropdown values in adobe form -ABAP binding and javascript issue



We have 2 dependent dropdown lists, dropdown A with values( 1,2,3) & dropdwon B with dependent values ( 1X,1Y,2X,2Y,2Z,3X,3Y). B values are dependent on A and it works perfectly fine when we fill first time ie NEW form .We have peice of javscript code which works fine which is placed in ON CHANGE of A, B Dropdown values are reflecting correctly.

Now when we want to change existing form we are bringing all vallues from ABAP backend from WDOINIT.

We are already binding old is now showing previously selected values in dropdown A & B

but the problem in DROPDOWN B has now ALL values ( 1X,1Y,2X,2Y,2Z,3X,3Y). of dropdown A(it should only have selected values) for ex: if we select dropdown A with 1 it should show only 1X,1Y

In order to resolve this I wrote below code in INITIALIZE event of DROPDOWN A..Now it brings respective values of dropdown B but my previously selected value in drodown B is disappeared.In other words SCRIPT is over writing the ABAP Backend Binding of the dropdown B.

How can we over come this issue..I need both of them to work.. I need abap binding value (to retain previous value) and I need SCRIPT ( to store respective records ex: if we select dropdown A with 1 it should show only 1X,1Y )

termaction is Dropdown A , reason is dropdown B

		var termaction = this.rawValue;  
//above statement would brings current value of slected term action from 1st drodown

 				this.resolveNode("Reason").rawValue = null;
	var DataBinding = Reason.bind.ref;
	// the data binding may contain "$data.<root data name>" instead of $record
	DataBinding = DataBinding.replace("$data.","$record");
	DataBinding = DataBinding.replace("$record.", "");
	DataBinding = DataBinding.replace("$.", "");
	hasItems = true;
	var reasonitemNode = 	xfa.form.resolveNode(""+".sap-vhlist."+DataBinding.replace(/(\.)/g,"\\.").replace(/(\[\*\])/g,""));
	  			var reasonitemNodes = null;  
	  			if (reasonitemNode == null) {
					hasItems = false;
	  			else try {
					reasonitemNodes = reasonitemNode.nodes;
	  			} catch(e) {
					hasItems = false;

				console.println("Length:" + reasonitemNodes.length);
	  			if(hasItems == true) {
					var found = 0;
					var temptermaction;
					for (var i = 0; i < reasonitemNodes.length; i++) {
						temptermaction = reasonitemNodes.item(i).key.value;
						temptermaction = temptermaction.substring(0,2);
						temptermaction = temptermaction;
						if (termaction == temptermaction)




Edited by: Varaprasad kandagatla on Oct 13, 2011 4:27 PM

Edited by: Prasad on Oct 14, 2011 4:56 PM