List Box unselect items everytime the process reaches "End"


I have done something like this to validate the inputs of the rest of the form. I did a debugger and monitor the ListBox very closely on every step. The selected items were all unselected upon the processes of "End" finished. Why is that happening and how to work around with it?

Hi Stephen, 

Something important to keep in mind when Debugging is that the application is optimized. 

If you don't use something, it will not be stored. 

Só, if you are not yet using the values in the list of the List box, the platform, at compile time, will detect it and will not create the code to keep those values between requests. 

If it is not the case, please, give more context, like how you are using this list, etc. 

Cheers 

Can you provide  an oml of that  loop.

Eduardo Jauch wrote:

Hi Stephen, 

Something important to keep in mind when Debugging is that the application is optimized. 

If you don't use something, it will not be stored. 

Só, if you are not yet using the values in the list of the List box, the platform, at compile time, will detect it and will not create the code to keep those values between requests. 

If it is not the case, please, give more context, like how you are using this list, etc. 

Cheers 

Hi Eduardo Jauch,

Thanks for your response. It happens not just when the debugger is on, I only turned on the debugger to check when this problem already happened. 

And what do you mean by the values are not used? I thought the variable is set once the end users clicked on the values

Hi Stephen, 

The values selected are sent to the server. Only at the server side the variables are set. But if you have a variable you are not using, the compiler will optimize the code to avoid keep values in the viewstate and consume bandwidth sending to the server something it is not used. 

When a value does not persist between calls, this is the first thing I check. Are the values really being used? 

In any case, it is not really possible to help you if you don't provide more information. 

The best of possible, is to provide the module where you have the problem, or even better, a very small app that can reproduce the problem. 

Help us help you ??

Cheers