CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Listbox Edit not selecting current record.

Print topic Send  topic

Author Message
DeWebDude
Posted: 10/30/2002, 11:02 PM

OK I have a listbox that works great in Add, and label, but if you edit the record, the list box is selecting the first item in the list box and not the value from the table, how can I correct this?

Thanks

I'm a newbie so keep it simple... thanks
Nicole
Posted: 11/01/2002, 12:48 AM

Hello,
The problem is caused by leading and/or trailing spaces in the field values. Once they are removed the correct item is selected from the listbox.
To overcome the problem you should trim spaces.

If you’re using CCS you can apply the function right in the common Classes.* file, namely to the Show() function of control handling class (its name is different in different languages). But you should find the code like (I/m providing asp example)
Result = Result & "<option value=""" & Recordset.Fields(BoundColumn) & _
""" " & Selected & ">" & Recordset.Fields(TextColumn) & "</option>"
and add trim() to selected fields:
Result = Result & "<option value=""" & Trim(Recordset.Fields(BoundColumn)) & _
""" " & Selected & ">" & Trim(Recordset.Fields(TextColumn)) & "</option>"
DeWebDude
Posted: 11/01/2002, 10:29 AM

I am using CC so CCS stuff won't help.
Also why would there be spaces, if the DB is providing the values for the drop down ?
jannaton
Posted: 11/04/2002, 7:06 PM

Nicole

I'm having the same problem. My prog can select new values from the listbox (table as datasource) and perform updates with no problem.

The Problem is when an existing record is loaded, the control does not show that fields value. The source of the control is set correctly and there are values in the table. It does show the default (Select Value) Message and selections can be made from the list box, but the actual value of the field is not displayed.

I can see how the leading/trailing spaces could be a problem but I think this is a different issue.




   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.