You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Marcus Fritze <ma...@googlemail.com> on 2014/03/13 17:45:48 UTC
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Hi,
I am bringing up this issue, because I want to fix a bug in the SDK. So I have to compile the SDK for my self.
What is currently the easiest way for doing this? I looked at the wiki in the "Helping Out" section:
https://cwiki.apache.org/confluence/display/FLEX/2.1+Flash+Builder
Correct me when I am wrong, but it seems that is not a complete tutorial how to setup the SDK for compiling the SDK.
So, what is the easies way for working on the SDK? I want to fix a bug.
Thanks.
Marcus
Am 02.08.2013 um 13:19 schrieb Kessler CTR Mark J <ma...@usmc.mil>:
> I've tossed in the rough structure [1]. I'm going to move any related pages under the structure for now. This should allow different people to start adding content when they get time to.
>
> On a side note, I think we may need to clean up the existing pages. It's sort of random what's in there now. I may do a bit of that later.
>
>
> [1] https://cwiki.apache.org/confluence/display/FLEX/Helping+Out
>
> -Mark
>
> -----Original Message-----
> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of OmPrakash Muppirala
> Sent: Friday, August 02, 2013 2:18 AM
> To: dev@flex.apache.org
> Subject: Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
>
> Thanks for all the ideas and tutorial content so far. I think the
> structure that Mark suggested looks great.
>
> Can someone please volunteer to compile this info into a wiki page from
> which we can start filling in content slowly? Please let us know, we can
> get you access to our wiki site here [1]
>
> Thanks,
> Om
>
> [1] https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+Wiki
>
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
Posted by Marcus Fritze <ma...@googlemail.com>.
Hi Alex,
thank again for your big help.
Ok, I updated the https://issues.apache.org/jira/browse/FLEX-13628 and attached a possible fix. I have tested this here with my example and it's working without any problems.
In this fix, the calculation is correct when using default ItemRenderer, custom ItemRenderer or even colspan.
Maybe, you or someone else will look over the patch and check if everything is ok. (I hope I created the patch file correct. I used "diff" in terminal on OS X to create this file.
Later, I will test this issue in the PrintDataGrid (not the PrintAdvancedDataGrid) if this issue is also in this component and maybe should be fixed.
Thanks.
Marcus
Am 18.03.2014 um 16:00 schrieb Alex Harui <ah...@adobe.com>:
> Glad things are getting better.
>
> If the default renderer is just a textfield, then it should handle wordWrap and variableRowHeight correctly. It is more complex renderers with children that often need the child tied to the explicitWidth.
>
> I'm not surprised that column spanning has bugs in this kind of scenario. Try overriding that mx_internal method and see if you can come up with a better calculation.
>
> Often, the last row is just one or two pixels too tall. TextFields usually have a couple of blank rows of pixels below the glyphs so while it looks like it will fit, the math says it doesn't.
>
> -Alex
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST]
tutorial....
Posted by Alex Harui <ah...@adobe.com>.
Glad things are getting better.
If the default renderer is just a textfield, then it should handle wordWrap and variableRowHeight correctly. It is more complex renderers with children that often need the child tied to the explicitWidth.
I'm not surprised that column spanning has bugs in this kind of scenario. Try overriding that mx_internal method and see if you can come up with a better calculation.
Often, the last row is just one or two pixels too tall. TextFields usually have a couple of blank rows of pixels below the glyphs so while it looks like it will fit, the math says it doesn't.
-Alex
From: Marcus Fritze <ma...@googlemail.com>>
Reply-To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Date: Tuesday, March 18, 2014 6:47 AM
To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Subject: Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
First of all, sorry for my late response. Alex, you are my hero! This solves the issue a "little bit". But to be honest, not completely.
Ok for documentation:
Now, in my MXAdvancedDataGridItemRenderer I use:
override public function set explicitWidth(value:Number):void
{
super.explicitWidth = value;
this.label.width = value;
}
With this function the height of the calculated ItemRenderer for printing is correct. I think we have to update / change code the Default ItemRenderer which are used for PrintDataGrid and PrintAdvancedDataGrid that the height is calculated correct when someone is using only the Default ItemRenderer and wordWrap="true" variableRowHeight="true" for the Print(Advanced)DataGrid. I will test this, when my print works.
But there is still a print issue when I use colspan for some columns. I am currently investigating this issue.
It seems that the every time the width and height of the columns (<mx:columns>) will be calculated in the AdvancedDataGridBaseEx measureHeightOfItemsUptoMaxHeight function, but rendererProviders for colspan are not considered during this calculation. But I think during this calculation we should look if there will be used maybe another ItemRenderer for colspan. So if the Colspan-ItemRenderer is used, the Width and Height is of course not the same as the height and width of the column-ItemRenderer. (I hope every body understand what I mean. ;-) )
It's funny that I found this in the AdvancedDataGridBase.as Line 1600:
/**
* @private
* This grid just returns the column size,
* but could handle column spanning.
*/
mx_internal function getWidthOfItem(item:IListItemRenderer,
col:AdvancedDataGridColumn, visibleColumnIndex:int):Number
{
return col.width;
}
Yea, I think this would definitively very helpful if this could handle column spanning. ;-)
And a small issue when I print, the "pagebreak" of the PrintAdvacedDataGrid is 1 row "too early". When I look at my next page, the first row would perfectly fit on the previous page. Ok, currently this doesn't bother me too much, but this maybe can also be fixed.
Any help appreciated. Thanks
Marcus
Am 14.03.2014 um 20:42 schrieb Alex Harui <ah...@adobe.com>>:
It looks to me that the Label's width is not tied to the explicitWidth of the renderer at measure time, only at layout time.
You can try binding label's width to "{explicitWidth - 14}". If you think the binding is too slow, then override the explicitWidth setter and set the Label's width then.
HTH,
-Alex
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
Posted by Marcus Fritze <ma...@googlemail.com>.
First of all, sorry for my late response. Alex, you are my hero! This solves the issue a "little bit". But to be honest, not completely.
Ok for documentation:
Now, in my MXAdvancedDataGridItemRenderer I use:
override public function set explicitWidth(value:Number):void
{
super.explicitWidth = value;
this.label.width = value;
}
With this function the height of the calculated ItemRenderer for printing is correct. I think we have to update / change code the Default ItemRenderer which are used for PrintDataGrid and PrintAdvancedDataGrid that the height is calculated correct when someone is using only the Default ItemRenderer and wordWrap="true" variableRowHeight="true" for the Print(Advanced)DataGrid. I will test this, when my print works.
But there is still a print issue when I use colspan for some columns. I am currently investigating this issue.
It seems that the every time the width and height of the columns (<mx:columns>) will be calculated in the AdvancedDataGridBaseEx measureHeightOfItemsUptoMaxHeight function, but rendererProviders for colspan are not considered during this calculation. But I think during this calculation we should look if there will be used maybe another ItemRenderer for colspan. So if the Colspan-ItemRenderer is used, the Width and Height is of course not the same as the height and width of the column-ItemRenderer. (I hope every body understand what I mean. ;-) )
It's funny that I found this in the AdvancedDataGridBase.as Line 1600:
/**
* @private
* This grid just returns the column size,
* but could handle column spanning.
*/
mx_internal function getWidthOfItem(item:IListItemRenderer,
col:AdvancedDataGridColumn, visibleColumnIndex:int):Number
{
return col.width;
}
Yea, I think this would definitively very helpful if this could handle column spanning. ;-)
And a small issue when I print, the "pagebreak" of the PrintAdvacedDataGrid is 1 row "too early". When I look at my next page, the first row would perfectly fit on the previous page. Ok, currently this doesn't bother me too much, but this maybe can also be fixed.
Any help appreciated. Thanks
Marcus
Am 14.03.2014 um 20:42 schrieb Alex Harui <ah...@adobe.com>:
> It looks to me that the Label's width is not tied to the explicitWidth of the renderer at measure time, only at layout time.
>
> You can try binding label's width to "{explicitWidth - 14}". If you think the binding is too slow, then override the explicitWidth setter and set the Label's width then.
>
> HTH,
> -Alex
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST]
tutorial....
Posted by Alex Harui <ah...@adobe.com>.
It looks to me that the Label's width is not tied to the explicitWidth of the renderer at measure time, only at layout time.
You can try binding label's width to "{explicitWidth - 14}". If you think the binding is too slow, then override the explicitWidth setter and set the Label's width then.
HTH,
-Alex
From: Marcus Fritze <ma...@googlemail.com>>
Reply-To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Date: Friday, March 14, 2014 12:31 PM
To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Subject: Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
This is my ItemRenderer code:
<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="false">
<fx:Script>
<![CDATA[
import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
import scripts.utils.Utils;
override public function set data(value:Object):void
{
super.data = value;
if(value != null)
{
var _listData:AdvancedDataGridListData = listData as AdvancedDataGridListData;
if(value.ist_aktuell == "ja")
this.lblData.setStyle("fontWeight", "bold");
else
this.lblData.setStyle("fontWeight", "normal");
switch(_listData.dataField)
{
case "fileNumber":
lblData.text = ""; //addedFilesToList.toString();
addedFilesToList++;
break;
case "referenz_name":
lblData.text = value[_listData.dataField];
break;
case "dokument_name":
lblData.text = value[_listData.dataField];
break;
case "file_index":
lblData.text = value[_listData.dataField];
break;
case "status":
lblData.text = value.status_code + " [" + value.version + "]";
break;
case "datum":
lblData.text = Utils.timestamp_to_time(value.ersteller_zeit_utc, "DD.MM.YY", false);
break;
}
}
}
]]>
</fx:Script>
<s:Label id="lblData" top="0" left="0" right="0" bottom="0" paddingTop="5" paddingLeft="7" paddingRight="7" paddingBottom="5" backgroundColor="0xFF0000"/>
</s:MXAdvancedDataGridItemRenderer>
Am 14.03.2014 um 20:06 schrieb Alex Harui <ah...@adobe.com>>:
What does your renderer code look like? If the height of the Label cannot be completely determined from the explicitWidth of the renderer, then measuredHeight will not compute correctly.
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
Posted by Marcus Fritze <ma...@googlemail.com>.
This is my ItemRenderer code:
<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="false">
<fx:Script>
<![CDATA[
import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
import scripts.utils.Utils;
override public function set data(value:Object):void
{
super.data = value;
if(value != null)
{
var _listData:AdvancedDataGridListData = listData as AdvancedDataGridListData;
if(value.ist_aktuell == "ja")
this.lblData.setStyle("fontWeight", "bold");
else
this.lblData.setStyle("fontWeight", "normal");
switch(_listData.dataField)
{
case "fileNumber":
lblData.text = ""; //addedFilesToList.toString();
addedFilesToList++;
break;
case "referenz_name":
lblData.text = value[_listData.dataField];
break;
case "dokument_name":
lblData.text = value[_listData.dataField];
break;
case "file_index":
lblData.text = value[_listData.dataField];
break;
case "status":
lblData.text = value.status_code + " [" + value.version + "]";
break;
case "datum":
lblData.text = Utils.timestamp_to_time(value.ersteller_zeit_utc, "DD.MM.YY", false);
break;
}
}
}
]]>
</fx:Script>
<s:Label id="lblData" top="0" left="0" right="0" bottom="0" paddingTop="5" paddingLeft="7" paddingRight="7" paddingBottom="5" backgroundColor="0xFF0000"/>
</s:MXAdvancedDataGridItemRenderer>
Am 14.03.2014 um 20:06 schrieb Alex Harui <ah...@adobe.com>:
> What does your renderer code look like? If the height of the Label cannot be completely determined from the explicitWidth of the renderer, then measuredHeight will not compute correctly.
>
Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST]
tutorial....
Posted by Alex Harui <ah...@adobe.com>.
What does your renderer code look like? If the height of the Label cannot be completely determined from the explicitWidth of the renderer, then measuredHeight will not compute correctly.
-Alex
From: Marcus Fritze <ma...@googlemail.com>>
Reply-To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Date: Friday, March 14, 2014 10:06 AM
To: "dev@flex.apache.org<ma...@flex.apache.org>" <de...@flex.apache.org>>
Subject: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
Thanks for your question.
I attached a image to https://issues.apache.org/jira/browse/FLEX-13628
In the AdvancedDataGridBaseEx.as Line 3056 the item.getExplicitOrMeasuredHeight() is every time 20.
So when you look at my example image, the Label in the ItemRenderer has 2 lines. But the calculated 20 is only correct, when the Label has 1 line.
I really have no idea and of course not that experience in the "Flex internal functions", but I think the setupRendererFromData function in the AdvancedDataGridBaseEx.as doesn't "create" a correct ItemRenderer with the correct sizes. Especially when ItemRenderer has a Label with variable multiline data.
In this setupRendererFromData function we set the explicitWidth for the ItemRenderer, but it seems that the text-calculating of the Label (in the function createTextLinesFromTextBlock Label.as 904) inside this ItemRenderer uses still the maxWidth = 10000 as innerWidth when calculating the height.
I am also wondering that a lot of explicitHeight and measuredHeight values are NaN in and after running the setupRendererFromData function. So maybe the ItemRenderer is not setup correctly? Really, I have no clue.
Am 14.03.2014 um 17:25 schrieb Alex Harui <ah...@adobe.com>>:
What is wrong with the label height calculation?
On 3/14/14 9:17 AM, "Marcus Fritze" <ma...@googlemail.com>> wrote:
Am 13.03.2014 um 20:40 schrieb Alex Harui <ah...@adobe.com>>:
And if you are using an IDE like IntelliJ or FB, then the easiest path
is
to use monkey-patching. Create a test project, point the source-path to
include the modified AdvancedDataGridBaseEx.as and see if it works.
Thanks, this is working very good.
But, the problem with the AdvancedDataGridBaseEx.as seem to be a bigger
problem.
It seem that the height of the text in Label inside a ItemRenderer is not
calculated correct.
print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....
Posted by Marcus Fritze <ma...@googlemail.com>.
Thanks for your question.
I attached a image to https://issues.apache.org/jira/browse/FLEX-13628
In the AdvancedDataGridBaseEx.as Line 3056 the item.getExplicitOrMeasuredHeight() is every time 20.
So when you look at my example image, the Label in the ItemRenderer has 2 lines. But the calculated 20 is only correct, when the Label has 1 line.
I really have no idea and of course not that experience in the "Flex internal functions", but I think the setupRendererFromData function in the AdvancedDataGridBaseEx.as doesn't "create" a correct ItemRenderer with the correct sizes. Especially when ItemRenderer has a Label with variable multiline data.
In this setupRendererFromData function we set the explicitWidth for the ItemRenderer, but it seems that the text-calculating of the Label (in the function createTextLinesFromTextBlock Label.as 904) inside this ItemRenderer uses still the maxWidth = 10000 as innerWidth when calculating the height.
I am also wondering that a lot of explicitHeight and measuredHeight values are NaN in and after running the setupRendererFromData function. So maybe the ItemRenderer is not setup correctly? Really, I have no clue.
Am 14.03.2014 um 17:25 schrieb Alex Harui <ah...@adobe.com>:
> What is wrong with the label height calculation?
>
> On 3/14/14 9:17 AM, "Marcus Fritze" <ma...@googlemail.com> wrote:
>
>>
>> Am 13.03.2014 um 20:40 schrieb Alex Harui <ah...@adobe.com>:
>>>
>>> And if you are using an IDE like IntelliJ or FB, then the easiest path
>>> is
>>> to use monkey-patching. Create a test project, point the source-path to
>>> include the modified AdvancedDataGridBaseEx.as and see if it works.
>>
>> Thanks, this is working very good.
>>
>> But, the problem with the AdvancedDataGridBaseEx.as seem to be a bigger
>> problem.
>> It seem that the height of the text in Label inside a ItemRenderer is not
>> calculated correct.
>
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Posted by Alex Harui <ah...@adobe.com>.
What is wrong with the label height calculation?
On 3/14/14 9:17 AM, "Marcus Fritze" <ma...@googlemail.com> wrote:
>
>Am 13.03.2014 um 20:40 schrieb Alex Harui <ah...@adobe.com>:
>>
>> And if you are using an IDE like IntelliJ or FB, then the easiest path
>>is
>> to use monkey-patching. Create a test project, point the source-path to
>> include the modified AdvancedDataGridBaseEx.as and see if it works.
>
>Thanks, this is working very good.
>
>But, the problem with the AdvancedDataGridBaseEx.as seem to be a bigger
>problem.
>It seem that the height of the text in Label inside a ItemRenderer is not
>calculated correct.
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Posted by Marcus Fritze <ma...@googlemail.com>.
Am 13.03.2014 um 20:40 schrieb Alex Harui <ah...@adobe.com>:
>
> And if you are using an IDE like IntelliJ or FB, then the easiest path is
> to use monkey-patching. Create a test project, point the source-path to
> include the modified AdvancedDataGridBaseEx.as and see if it works.
Thanks, this is working very good.
But, the problem with the AdvancedDataGridBaseEx.as seem to be a bigger problem.
It seem that the height of the text in Label inside a ItemRenderer is not calculated correct.
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Posted by Alex Harui <ah...@adobe.com>.
Well, most of the committers are working from a git repo. You can work
from a binary distribution, because you can then use IntelliJ or FB to
write your code, but it is easier just to use the InstallApacheFlex
installer to set up your binary distribution (unless you're on Linux, in
which cas you would use Ant).
And if you are using an IDE like IntelliJ or FB, then the easiest path is
to use monkey-patching. Create a test project, point the source-path to
include the modified AdvancedDataGridBaseEx.as and see if it works.
-Alex
From: Marcus Fritze <ma...@googlemail.com>
Reply-To: "dev@flex.apache.org" <de...@flex.apache.org>
Date: Thursday, March 13, 2014 12:33 PM
To: "dev@flex.apache.org" <de...@flex.apache.org>
Subject: Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Am 13.03.2014 um 18:32 schrieb Alex Harui <ah...@adobe.com>:
So, what is the easies way for working on the SDK? I want to fix a bug.
Well, I'm tempted to have you follow this:
https://cwiki.apache.org/confluence/display/FLEX/Git+for+Apache+Flex+Guide
because this sets up your environment like most of the other committers.
Yes, thats clear. So I found in the README "Building the Framework in a
Binary Distribution".
So this is the best way, right?
I only want to change / test something in AdvancedDataGridBaseEx.as and
would like to see if it fixes
https://issues.apache.org/jira/browse/FLEX-23252
https://issues.apache.org/jira/browse/FLEX-13628
Thanks.
Marcus
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Posted by Marcus Fritze <ma...@googlemail.com>.
Am 13.03.2014 um 18:32 schrieb Alex Harui <ah...@adobe.com>:
>> So, what is the easies way for working on the SDK? I want to fix a bug.
> Well, I'm tempted to have you follow this:
> https://cwiki.apache.org/confluence/display/FLEX/Git+for+Apache+Flex+Guide
> because this sets up your environment like most of the other committers.
Yes, thats clear. So I found in the README "Building the Framework in a Binary Distribution".
So this is the best way, right?
I only want to change / test something in AdvancedDataGridBaseEx.as and would like to see if it fixes
https://issues.apache.org/jira/browse/FLEX-23252
https://issues.apache.org/jira/browse/FLEX-13628
Thanks.
Marcus
Re: [REQUEST] A tutorial on how to fix bugs for the Flex SDK
Posted by Alex Harui <ah...@adobe.com>.
On 3/13/14 9:45 AM, "Marcus Fritze" <ma...@googlemail.com> wrote:
>https://cwiki.apache.org/confluence/display/FLEX/2.1+Flash+Builder
>
>Correct me when I am wrong, but it seems that is not a complete tutorial
>how to setup the SDK for compiling the SDK.
That's about how to use Apache Flex in Flash Builder.
>
>So, what is the easies way for working on the SDK? I want to fix a bug.
Well, I'm tempted to have you follow this:
https://cwiki.apache.org/confluence/display/FLEX/Git+for+Apache+Flex+Guide
because this sets up your environment like most of the other committers.
However, you can always create a monkey-patch and then generate a Git
patch from the differences.
-Alex