Visual Studio 2008 Dynamic Data Web Appliction Database Scaffolds


















This came up as I was generating and HTML template in Flex. I wanted a new Table Row foreach New Line of a textArea.text
You’ll see that I am replaceing the \r (carriage returns) with HTML table rows and cells. If you are here you are probably primarily interested in something simple like
private function otherTasks ( text : TextArea ) : String {
//replace "</td></tr><tr><td>” with whatever you want
var newString:String = text.text.replace(/[\r\n]/g, "</td></tr><tr><td>");
}
private function otherTasks ( text : TextArea ) : String {
var temp:String = "<tr><td>";
temp+= text.text.replace(/[\r\n]/g, "</td></tr><tr><td>");
var str:String = "";
str+= "<P><table class=\"sample\" width=\"800\"><thead><tr height=13.75>";
str+="<th>OTHER TASKS NOT IN MAGIC</th>";
str += "</tr></thead><tbody>";
str+= temp;
str+="</tbody></table>";
return str;
}

If your application uses Flex Builder Professional features such as data visualization components or automated testing, you will need to copy those elements from the latest milestone SDK that came with Flex Builder into your newly downloaded SDK. The relevant files that you need to copy are:
{FlexSDKDir}/frameworks/libs/automation*.swc
{FlexSDKDir}/frameworks/libs/datavisualization.swc
{FlexSDKDir}/frameworks/locale/en_US/automation*.swc
{FlexSDKDir}/frameworks/locale/en_US/datavisualization_rb.swc
{FlexSDKDir}/frameworks/locale/ja_JP/automation*.swc
{FlexSDKDir}/frameworks/locale/ja_JP/datavisualization_rb.swc
{FlexSDKDir}/frameworks/rsls/datavisualization_3.0.0.* (or updated build numbers for later builds)
{FlexSDKDir}/fbpro (source)
In order to get the source code you will need to run the following command java -jar DMV-source.jar {license-file-location} {output-location}
The Actual error for me was 1119: Access of possibly undefined property grid through a reference with static type mx.core:Container. And was actually a pretty simple one to solve. Like always, I hacked at it for an hour and then when I finally got it, I smacked my self in the forehead….duh! I’m not really sure why this happens, but it appears to be something with a custom component. In my case I had a VBox that I was extending and it was called Subject. In the VBox and Advanced Datagrid existed which I was trying to get the columns for so that I could use actionscript to add a column. so to get the columns I was doing.
var cols:Array = this.TabNavigator.selectedChild.grid.columns as Array; //where grid is my ADG<br />
This gave me the error, so to work around it, I chopped the object (i.e the datagrid off) Made the changes, and then put it back together. Here is my code line for line. As always comments or other work arounds are welcome.
var obj:Object = this.stn.selectedChild; var cols:Array = obj.grid.columns; var col:AdvancedDataGridColumn = newAdvancedDataGridColumn(); col.headerText = "My Column"; col.dataField = "mycol"; cols.push(col); obj.grid.columns = cols; this.stn.selectedChild = obj as Subject;
Typically you would call a stored proc using Subsonic using the following.
public DataSet OverallStatus()
{
return SPs.PGetColorCoding().GetDataSet();
}
However, Subsonic has a problem getting the Object class for your stored proc when there are no parameters to pass in. So we just we just convert it to a string doing the following
public DataSet OverallStatus()
{
StoredProcedure sp = SPs.PGetColorCoding();
string dummy = sp.Command.CommandSql;
return sp.GetDataSet();
}