Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-15-2011, 12:49 PM   PM User | #1
svibuk
New Coder

 
Join Date: Feb 2009
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
svibuk is an unknown quantity at this point
populating grid based on filtered values in dropdown

i am very new to flashbuilder & flex mobile applications , jst started directly with databse application thr’ webservice
so in flash builder i have selected flex mobile project

consumed the webservice in the flex application
i have 3 dropdownswhich r populated with data from database thr' web services



i have a grid & a button

i need the grid to be populated with data from databse depending on the values selected from the 3 dropdowns



ie Filter concept

i am not able to do it

ccurrently i have 3 dropdown populated with fields using webservice & a grid control

how to write the filtered query & execute it in the burron click event
svibuk is offline   Reply With Quote
Old 09-15-2011, 05:35 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Post your code.
Inigoesdr is offline   Reply With Quote
Old 09-16-2011, 06:42 AM   PM User | #3
svibuk
New Coder

 
Join Date: Feb 2009
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
svibuk is an unknown quantity at this point
Code:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
		xmlns:s="library://ns.adobe.com/flex/spark"
		xmlns:service1="services.service1.*"
		xmlns:valueObjects="valueObjects.*"
		title="HomeView">
	<fx:Script>
		<![CDATA[
			import mx.events.FlexEvent;
					
		
			
			protected function drpcolor_creationCompleteHandler(event:FlexEvent):void
			{
				getCentresResult.token = service1.getCentres();
			}
			
			
			protected function drpshape_creationCompleteHandler(event:FlexEvent):void
			{
				getCentresResult2.token = service1.getCentres();
			}
			
			
			protected function drpclarity_creationCompleteHandler(event:FlexEvent):void
			{
				getCentresResult3.token = service1.getCentres();
			}
			
			
			protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
			{
				getCentresResult4.token = service1.getCentres();
			}
			
		]]>
	</fx:Script>
	<fx:Declarations>	
		<s:CallResponder id="getCentresResult"/>
		<service1:Service1 id="service1"/>
		<s:CallResponder id="getCentresResult2"/>
		<s:CallResponder id="getCentresResult3"/>
		<s:CallResponder id="getCentresResult4"/>
		
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>

	<s:Form left="0" right="246" top="61" bottom="467">
		<s:FormItem width="166" label="Color:" fontSize="12">
			<s:DropDownList id="drpcolor" x="21" y="44" width="86" height="21"
							creationComplete="drpcolor_creationCompleteHandler(event)"
							labelField="Color">
				<s:AsyncListView list="{getCentresResult.lastResult}"/>
			</s:DropDownList>
		</s:FormItem>
		<s:FormItem width="166" label="Shape:" fontSize="12">
			<s:DropDownList id="drpshape" x="126" y="44" width="86" height="21"
							creationComplete="drpshape_creationCompleteHandler(event)"
							labelField="Shape">
				<s:AsyncListView list="{getCentresResult2.lastResult}"/>
			</s:DropDownList>
		</s:FormItem>
		<s:FormItem width="166" label="Clarity:" fontSize="12">
			<s:DropDownList id="drpclarity" x="231" y="44" width="86" height="21"
							creationComplete="drpclarity_creationCompleteHandler(event)"
							labelField="Clarity">
				<s:AsyncListView list="{getCentresResult3.lastResult}"/>
			</s:DropDownList>
		</s:FormItem>
		<s:FormItem width="230" height="52">
			<s:Button id="btnsearch" left="0" top="31" bottom="8" width="167" label="Filter"
					  fontSize="12"/>
		</s:FormItem>
		<s:FormItem width="448">
			<s:DataGrid id="dataGrid" x="54" y="159" width="365"
						creationComplete="dataGrid_creationCompleteHandler(event)" fontSize="12"
						requestedRowCount="4">
				<s:columns>
					<s:ArrayList>
						<s:GridColumn dataField="Shape" headerText="Shape"></s:GridColumn>
						<s:GridColumn dataField="Color" headerText="Color"></s:GridColumn>
						<s:GridColumn dataField="Clarity" headerText="Clarity"></s:GridColumn>
					</s:ArrayList>
				</s:columns>
				<s:typicalItem>
					<fx:Object Clarity="Clarity1" Color="Color1" Shape="Shape1"></fx:Object>
				</s:typicalItem>
				<s:AsyncListView list="{getCentresResult4.lastResult}"/>
			</s:DataGrid>
		</s:FormItem>
	</s:Form>
</s:View>
this is the whole thing which i have in .mxml page
svibuk is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:43 AM.


Advertisement
Log in to turn off these ads.