This class is the view of the second tab in the TabView class.
Shows the Tree with parts to allow user to select a part to add to an order
| private | Tree | partsTree | |
| private | TextInput | partInput | |
| private | TextInput | idInput | |
| private | TextInput | skuInput | |
| private | TextInput | stkInput | |
| private | TextInput | laborInput | |
| private | TextInput | priceInput | |
| private | TextInput | qtyInput | |
| private | TextArea | descArea | |
| private | Button | addBut | |
| private | Service | remoteServer | |
| private | Object | selectedPart | |
| private | Connector | newPart |
Parts() |
| public | showCats(r:ResultEvent) | ||
| public | change() | ||
| public | click() | ||
| public | null | showDetail(r:ResultEvent) | |
| private | onLoad() | ||
| private | setConnection() |
private partsTree:Tree
A Tree instance that has been initialized on the stage with instance name partsTree
private partInput:TextInput
A TextInput instance that has been initialized on the stage with instance name partInput
private idInput:TextInput
A TextInput instance that has been initialized on the stage with instance name idInput
private skuInput:TextInput
A TextInput instance that has been initialized on the stage with instance name skuInput
private stkInput:TextInput
A TextInput instance that has been initialized on the stage with instance name stkInput
private laborInput:TextInput
A TextInput instance that has been initialized on the stage with instance name laborInput
private priceInput:TextInput
A TextInput instance that has been initialized on the stage with instance name priceInput
private qtyInput:TextInput
A TextInput instance that has been initialized on the stage with instance name qtyInput
private descArea:TextArea
A TextArea instance that has been initialized on the stage with instance name descArea
private addBut:Button
A Button instance that has been initialized on the stage with instance name addBut
private remoteServer:Service
A service Object that has a link to the server component "mx.services.part"
private selectedPart:Object
An Object where the item that we receive from the server is stored
private newPart:Connector
A Connector used to send a newPartEvent to the listener components registered
- See Also
- TrioMotor.newPart
Parts()
public showCats(r:ResultEvent):Void
Description: Sets the dataProvider of the tree with the XML Object received from the server Assumptions: partsTree is instantiated on the stage
XML received from the server has the structure of a tree Globals: uses partsTree Calls: none
Is Called by: This function is called by the server via RelayResponder in response to the getParts() call
- Parameters
r (ResultEvent)- xml Object that represent the tree data- Returns
- Void
public change():Void
Description: makes a call to the server when the user selects an item in the Tree. Creates a RelayResponder to bind the response from the server to the function showDetail()
Assumptions: remoteServer is instantiated
Globals: uses remoteServer
Calls: getPartDetail() on the remoteServer Object
Is Called by: This function is called by Tree when the user selects an item
- Returns
- Void
public click():Void
Description: If a selected part is available, a copy of that is created and a new property QTY is assigned with the value of the qtyInput field. Then, a new Event is fired to the newPart Connector
Assumptions: newPart is instantiated
Globals: uses selectedPart and newPart
Calls: fireEvent() on the newPart Connector
Is Called by: This function is called by the Button "addBut" when the user clicks on it
- Returns
- Void
- See Also
- TrioMotor.newPart
public showDetail(r:ResultEvent)
Description: Populates the textFields with the data received from the server and keeps a reference of the part in the selectedPart member Assumptions: A query received from the server has only one item with the following properties:
PART_NAME, PART_ID, SKU, LABOR, PRICE, DESC, IN_STOCK_DATE Globals: uses the followings globals:
selectedPart, partInput, idInput, skuInput, laborInput, priceInput, descArea, qtyInput, stkInput Calls: none
Is Called by: This function is called by the server via RelayResponder in response to the getPartDetail() call
- Parameters
r (ResultEvent)- RecordSet with only one item- Returns
- Void
- See Also
- TrioMotor.newPart
private onLoad():Void
Description: Registers itself as a listener of the tree and the button. Calls the method to connect to the server and changes the property of the XML to ignore blank spaces
Assumptions: partsTree and addBut are instantiated on the stage
Globals: instantiates partsTree
uses addBut and partsTree
Calls: addEventListener() in the partsTree
addEventListener() in the addBut
setConnection()
Is Called by: This function is called automatically by the player when this object is completely loaded. This is possible because this class extends from the MovieClip Class
- Returns
- Void
- See Also
- TrioMotor.newPart
private setConnection():Void
Description: Creates a connection to the component "mx.services.part" and calls the method getParts() to populate the tree. Map the result of this call to the method showCats()
Assumptions: none
Globals: instantiates remoteServer
Calls: getParts() in the remoteServer Service
Is Called by: onLoad()
- Returns
- Void