Andy Crane

Greenhorn
+ Follow
since Dec 30, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Andy Crane

First, is the value of the "lengthy line" dynamic? If not, just add a
tag wherever you'd like it to wrap.

Second, have you tried predefining the width of the column?

My thinking is that unless Firefox has a great reason to break that word, it's not going to. And the only great reason as far as Firefox is concerned is if the word will not fit the defined width of that TD, then it'd wrap it.
I agree with Eric. Well, agree may not be correct, as in, he's right, you're not going to submit that form unless you use javascript.

He's got the correct way to think about it as well. You're not refreshing the page on timeout, you're submitting the form on timeout.

You can provide a message for the noscript users letting them know that the page will not refresh and that they will need to click submit in order to submit the form.

The other users won't be impacted at all this way.
yer not supposed to center a pre tag.

It's meant to just display EXACTLY what it contains, including spaces, etc.

Center the element that contains the pre tag.

I'm not entirely sure I understand the issue either.

Is the div floated? By that I am asking, do you have a CSS style for that div that contains float: left (or right).

If you do, make sure you close the float.

Also, you may want to try relative positioning on that div. This will position it "relative" to the element right before it.

Hey Dave,

If you're just trying to get one alert, you can set a boolean flag and just check it when you call the alert.



It may work by just removing the brackets where you have concatenated it to the querystring.

Or use toString.

Then, there is an excellent chance that you're taking a comma delimited list of form values (native state) and creating an array so that you can create a comma delimited list of those same form values. (this is what it looks like to me) If this is the case, then you're using the id attribute incorrectly. An id should only be used one time on a web page. That why there is no: document.getElelementsById().

If the id's that you're calling in your code are referencing a collection of form fields, then you should be using the name attribute instead.
You need to make a comma delimited string of the id's. You can only pass strings via a querystring, not objects.



The only way is to make it a multi-select, then you define the number of options that display at one time, but they're always there, not just displayed on clicking the arrow and the user can select more than one.

That being said, I'd bet that someone, somewhere, has gotten all creative on this and came up with a jquery workaround.

Eric Pascarello wrote:Make sure to put your browser in compliance mode by adding a doctype to the top of your html pages. You should install the web developer toolbar to figure out what is going on with IE's CSS. You should validate your HTML markup. You should remove styles and add them one by one and see what is not being applied.

Eric



Eric, I missed this on my first run through the responses. You've hit on a key issue in my opinion.

If you do not define a doctype at the top of your page you will NOT get IE to behave as you would expect it to. Even the IE CSS hacks break without a doctype. Trust me on this one, make sure every web page you serve has a doctype. Or take the number of hours for your project that were allotted to front end development and double it.

David Newton wrote:The best place to start is with a reset CSS (I've used Yahoo's, but there are many others) and build the rest of the CSS up from that.

There are lots of IE workarounds (especially IE6, at least in my experience). I try to let other people solve those types of problems--and the web is full of people who have.



This is a great place to start! It puts all of the browsers on an even playing field.

Anyway, if you're still experiencing some IE issues with how things are laid out from one browser to another, a great place to check for known bugs and fixes for IE is Position Is Everything.

One thing that I've noticed can get a lot of developers in trouble is floats. Floats are awesome for layout, if used and closed correctly. If not, they can be a nightmare if you're not familiar with them.

Of particular note is the padding + float bug in IE. For example:

You have set a global style for paragraphs that states "padding-left: 40px;", and everything is fine in IE and FF. Then you have a paragraph that you need to add "float: left;" to. You do that, and in FF it looks great, but in IE it has 80px of left padding, instead of the 40px that you defined.

This is because IE always doubles the left padding on elements that are floated left. To fix it, just add: "display: inline;" to the style for that particular paragraph (not to the global style). This fix does not adversely effect any other browsers while fixing the issue in IE.



Another way to avoid browser issues for your overall layout is to keep in mind that if something has a defined width, do not add left or right padding to it. The same goes for height and top or bottom padding. You'll find that if you define a width of 100px to an element, and then give it this: "padding: 0px 25px 0px 25px;", that it will actually take up 150px, instead of 100px. This is true in all browsers that I am aware of.
One big reason is reuse.

If it is javascript code that could possibly be used on an additional page, it makes no sense to copy and paste it on every jsp page that you wish to use it on, especially taking maintenance into account.

Also, if it is kept in a separate file, the browser can cache that javascript file, lessening page load time.

There are times that you have a function that is unique to a specific page, in those cases it's fine to keep the javascript on the jsp.

NOTE: Regarding performance, if you working on a very high traffic website, and are serving up pages with a lot of images and various media/content, then putting as much as possible, including CSS, in the main source for each JSP is recommended. Yahoo did a study and found that most lag during page load has more to do with responses from the server than from downloading content. What they found is that if you took all of attached content (javascript, CSS), and pasted it directly into each page, instead of attaching it in separate files that the pages loaded MUCH faster. I'm thinking they have an average percentage of the faster load times, I can't remember it though.



As a suggestion, there may already be an object out there that will take an array in java and output a JSON formatted string that you can use.

15 years ago
JSP
Use ajax.

- user clicks id
- you make ajax call to jsp page to get the info for that id
- return that info in a json object
- use a dialog box or display a hidden div to display the returned data in an organized fashion

This enables you to only pull and display the list of ids on page load, which makes the page faster. And provided your hardware is at least average and your server is set up correctly your users won't see much of a delay if any delay at all with the ajax call.

- andy c
15 years ago
JSP

If you're using Spring, make sure you check out DWR in order to utilize Spring with Ajax.

Also, for a basic, 10 min tutuorial on just what Ajax is and how it works, check out w3schools.com.

- andy c
15 years ago
JSP
Hello,

To me it sounds like you may want to look into a javascript library that has a built in grid.

The one I have used most often for working with sets of data on the client side is Dojo. There are a few issues with Dojo, but overall it's not too bad an experience.

Basically, you assign your resultset to a json object, which is really just a hash object, and then you can use it as a regular recordset on the client side, you can query it, change values, display it in a grid with additional options for sorting, filtering, updating the data via ajax, etc.

Please note that this is NOT an advertisement for Dojo's javascript library. My preference is Jquery, Mootools then Yui. If I never code Dojo again I'll be happy

BUT, they have a good grid implementation. http://www.dojotoolkit.org/


BTW, there is another option... Go here: javascript documentation. You will find all of the different ways of accessing objects in javascript here. There are different ways of getting the properties of the object, depending on the type of object, and the types of data in that object. At the end of the day though, an object in javascript consists of name - value pairs that contain any sort of data that javascript supports. That's the key to determining how to access your data.


- andy c
15 years ago
JSP