Quick Fix: FieldSet Title Truncation
20 Comments so far
Leave a comment
While waiting to get my hands dirty on my new contract, I decided to fix the title issue with my FieldSet component. It now truncates the text if the text’s width tries to extend beyond the constraints of the border. There were a few house keeping tasks done inside as well. Get the latest from the Google Project here.
20 Comments so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Did you get it?
I’m having the “FieldSet Title Truncation” issue.
Thanx
Comment by Soknet Thursday, December 13, 2007 @ 6:51 pmI don’t quite follow you. Are you saying you are still experiencing the issues with the latest source?
Let me know and I will quickly address this ASAP.
J
Comment by jwopitz Thursday, December 13, 2007 @ 7:32 pmYes. I’m experiencing the issues. But it’s not always failing.
An example of code failing:
Comment by Soknet Friday, December 14, 2007 @ 10:10 amThe comment system truncated the example code I inserted.
Comment by Soknet Friday, December 14, 2007 @ 10:11 amshoot me an email with the code sample and I will plug it in and test it. And thanks for the input on this.
J
Comment by jwopitz Friday, December 14, 2007 @ 2:51 pmI have sent you an email with an example, and a screenshot
Thanx
Comment by Soknet Friday, December 14, 2007 @ 5:54 pmSoknet
Hi!!!
Did you get a solution?
Comment by Soknet Tuesday, January 8, 2008 @ 3:15 pmHello Soknet,
I did take a look at the issue. I have not been able to replicate it from compiling your code several times. Of course I was using FB2. Where you also using FB2? I have the issue logged on the project home along with you sample code.
I really appreciate your patience with this. I just can’t get it to manifest on my machine.
Has anyone else had this problem?
J
Comment by jwopitz Tuesday, January 8, 2008 @ 3:21 pmThanks!
Comment by max Wednesday, January 30, 2008 @ 9:46 amWill this be able to be used as a Flex 3 component?
Comment by s Wednesday, February 20, 2008 @ 4:36 pmI haven’t tried it in Flex 3. I have been rather lazy getting around to using FB3. Assuming that they haven’t radically changed the internal workings of the underlying classes utilized in this component, I don’t see why it wouldn’t work.
Comment by jwopitz Wednesday, February 20, 2008 @ 4:44 pmThank you for your response. Great component by the way…I find it very valuable since I have not come across anything like it. I’ve implemented it into a project and it works perfectly in Flex 2 but once it is compiled in Flex Beta 3 the container widths change which in turn causes scrollbars to appear around the container. Any idea why or any help would be appreciated…thanks!
Comment by s Thursday, February 21, 2008 @ 6:18 pmI can’t get this to work at all when specifying the styles in an external .css file. If I do nothing other than:
FieldSet
{
}
the fieldset doesn’t render at all. Your default styles aren’t kicking in. So I copied all the styles (borderStyle most importantly) into the .css file… and now it renders, except the title is floating down inside the actual content.
Comment by Devin Saturday, December 13, 2008 @ 10:47 pmDevin. Thanks for the feedback. Can you send me your sample application code so that I can test this. Also what version of Flex Builder are you using, which Flash player version. Just want to make sure I can recreate the problem. Thanks.
Comment by jwopitz Sunday, December 14, 2008 @ 5:44 amSure. I’m using SDK 3.2 along with FP10. I created a small test case with view source enabled at http://www.shinynet.com/fieldset/main.html
This is what I see happening.
If you add a FieldSet{} style declaration, the fieldset doesn’t render anything at all.
If you add a minimum of border-style:solid, the border will render, but that’s it, no title.
To get the title to render, you have add, at minimum, title-gap. However, that renders the title too far down into the content area.
btw, your TileCanvas thing looks sweet. It might be what I’ve been looking for in a dashboard layout engine
Comment by Devin Sunday, December 14, 2008 @ 7:26 amHi Devin.
Thanks for posting the source. Since you are declaring a class style called FieldSet, you are overriding the default styling of the same name in the component. If you decide to still use this name, for now, you would have to set all styles on the FieldSet within the style declaration. This is what is happening inside the FieldSet:
if (!StyleManager.getStyleDeclaration(’FieldSet’))
{
var tsn:CSSStyleDeclaration = new CSSStyleDeclaration();
tsn.setStyle(’fontWeight’, ‘bold’);
var s:CSSStyleDeclaration = new CSSStyleDeclaration();
s.setStyle(’borderStyle’, ’solid’);
s.setStyle(’borderSkin’, FieldSetBorder);
s.setStyle(’backgroundColor’, 0xFFFFFF);
s.setStyle(’backgroundAlpha’, 0.0);
s.setStyle(’paddingLeft’, 2);
s.setStyle(’paddingRight’, 2);
s.setStyle(’paddingTop’, 2);
s.setStyle(’paddingBottom’, 2);
s.setStyle(’titleAlign’, ‘left’);
s.setStyle(’titleGap’, 2);
s.setStyle(’titlePlacement’, ‘top’);
s.setStyle(’titleStyleName’, tsn);
StyleManager.setStyleDeclaration(’FieldSet’, s, true);
}
I probably need to adjust that so that a user can use the class name and still retain values the user has decided to NOT declare. Thanks for pointing this out as it shows a flaw in my approach.
Comment by jwopitz Monday, December 15, 2008 @ 12:42 amOk I have checked in the changes to the main trunk.
Comment by jwopitz Monday, December 15, 2008 @ 5:09 amok added new download to project home – http://code.google.com/p/jwopitz-lib/downloads/list
Let me know if there are any bugs or anything. I gave it a pretty good once-over.
Comment by jwopitz Monday, December 15, 2008 @ 5:21 amWorks great. The main things I wanted to was override the padding, cornerRadius, and titleStyleName in a css declaration and leave rest defaulted. And no problems so far. Thanks!
Comment by Devin Tuesday, December 16, 2008 @ 1:55 amThanks for pointing the issue out. That was a major flaw in my default styling scheme. I guessed it never dawned on me that people might wanna override the default styling without having to assign every property. Glad it works for you.
Comment by jwopitz Tuesday, December 16, 2008 @ 5:17 pm