cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownbyIndex in a table column

Former Member
0 Kudos

Hello All,

The issue that i am facing is that i have a dropdownbyindex in one of my table columns. now when i try to select an entry from the dropdown, the next dropdown opens up. no matter where i click on the table UI, the dropdown opens up.

is this due to some coding error or something to do with correct properties and config. please do let me know. i am trying to figure this out from quite some time now.

Thanks a lot!

Accepted Solutions (0)

Answers (4)

Answers (4)

monalisa_biswal
Contributor
0 Kudos

I think u have binded datasource of table UI element to the subnode(whose singleton property is set to false)

Instead u bind it to the parent node.

Example:

Node A<-----Table's Data Source

---attr1

---attr2

-


Node B-(singleton false)

-


attr1<-----DropDownByIndex

Former Member
0 Kudos

Can you please describe exactly what you want to achieve?

Armin

konchada_saikrishna
Active Participant
0 Kudos

Hi Rubin,

As I under stood from your post,

In a table a particular colum is a drop down.

when you select a value from say 1st row, the dropdown value of 2nd row is changed, and vice versa.

If this is the case, your getting the coulmn value from a particular node.

which means all the row's dropdowns refer to the same node. obviously this problem arises..

Am I right, in your case,

Try changing the singleton property to "True"

Regards,

Sai.k.k

Message was edited by:

Konchada Sai Krishna

roberto_tagliento
Active Contributor
0 Kudos

Hello,

remember always to do before a search into forum and after post.

Must set singleton property to the context node of dropdown attribute.

Here some topic:

Former Member
0 Kudos

Yes Roberto, the singleton property was already set to false. Still we are facing the problem.

Former Member
0 Kudos

Hi Birgit,

Does u wrote any code in modifyView() that affects the dropdown?

Also the singleton property of the node should be false.

Can u send the onselect action of drop down

Thanks

Fahad Hamsa

Former Member
0 Kudos

Hi Fahad, you are right, I have some code in the WdDoModify:

Node structure is

V_UI_MISCLIST (node)

-


V_UI_MISCSERVICES (node with singleton = false, used for the dropdown)

-


attrib1

-


attrib2

-attirb a

-attrib b

.

.

public static void wdDoModifyView(IPrivateMisc_View wdThis, IPrivateMisc_View.IContextNode wdContext,

com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if (firstTime) {

IWDDropDownByIndex l_dropDown =

(IWDDropDownByIndex) view.getElement("DrpDown_ServiceType");

l_dropDown.mappingOfOnSelect().addSourceMapping("index", "p_Index");

}

if ((!firstTime)

&& (!(wdContext

.currentV_UI_Plug_FiredElement()

.getV_UI_Plug_Misc()

.equalsIgnoreCase("X")))) {

wdThis.compute_TotalCost();

}

//@@end

}

__________________________________________________________________

public void compute_TotalCost( )

{

//@@begin compute_TotalCost()

int node_size = wdContext.nodeV_UI_MiscList().size();

double qty, unit_cost, total_cost = 0.0, net_value = 0.0;

int len_mkup;

for (int i = 0; i < node_size; i++) {

total_cost = 0.0;

wdContext.nodeV_UI_MiscList().moveTo(i);

if ((!(wdContext

.currentV_UI_MiscServicesElement()

.getV_UI_ServiceType()

== null))

&& (!(wdContext

.currentV_UI_MiscServicesElement()

.getV_UI_ServiceType()

.equalsIgnoreCase("--- Select a service ---")))) {

// SOME PROCESSING

}

}

int miscSize = wdContext.nodeV_UI_MiscList().size();

if(miscSize>0){

if(wdContext.currentContextElement().getIndex_Lead_Selection()>=miscSize)

{

wdContext.nodeV_UI_MiscList().moveLast();

}

else {

wdContext.nodeV_UI_MiscList().moveTo(wdContext.currentContextElement().getIndex_Lead_Selection());

}

}

//@@end

}

_______________________________________________________________

THIS ACTION IS ATTACHED TO TABLE OnLeadSelection EVENT

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

{

//@@begin onActionsetLeadSelection(ServerEvent)

wdContext.currentContextElement().setIndex_Lead_Selection(

wdContext.currentV_UI_MiscListElement().index());

//@@end

}

_________________________________________________________________

ON SELECT ACTION FOR DROPDOWN

public void onActionselectService(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, int p_Index )

{

//@@begin onActionselectService(ServerEvent)

wdContext.nodeV_UI_MiscServices().setLeadSelection(p_Index);

//@@end

}

Former Member
0 Kudos

Hi Birgit,

I think u made the program complex. Can u tell me wat is ur requirement?

Thanks

Fahad