I'd like to find out if it can be done with Flex, the component's skeleton is like below code snippet:
 
 
To make this component reusable for different search cases like CustomerSearch, OrderSearch, following controls, functions have to be worked out at runtime using an actionscript class that can evaluate the case and assign appropriate form, datagrid.
 
1. Form : formSearch
2. Datagrid : dgSearchResult
3. addRow(), modRow(), delRow()
 
I want to have only one generic search component in the application rather than creating multiple of them with specific cases using viewstack. I 
How do I instantiate the formSearch with specific forms defined in mxlm files e.g.. formCustomerSearch.mxlm, formOrderSearch.mxlm?
What about dgSearchResult?
 
 
 
Code Snippet
===========
 
<?xml version="1.0" encoding="utf-8"?>
 
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="vertical"  height="662" width="664">
 
<mx:Script>
 <![CDATA[
  
 function addRow():void
 { }
 
 function modRow():void
 { }
 
 function delRow():void
 { }
 
    ]]>
</mx:Script>
 
  <mx:VDividedBox width="100%" height="100%">
  <mx:HBox width="100%" height="100%">
         <mx:Form id="formSearch" width="90%" height="100%" />
        
   <mx:VBox width="10%" height="100%" borderStyle="solid" verticalGap="15"
                     paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
          <mx:Button   id="btnSearch"    label="Search"/>
          <mx:Button   id="btnReset"     label="Reset"/>
          <mx:CheckBox id="cbAddResults" label="Add Results?" />
          <mx:Button   id="btnClose"     label="Close" />
      </mx:VBox>
     </mx:HBox>
    
        <mx:DataGrid id="dgSearchResult" dataProvider="{dgResults}" width="100%" height="100%" />
    </mx:VDividedBox>
   
    <mx:ControlBar width="100%" height="10%">
        <!-- Use Spacer to push Button control to the right. -->
        <mx:Spacer width="100%"/>
       
        <mx:Button label="Add" click="addRow();"/>
        <mx:Button label="Mod" click="modRow();"/>
        <mx:Button label="Del" click="delRow();"/>
    </mx:ControlBar>
 
</mx:TitleWindow>
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to