CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Ragged Listboxes on Search form

Print topic Send  topic

Author Message
Paul Shearing
Posted: 12/11/2005, 6:37 PM

Where there are several listboxes on a search form, when the page is displayed, irrespective of how neatly you align the listboxes at design time, it all goes out of the window and the width of each listbox is dynamically derived from the widest text in the list.

This is very clever but produces a) apalling-looking search forms that appear to have been designed by a five-year old b) forms that are sometimes too wide for XGA resolution browsing. (I should perhaps explain that there are a large number of search criteria on my forms so I have to redesign them to be multi-column.)

Is there a simple way of controlling the width of listboxes on search forms at run-time, even if this means truncating some of the longer items in each list? I would like all listboxes in a column to have the same width irrespective of their content.

Kind regards

Paul
peterr


Posts: 5971
Posted: 12/11/2005, 11:21 PM

You can use an SQL statement as your listbox data source that would truncate the data. I think that many databases support LEFT function:
http://www.google.com/search?q=sql+left+function
http://msdn.microsoft.com/library/default.asp?url=/libr...s_left_7910.asp
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Walter Kempees
Posted: 12/12/2005, 1:43 AM

Another way to unrag your listboxes is:
In your stylesheet or through inline-style commands create a class (or as
many as you need)
..width50 { width:50px }
..width75 { width:75px }
..width100 { width:100px }
..width200 { width:200px }
..width250 { width:250px }
..width300 { width:300px }

(of course whatever fit's your needs.)

Then in the Select add the style. You can make them all even length by
adding the same style to all.
In fact we line them to the same size in 1 screen adapted from the largest.

  
 <select name="{field}" class="width100">  
    ......  
</select>  
  

Hope this helps.

Walter




"peterr" <peterr@forum.codecharge> schreef in bericht
news:6439d24f53a0fd@news.codecharge.com...
> You can use an SQL statement as your listbox data source that would
> truncate the
> data. I think that many databases support LEFT function:
> http://www.google.com/search?q=sql+left+function
> http://msdn.microsoft.com/library/default.asp?url=/libr...s_left_7910.asp
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Walter Kempees
Posted: 12/12/2005, 1:49 AM

Afterthought:
The class can be added to the Select box's properties->Format->class.
It will immediately show up in Designer if you did it right.

"Walter Kempees" <kempe819@planet.nl> schreef in bericht
news:dnjgo9$u8t$1@news.codecharge.com...
> Another way to unrag your listboxes is:
> In your stylesheet or through inline-style commands create a class (or as
> many as you need)
> .width50 { width:50px }
> .width75 { width:75px }
> .width100 { width:100px }
> .width200 { width:200px }
> .width250 { width:250px }
> .width300 { width:300px }
>
> (of course whatever fit's your needs.)
>
> Then in the Select add the style. You can make them all even length by
> adding the same style to all.
> In fact we line them to the same size in 1 screen adapted from the
> largest.
>
>
  
> <select name="{field}" class="width100">  
>    ......  
> </select>  
>  
> 
>
> Hope this helps.
>
> Walter
>
>
>
>
> "peterr" <peterr@forum.codecharge> schreef in bericht
>news:6439d24f53a0fd@news.codecharge.com...
>> You can use an SQL statement as your listbox data source that would
>> truncate the
>> data. I think that many databases support LEFT function:
>> http://www.google.com/search?q=sql+left+function
>> http://msdn.microsoft.com/library/default.asp?url=/libr...s_left_7910.asp
>> _________________
>> Peter R.
>> YesSoftware Forums Moderator
>> For product support please visit http://support.yessoftware.com
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

Paul Shearing
Posted: 12/12/2005, 9:03 AM

Thanks Walter and Peter.

I'll pursue the class option first - it seems to me to be more in line with the general ethos of web programming.

I like the truncate solution, but it is a little more involved because I need not only to truncate but to pad all selection strings before truncation to the same length otherwise a dropdown list which contains only short length items will appear narrower than the rest. In SQL 2000, the Select Statement for two fields to populate a dropdown would be something like:

SELECT INT_Field, LEFT(Name_Field + ' ___________', 20) AS ID_Name FROM XX

As long as the string of spaces (shown here as ' ___________', because this forum contracts multiple spaces into a single one) is at least as long as the following constant, this guarantees that the field will always be, in this case, at least 20 characters long. You would have to take other measures if Name_Field contains Null.

Presumably the truncation technique is also dependent on using a fixed-width font

Thanks again guys. As ever - good feedback and help on this forum.. 8-)
Walter Kempees
Posted: 12/12/2005, 12:47 PM

Thanx, and if you want them smaller than the content, the class will really
truncate them.
Walter
peterr


Posts: 5971
Posted: 12/12/2005, 1:34 PM

I didn't know this, so kudos to Walter.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Walter Kempees
Posted: 12/12/2005, 1:38 PM

YOOOO my first kudos.
"peterr" <peterr@forum.codecharge> schreef in bericht
news:6439decf912184@news.codecharge.com...
>I didn't know this, so kudos to Walter.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Walter Kempees
Posted: 12/12/2005, 1:43 PM

Kudos from the Greek ????? (kydos, meaning "magical glory") means "fame and
renown resulting from an act or achievement; prestige" thus by logical
extension is often used as a praising remark. It entered English as British
university slang in the early 1800s. Frequently used by Time magazine, it
came to America in the 1920s and 1930s.

I had to know, sorry

"Walter Kempees" <kempe819@planet.nl> schreef in bericht
news:dnkqoo$k8i$1@news.codecharge.com...
> YOOOO my first http://www.kudosbar.com/kudos/
> "peterr" <peterr@forum.codecharge> schreef in bericht
>news:6439decf912184@news.codecharge.com...
>>I didn't know this, so kudos to Walter.
>> _________________
>> Peter R.
>> YesSoftware Forums Moderator
>> For product support please visit http://support.yessoftware.com
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

peterr


Posts: 5971
Posted: 12/12/2005, 2:01 PM

Hello Walter,

kudos = praise or flattering comment
I suspect that it is the same "kudos" as from the Greek :-) , at least based on a quick Google lookup: http://www.google.com/search?q=define%3Akudos
And thank you for answering so many questions on the forums :-)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Walter Kempees
Posted: 12/12/2005, 3:03 PM

