0

I have an Intraweb application which is using the TTIWDBAdvWebGrid component. Two columns of the grid are comboboxes (editor is set to edCombo) - look at the picture below

enter image description here

What I want is that when one of the comboboxes is changed the other changed it's value to opposite (if first is YES then the other is NO).

I've tried with javascript code at the ClientEvents-combochange

valcb=GetEditValue(IWDBGESTANTObj,c,r);
if (c==5 )
{
if (valcb='OUI ') {SetCellValue(IWDBGESTANTObj,6,r,'NON'); }
else {SetCellValue(IWDBGESTANTObj,6,r,'OUI');}
} 

but this code changed the values from the second combo to nothing....

How can I resolve this?

Community
  • 1
  • 1
RBA
  • 12,337
  • 16
  • 79
  • 126
  • 2
    Might be nothing, but in your code extract, the first string comparison seems to have at least one trailing space in the string -- `if (vaclb='OUI ')`. At the very least i would be using constant values rather than repeat string literals. – Stuart Jun 02 '11 at 12:48
  • @Stuart - very good remark. thank you – RBA Jun 02 '11 at 16:10
  • I will accept my own answer until another/better answer is given – RBA Jun 04 '11 at 10:43

1 Answers1

0

Resolved by using the following javascript code:

if (c==5)
 {wId = "G0D" + r + "C" + (c + 1);}
else
 {wId = "G0D" + r + "C" + (c - 1);} 
myCombo = document.getElementById( wId);
if (ctrl.selectedIndex==0) 
{ wInd=1;}
else
{wInd=0;}
myCombo.options[wInd].selected=true;

Intraweb is generating the id for each combo by concatenating the following elements "GOD" + row_number + "C" + column_number

This code must be set on the ClientEvents-ComboChange property

enter image description here

RBA
  • 12,337
  • 16
  • 79
  • 126