Skip to Content
0
Former Member
Apr 24, 2007 at 06:27 AM

Radio Button As Table Cell Editor

263 Views

Hi everyone, i have search this subject and find 2-4 thread,and i have followed this threads but still i cannot success completely. I will explain my problem. I have table like this

A

B

111

xxxx

222

yyyy

333

zzzz

and I will show it as "

A

B

o

xxxx

o

yyyy

o

zzzz

| Ok | | Cancel | -> button OK and Cancel

  • o --> radio button

So when i click one of the radio button and I click Ok button I will send value 111 for xxxx, 222 for yyyy, 333 for zzzz,....

I have create context like this

-Table Proficiency (value node) caldinality 1...n singleton true

--RadioButton (value node) cardinality 0..1 singleton false

---KeyToSelect --> string

--CellDescription --> string (will show xxxx,yyyy,zzzz)

--Selected Key --> string (value 111,222,333)

My code like this :

public void wdDoInit()

{

initView();

}

private void initView()

{

IPrivateCompetencyHelpView.ICprofElement profElement = null; // model element

int size = wdContext.nodeCProfsize(); // model node that become source data

IPrivateCompetencyHelpView.ITableProficienyElement currentElement = null;

for(int i=0;i<size;i++)

{

profElement = wdContext.nodeCprof().getCprofElementAt(i);

currentElement = wdContext.nodeTableProficiency.createTableProficencyElement();

if (condition ...)

{

currentElement.setCellDescription(profElement.get...());

currentElement.setSelectedKey(profElement.get...());

wdContext.nodeTableProficiency().addElement(currentElement);

}

}

}

in supply function for radio button

public void supplyRadioButton(IPrivateCompetencyHelpView.IRadioButtonNode node, IPrivateCompetencyHelpView.ITableProficienyElement parentElement)

{

//@@begin supplyRadioButton(IWDNode,IWDNodeElement)

IPrivateCompetencyHelpView.IRadioButtonElement elem = node.createRadioButtonElement();

node.addElement(elem);

elem.setKeyToSelect(parentElement.getCellDescription());

//@@end

}

public void onActionClickRadioButton(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionClickRadioButton(ServerEvent)

for(int i=0;i<wdContext.nodeTableProficieny().size();i++)

{

if (i != wdContext.nodeTableProficieny().getLeadSelection())

{

wdContext.nodeTableProficieny().getElementAt(i).setAttributeValue("SelectedKey",null);

}

}

//String key = wdContext.nodeTableProficieny().currentTableProficienyElement().getSelectedKey();

//wdContext.currentContextElement().setHasil(key);

//@@end

}

My question is why i still can choose radio button more than one so if i click all radio button the all radio button is in condition clicked(X) and when I click, the value for column B is changed to from CellDescription become SelectedKey even i have binding column B to CellDescription ? Thank you

Regards,

Satria