Thanks,

(anotherone comming, solved Sixtos dependant listboxes, but need help. PhP
Thread)

"peterr" <peterr@forum.codecharge> schreef in bericht
news:6439df34aa972b@news.codecharge.com...
> Hello Walter,
>
> kudos = praise or flattering comment.
> I suspect that it is the same "kudos" as from the Greek :-) , at least
> based on
> a quick Google lookup: http://www.google.com/search?q=define%3Akudos
> And thank you for answering so many questions on the forums :-)
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Paul Shearing
Posted: 12/15/2005, 4:52 PM

Knockout Walter! The search forms look really great now. I think that this really deserves to built into the CCS Style manager it makes such a difference to the appearance of the forms. IMHO the difference between amateur and professional Perhaps an option for ragged widths (as it currently is) or all text and listboxes to be a proscribed width.

Thanks again.

You really set a hare running with the Kudos thing Peter.
Walter Kempees
Posted: 12/16/2005, 1:33 AM

Your welcome, glad it did the trick.
Paul Shearing
Posted: 12/22/2005, 5:25 AM

Phanthom Style Zapper

I am finding that the additions I made to the style sheet are periodically being removed. I have to keep editing the style sheet to reintroduce them.

This is on the development system only. So far, the changes have remained stable on the live website.

I haven't opened the style sheet within CCS, just applied it to new CCS pages as they are being developed.

Any ideas?

Paul
Walter Kempees
Posted: 12/22/2005, 8:08 AM

Paul,

Where did you apply the changes ?
From your question I deduct you changed the Style.css in your style\<name>
subricetory.
If that's the case than occassionaly it is probably being overwritten by the
original in Program Files\C.....
My instinct says change the attribute on the file to read-only.
Another approach would be to use an inline style which would work as an
add-on to the Style.css.
You could of course appy your changes to the Style.css in the Program
Files\CodeCharge Studio3\... styles directory.
Then only downloading installing a newer version of CCS would mangle them.

Inline style could, by the way, be incorporated in the default HTML file, if
your using one.

Walter

Add new topic Subscribe to topic   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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