ASP.NET drowdownlist item text preceding blank space is not rendered - asp.net

I need to indent some dropdownlist item texts to right based upon a condition. For this I simply add blank space to the left of those item text, however they don't get rendered and the texts get trimmed. Here's what I've tried so far:
Left padded certain texts right in the database (the dropdown list is populated from database)
item.Text=" "+item.Text;
item.Text=" "+item.Text;
None of the above methods work. What is the proper way of doing this? I don't want to go CSS.
Here is the jsfiddle

I think this is more a HTML then ASP.NET issue. In HTML spaces are trimmed between elements. The spec determined that 'non-significant' whitespace must be removed.
You have to use to make a 'significant' whitespace which will be rendered when at the start or end of an element.

Related

BIRT Column Width not being Respected

I'm trying to create a BIRT report. The code and query side of it works just fine, but the display is rather wonky.
There's one column whose text contents are rather long, and instead of showing some text and allowing scrolling of the text (which is the behavior I'd like there), it simply shows up as a very vertically long text block; kinda ruins the report a bit. I've also tried setting the width on the column, but no dice there either. Any ideas?
Also, as an aside, how do I get the table's columns to have grid lines? I can do that on the rows, but I can't seem to figure out how to do that for the columns. If anyone has insight into that issue, it'd be appreciated.
Here's a screenshot of the issue
Here's my BIRT report XML, without headers and footers in order reduce characters
I think there is no way to use a scrollable view element inside your report, because the output by the default html-emitter is completely static (I would like to see a different answer if this should be wrong).
To your second Question about how to add a border to a column. Click into the cell of your table, click on "Border" inside the "Properties Editor" and select the borders you like to use. This should be repreated for all cells where you want to use the borders, because this configuration is not applied for a whole column but just for one cell. If you want a border for the whole column you need to setup the border for every cell in the column.
If you have already a data cell inside your table cell, you can use the outline view to select the table cell instead of the data cell:

primefaces datatable width not rendering good

When I use a datatable and start shrinking my browser window, the datatable has a weird behavior. The center part (where the data is), doesn't shrink but the paginator does.
Here are some pics about the problem.
Thanks in advance.
It's because it can't break up the titles in your table header. If you would place spaces in between instead of using capital letters, it would break the title up and divide it over multiple lines.
If you don't have access to the table header's name (or the ability to change it), take a look at the word-wrap-property in CSS.

Flex wordwrap issue with multiple text instances

I have a scenario where I want to dynamically add words of text to a container so that it forms a paragraph of text which is wrapped neatly according to the size of the parent container. Each text element will have differing formatting, and will have differing user interaction options. For example, imagine the text " has just spoken out about ". Each word will be added to the container one at a time, at run time. The username in this case would be bold, and if clicked on will trigger an event. Same with the news article. The rest of the text is just plain text which, when clicked on, would do nothing.
Now, I'm using Flex 3 so I don't have access to the fancy new text formatting tools. I've implemented a solution where the words are plotted onto a canvas, but this means that the words are wrapped at a particular y position (an arbitrary value I've chosen). When the container is resized, the words still wrap at that position which leaves lots of space.
I thought about adding each text element to an Array Collection and using this as a datasource for a Tile List, but Tile Lists don't support variable column widths (in my limited knowledge) so each word would use the same amount of space which isn't ideal.
Does anyone know how I can plot words onto a container so that I can retain formatting, events and word wrapping at paragraph level, even if the container is resized?
Why aren't you just using a mx:Text component and html text (you can call functions from htmlText), and apply different formatting using html tags.
For information on how to trigger a function from a htmlText field:
http://www.adobepress.com/articles/article.asp?p=1019620

XHTML - How can I make a piece of text drop on to a new line or wrap without putting a space in it?

I have a small space in which I would like to put writing. Problem is, if a long word is inputted, it flows off the side because there is no space.
I could do overflow:hidden, but this isn't what I am looking for. Ideally I would like the word to drop to a new line with a - before it.
The word is on a line of its own to begin with so a <br/> will not fix the problem.
word-wrap:break-word in CSS does this (ok, without the - in the newline), but it had some browser issues back when I tried it, so be careful ;).
Second solution is wrapping letters in text (or packets of 3 or 5 letters etc.)in <span></span> so that they'll wrap but have no spaces when fitting the line.
to add the hyphen You could then use jquery and search for elements having certain left offset to prepend hyphens.

No linebreak in ASP.NET

just wanna ask is it possible to remove the linebreaks? Now I want to have a row of textbox, buttons and a combobox, but the combobox will be at new line when I run the application. So is there a way to stop it from going to a new line? Thanks.
Setting the form elements style display property to "inline" will ensure they fall on the same line until they run out of space, at which point of course, they have to go to the next line. Now you can set the height and width properties on the form elements so they all fit on the same line, and even expand to fill the available space if needed.
The combo box should have it's style display property set to block, so it will fall on the next line automatically. EX: Style="display:block"
Are you running out of vertical space? Inline is the solution if not, as some elements may default to block and add a new line.
But if you want everything to be on the same line, but are running out of space, you could try specifying for a root element style="white-space:nowrap;". I forget if it's white-space or whitespace, but either it would prevent wrapping of elements that way.

Resources