Thanks Scott.

I managed to get things talking ... somewhat before your reply came in. The 
data provider showed the proper data. I did a bit of digging and came up with 
the new code shown below.  Unfortunately with the new code, if I only need to 
update a single field in the DB I must click every DDL and select the value 
otherwise the other fields receive NULL values.
Any suggestions?

Here is the newest code:

<fx:Script>
<![CDATA[
[Bindable]
public var _selectedStatus:String;
[Bindable]
public var _selectedCategory:String;
[Bindable]
public var _selectedStyle:String;

private function statusChanged(e:IndexChangeEvent):void {
if ( _selectedStatus == null ) {
_selectedStatus = originals.status;
}
_selectedStatus = statusDDL.selectedItem.status;
}
                        
protected function categoryChanged(e:IndexChangeEvent):void {
if ( _selectedCategory == null ) {
_selectedCategory = originals.category;
}
_selectedCategory = categoryDDL.selectedItem.category;
}
                        
protected function stylesChanged(event:IndexChangeEvent):void {
if ( _selectedStyle == null ) {
_selectedStyle = originals.style;
}
_selectedStyle = styleDDL.selectedItem.style;
}

// This function use to add or update records in the database
protected function button_clickHandler(event:MouseEvent):void {
        originals.inventoryno = inventorynoTextInput.text;
        originals.title = titleTextInput.text;
        originals.price = priceTextInput.text;
        originals.status = _selectedStatus;
        originals.category = _selectedCategory;
        originals.style = _selectedStyle;
        originals.edition = _selectedEdition;
        originals.subject = _selectedSubject;
        originals.height = _selectedHeight;
        originals.width = _selectedWidth;
        originals.medium = _selectedMedium;
        originals.imagename = imagenameTextInput.text;
        originals.description = descriptionTextInput.text;
        originals.copyrightdate = copyrightdateDateField.selectedDate;
        if (originals.originalid==0){
        createOriginalResult.token = artServices.createOriginal(originals);
        }
        else{
        updateOriginalResult.token = artServices.updateOriginal(originals);
        }
}                       
                                                
]]>

</fx:Script>

// The declarations remain the same as before for each of the lists

// The FormItems <DropDownList/> changed as well. one example below:

</s:FormItem>
<s:FormItem label="Status" styleName="formLabel">
<s:DropDownList id="statusDDL"
        labelField="status" styleName="formContent"
        skinClass="CustomSkins.CustomDropDownListSkin"
        dataProvider="{statusList}"
        prompt="{originals.status}"
        change="statusChanged(event)"
        creationComplete="statusDDL_creationCompleteHandler(event)"
        symbolColor="#FFFFFF" borderColor="#c3c3c3"
        width="157" color="#000000"/>
</s:FormItem>


--- In flexcoders@yahoogroups.com, Scott Fanetti <scott.fanetti@...> wrote:
>
> It looks like you are setting the status on the change in the drop down list 
> but not casting it. Is that your issue? The change handler does not seem 
> attached - what is triggering it?  When you debug it - what are the contents 
> of the drop down list data provider?  
> 
> Sent from my iPhone
> 


Reply via email to