[flexcoders] Re: Strange problem with Item Renderer in Flash Play 10

2010-08-11 Thread Paul
Hi Amy, I just returned from vacation and picked up the issue again. It appears 
to me that Text and TextArea components do not work as item renderers in Flash 
Player 10. So, I found a different way to display the multi-line text in the 
grid column by using a label function instead.

Thanks again for your help!
Paul

--- In flexcoders@yahoogroups.com, "Amy"  wrote:
>
> 
> 
> --- In flexcoders@yahoogroups.com, "Paul"  wrote:
> >
> > Hi Amy! Thank you very much for your reply. I recognize your name from 
> > InsideRia. 
> > 
> > I tried your suggestions, but the renderers are still blank. I tried making 
> > a very simple item renderer based on the Text component which just sets the 
> > Text.htmlText value to data.dataField. It is still blank even though I set 
> > a trace statement right after setting the value, and the values appear in 
> > the log.
> 
> Are you tracing getExplicitOrMeasuredHeight() and getExplicitOrMeasuredWidth? 
>  I wouldn't think looking at the text itself would be that useful.  Instead 
> of using a renderer that is "based on" Text, have you considered just _using_ 
> Text and then using labelField to tell it what property to use?  
> 
> I have no idea if the engineers are feeding the labelField text into the 
> Text's text or htmlText property in their implementation of 
> IDropInListItemRenderer, but it's worth a shot.
> 
> HTH;
> 
> Amy
>




[flexcoders] Re: Strange problem with Item Renderer in Flash Play 10

2010-08-01 Thread Amy


--- In flexcoders@yahoogroups.com, "Paul"  wrote:
>
> Hi Amy! Thank you very much for your reply. I recognize your name from 
> InsideRia. 
> 
> I tried your suggestions, but the renderers are still blank. I tried making a 
> very simple item renderer based on the Text component which just sets the 
> Text.htmlText value to data.dataField. It is still blank even though I set a 
> trace statement right after setting the value, and the values appear in the 
> log.

Are you tracing getExplicitOrMeasuredHeight() and getExplicitOrMeasuredWidth?  
I wouldn't think looking at the text itself would be that useful.  Instead of 
using a renderer that is "based on" Text, have you considered just _using_ Text 
and then using labelField to tell it what property to use?  

I have no idea if the engineers are feeding the labelField text into the Text's 
text or htmlText property in their implementation of IDropInListItemRenderer, 
but it's worth a shot.

HTH;

Amy



[flexcoders] Re: Strange problem with Item Renderer in Flash Play 10

2010-07-30 Thread Paul
Hi Amy! Thank you very much for your reply. I recognize your name from 
InsideRia. 

I tried your suggestions, but the renderers are still blank. I tried making a 
very simple item renderer based on the Text component which just sets the 
Text.htmlText value to data.dataField. It is still blank even though I set a 
trace statement right after setting the value, and the values appear in the log.

I have a CheckBox item renderer in the same grid which displays correctly.

Thank you,
Paul

--- In flexcoders@yahoogroups.com, "Amy"  wrote:
>
> 
> 
> --- In flexcoders@yahoogroups.com, "Paul"  wrote:
> >
> > I am using Flex 3.5. I have custom item renderers in AdvancedDataGrids 
> > based on the Flex Text component which takes the data value which has 
> > multiple values delimited with "|" characters and writes out the values on 
> > multiple lines in the Text component.
> > 
> > For example:
> > value "supervisor1|supervisor2|supervisor3|supervisor4" is converted to:
> > Supervisor1
> > Supervisor2
> > Supervisor3
> > Supervisor4
> > 
> > It works fine when I am compiling for Flash version 9.0.24. I changed the 
> > compiler option to Flash version 10.0.45 so that I can use the 
> > FileReference.save method. 
> > 
> > The save method works, but in regression testing, I found that my item 
> > renderers are no longer working. I put in traces and see that it is still 
> > processing the values correctly, but the value does not display. However, 
> > the grid row does expand for the height of the value that would be 
> > displayed. I have switched the compiler setting several times, and it 
> > always works in 9.x and never works in 10.x.
> 
> Try doing something like this in your itemRenderer, and see if it works:
> 
> private var _widthChanged:Boolean;
> private var _newWidth:int;
> 
> override public function set explicitWidth(value:int):void {
> super.explicitWidth = value;
> _widthChanged = true;
> _newWidth = value;
> invalidateProperties();
> }
> 
> override protected function commitProperties():void {
> if (_widthChanged) {
> width = _newWidth;
> _widthChanged= false;
> //if the itemRender is not actually a Text control,
> //but instead the text control is a child
> theTextControl.validateNow();
> }
> super.commitProperties();
> }
> 
> If that doesn't work, try checking the text of the control and look at its 
> internal text field and how big it thinks it is.  You should be able to see 
> these values in the debugger if you set a break point, even if the variables 
> are not exposed (I think you may need to turn something on from the menu of 
> the variables window to enable this).
> 
> HTH;
> 
> Amy
>




[flexcoders] Re: Strange problem with Item Renderer in Flash Play 10

2010-07-29 Thread Amy


--- In flexcoders@yahoogroups.com, "Paul"  wrote:
>
> I am using Flex 3.5. I have custom item renderers in AdvancedDataGrids based 
> on the Flex Text component which takes the data value which has multiple 
> values delimited with "|" characters and writes out the values on multiple 
> lines in the Text component.
> 
> For example:
> value "supervisor1|supervisor2|supervisor3|supervisor4" is converted to:
> Supervisor1
> Supervisor2
> Supervisor3
> Supervisor4
> 
> It works fine when I am compiling for Flash version 9.0.24. I changed the 
> compiler option to Flash version 10.0.45 so that I can use the 
> FileReference.save method. 
> 
> The save method works, but in regression testing, I found that my item 
> renderers are no longer working. I put in traces and see that it is still 
> processing the values correctly, but the value does not display. However, the 
> grid row does expand for the height of the value that would be displayed. I 
> have switched the compiler setting several times, and it always works in 9.x 
> and never works in 10.x.

Try doing something like this in your itemRenderer, and see if it works:

private var _widthChanged:Boolean;
private var _newWidth:int;

override public function set explicitWidth(value:int):void {
super.explicitWidth = value;
_widthChanged = true;
_newWidth = value;
invalidateProperties();
}

override protected function commitProperties():void {
if (_widthChanged) {
width = _newWidth;
_widthChanged= false;
//if the itemRender is not actually a Text control,
//but instead the text control is a child
theTextControl.validateNow();
}
super.commitProperties();
}

If that doesn't work, try checking the text of the control and look at its 
internal text field and how big it thinks it is.  You should be able to see 
these values in the debugger if you set a break point, even if the variables 
are not exposed (I think you may need to turn something on from the menu of the 
variables window to enable this).

HTH;

Amy