cancel
Showing results for 
Search instead for 
Did you mean: 

ItemListBox deselection problem

Former Member
0 Kudos

Hi All,

I have used an ItemListBox for multiple selection.

1. For that I created a ValueNode (say, Countries) with following properties changed:

selection 0..n

initializeLeadSelection false

remaining properties are default.

Now created a Value Attribute countryName under Countries of type string.

2. Created an ItemListBox with properties I have changed:

dataSource: Countries

multipleSelection: true

text: countryName

3. Created a button to check selected items.

My problem is when I have select none(First Time) or one or more item and click on Check button result is right.

But when deselect all item after selecting one or more and click on Check button then last deselected item is showing as it was selected.

Is I am missing somthing or its a bug?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It's a bug in your version. Please open an OSS message (BC-WD-CLT-HTML).

Armin

Former Member
0 Kudos

Hi Armin,

First thanks for your answer.

But I am not opening another thread to ask how to open an OSS message (BC-WD-CLT-HTML)?

Thanks in advance.

Subhendu

Former Member
0 Kudos

Hi,

Link is

https://websmp108.sap-ag.de/message

You need a SAP MarketPlace ID (SUserID ) to raise a OSS.

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks Ayyapparaj.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can try with the following code

wdContext.node<YourNode>().setLeadSelection(-1);

wdContext.node<YourNode>().clearSelection();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Manoj and Ayyapparaj,

The code segment you have written is the serverside code.

As I need to capture the selected elements in the serverside to process the request and use those code segment before/after capture, everytime I will found no items selected in the view even if somthing selected. And also the previos problem will persists. Its not acceptable.

For your information, sharing my knowledge that I discover is,

SAP uses JavaScript for value insert/change in any UI elements through HTML events. When we click/change information some HTML events (onclick, onchange,onkeypress etc) triggered into the window and SAP tracks those event and set the value to their defined JavaScript Object/Array to process later on.

Ultimately when we submit the form-data it fetches those data from there not from the UI display data and send it to the Server. Server captures those data from the request object and parses those data and process.

The reverse process is for response view creation.

If you change or clear the selection then when the view will be created it will be reflected on the view.

But the problem will be same.

My resolution on the situation is that its a bug. I think when the user deselect all then the last deselected item is not cleared from the object/array that they uses for storing the user entered data and that data is submitted to the Server.

Feel free to share if I am wrong.

Thanks

Subhendu

Former Member
0 Kudos

Hi,

Capture the selected item and then send it for further processing or whatever you want to do and then at the end clear the selection.

How the previous problem still persist. After clearing the selection there will not be any selected items. In your case click your check button again and see.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi,

If your problem is with the client side caching, trigger a round trip, just assign an action to the listbox and make it validating.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Manoj,

The way you are telling let me say If you select one or multiple items what the user will see after click on the Check button?

No item selected is it the desiarble output??

Former Member
0 Kudos

Hi,

Ya i know that user will not be aware of the selection after any event.

It depends upon your requirement.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Manoj,

Please don't waste time yaar. Don't give such vauge answer that it depends on your requirement. My requirement is specified in detail. If you have suggestions on this mostly welcome.

Please read my problem carefully once again to give answer

I am repeating that

My problem is:

"When I have select none(First Time) or one or more item and click on Check button result is right.

But when deselect all item after selecting one or more and click on Check button then last deselected item is showing as it was selected."

Thanks,

Subhendu

Former Member
0 Kudos

Hi Ayyapparaj,

As I know for ItemListBox there is only one Event onLeadSelection and it only triggered for Single Selection (multipleSelection is false) not for Multiple Selection(multipleSelection is true).

And it only triggers for selection not deselection (though for Single selection there is no deselection happens by user. User only select any other item to deselect the previous one.)

Can you describe How to do that? How to trigger a round trip to clear the client side cache here?

Thanks,

Subhendu

Former Member
0 Kudos

Hi,

Well first of all i am not here to waste mine or anybody's time. Secondly the suggestion was based on your statement only.

As you said, "But when deselect all item after selecting one or more and click on Check button then last deselected item is showing as it was selected".

What i am trying to say here is you are deselecting the items by clicking one of the items. In this way you are selecting one of the items which is getting displayed on click of Check button. This will be solved if you clear the selection. Offcourse after the event selected items will not be highlighted.

My intention was just to provide you with a solution.

Anyways its upto you how you do it.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Manoj,

The Statement you quoted its a partial statement right?

Is it the right way to give solution based on the partial statement.

I think you have not understand my problem anyway its your way to give answer and obviously I have to decide how to do it

Thanks for your valuable comments and suggestions to decide my solution.

Former Member
0 Kudos

People,

please stay polite or I will remove this thread.

Armin

Former Member
0 Kudos

Hi,

Well you can clear the selection of the node using:

wdContext.nodeCountries().clearSelection();

This is the way to deselect.

Hope it will solve your problem.

thanks & regards,

Manoj