Hi,
i'm new to this flex please help, i'm facing some issue i'll post those codes.
Actually i trying to pass a list from java class to combo box in flex.
ActionScript:
*********************************
package assets.actionScript
{
import mx.collections.ArrayCollection;
import mx.controls.List;
[Bindable]
[RemoteClass(alias="com.connectm.telecom.commandcenter.dto.CommandCenterConfigPaceDTO")]
public class CommandCenterConfigPace
{
public var command_config_id:int;
public var command_name:String;
public var command:String;
public var command_disc:String;
public var flag:String;
}
}
****************************************
Java Class
****************************************
public List<CommandCenterConfigPaceDTO> getCommandNames()
{
DAO dao = new Telecom_DAO();
Session session = dao.getHibernateSession();
List<CommandCenterConfigPaceDTO> commandCenterConfigList = new ArrayList<CommandCenterConfigPaceDTO>();
try
{
List commandCenterList = session.createSQLQuery("select command_config_id,command_name,command,command_disc,flag from command_center_config_pace where flag = 1").list();
for(Object object:commandCenterList)
{
Object data[] = (Object[]) object;
CommandCenterConfigPaceDTO commandCenterConfigPaceDTO = new CommandCenterConfigPaceDTO();
commandCenterConfigPaceDTO.setCommand_config_id((Integer) data[0]);
commandCenterConfigPaceDTO.setCommand_name(data[1].toString());
commandCenterConfigPaceDTO.setCommand(data[2].toString());
commandCenterConfigPaceDTO.setCommand_disc(data[3].toString());
commandCenterConfigPaceDTO.setFlag(data[4].toString());
commandCenterConfigList.add(commandCenterConfigPaceDTO);
}
}catch (Exception e) {
logger.error("Exception in EscalationLiveService to calling getCommandNames..."
+ e.getMessage());
}
finally
{
if (session != null && session.isOpen())
{
dao.closeHibernateSession();
}
}
return commandCenterConfigList;
}
************************************************************
flex file:
***********************************************************
="1.0"="utf-8"
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="callRemoteObject()"
xmlns:local="alarmSlide.*" horizontalAlign="center"
verticalAlign="middle" borderColor="#222222"
backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#011234, #000000]">
<mx:RemoteObject id="remoteObject" destination="liveStatus"
result="resultHandler(event);"
fault="faultHandler(event);"/>
<mx:Script>
<![CDATA[
</mx:Script>
<mx:Style source="/assets/style/Tabular.css"/>
<mx:Panel width="100%" height="100%" title="Send SMS To Tower" color="#FFFFFF" id="mainPanel" layout="absolute">
<mx:VBox width="100%" height="100%" backgroundColor="#E1E8F7">
<mx:HBox width="100%" height="25">
<mx:Label text=" Command Name" fontWeight="bold" fontSize="10" width="150" color="#080707"/>
<mx:ComboBox id="commandNamesId" cornerRadius="0" width="376" fontSize="10" selectedIndex="1" dataProvider="{commandNamesList}" color="#0B0A0A"/>
</mx:HBox>
<mx:HBox width="100%" height="75">
<mx:Label text=" Discription " fontWeight="bold" fontSize="10" width="150" color="#080707"/>
<mx:TextInput width="376" id="discrip" editable="false" height="73" color="#0B0A0A"/>
</mx:HBox>
<mx:HBox width="100%" height="25">
<mx:Label text=" Command " fontWeight="bold" fontSize="10" width="150" color="#080707"/>
<mx:TextInput id="commandToBeSend" width="377" height="25" color="#0B0A0A"/>
</mx:HBox>
<mx:HBox width="100%" height="25">
<mx:Spacer width="300" height="10"/>
<mx:Button x="500" toolTip="Send Message" label="Submit" height="25" width="75" click="sendSMSToTower()" color="#080707"/>
</mx:HBox>
<mx:HBox width="100%" height="100%">
<mx:AdvancedDataGrid id="checkADG" groupItemRenderer="assets.actionScript.DotaADGRenderer"
width="100%" height="100%" color="#000000"
horizontalScrollPolicy="on"
resizableColumns="true" x="0" y="26">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Tower Hierarchy" dataField="@label" showDataTips="true" width="500"/>
<mx:AdvancedDataGridColumn headerText="SIM Number" dataField="@simNumber" showDataTips="true" width="300"/>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:HBox>
</mx:VBox>
</mx:Panel>
</mx:Application>
*************************************************************************
Please help me where i'm wrong. and changes should i do... please please help...