about Flex DataGrid edit
Summary(¸ÅÊö)£º Adobe Flex µÄ dataGrid ÓкÜÇ¿´óµÄ¹¦ÄÜ£¬±ÈÈçItemRenderer,headerRendererµÈ£¬¿ÉÒÔ·½±ãµØʵÏÖ×Ô¼ºÏëÒªµÄ¹¦ÄÜ¡£µ«¶ÔdataGridÖ±½Ó±à¼²¢±£´æµ½Service¶Ë£¬¾ÍÓеãÂé·³ÁË¡£
Requirement(ÐèÇó)£º ¶ÔdataGrid½øÐе¥Î»¸ñ±à¼£¬ÈôÓб仯£¬±£´æµ½Service; ·ñÔò²»±£´æ¡£
Solution(½â¾ö·½°¸): ÔËÓÃDataGrid µÄ itemEditBegin ʼþ¡¢itemFocusOut ʼþ¡£
1. when the itemEditBegin is dispatched, the event handler should save this cell value as old value.(±à¼Ç°±£´æ¾ÉÖµ)
2. when the listener of itemFocusOut is responding, you should check the current cell to the old value. If it's value have changed, you should save the new value to Service.(±à¼ºóÅжϣ¬ÊÇ·ñ¸ü¸Ä¡£)
Example(Àý×Ó) as follow:
<mx:Script>
<![CDATA[
private var oldValueOfEditedItem: CreditVO;
private function creditDGEditBegin(event: DataGridEvent): void {
oldValueOfEditedItem = (event.itemRenderer.data as CreditVO).clone() as CreditVO;
}
private function editedItemChanged(newValue: CreditVO): Boolean {
return (newValue.amount != oldValueOfEditedItem.amount)||
(newValue.description != oldValueOfEditedItem.description);
}
private function creditDGEditEnd(event: DataGridEvent): void {
var newValue: CreditVO = event.itemRenderer.data as CreditVO;
if (editedItemChanged(newValue)) {
dispatchEvent(new UpdateCreditEvent(newValue))
}
}
]]>
&
Ïà¹ØÎĵµ£º
ÔÚ±¾ÏµÁÐÇ°Ã漸ƪÎÄÕÂÖзֱð½éÉÜÁËͨ¹ýWebService¡¢HTTPService¡¢URLLoaderÒÔ¼°FielReferenceµÈ×é¼þ
»òÀàÀ´Íê³ÉFlexÓë.NET·þÎñ¶ËµÄͨÐŵÄÏà¹Ø֪ʶµã¡£Í¨¹ýÕâЩ·½Ê½À´Íê³ÉÓë·þÎñ¶ËµÄͨÐÅÊǷdz£·½±ãºÍ¼òµ¥µÄ£¬µ«ÓÐËûµÄȱµã¾ÍÊÇͨÐÅÊý¾ÝÁ¿½ÏС£¬ÈçÒª´«
Êä´óÁ¿µÄÊý¾Ý»òÊÇʵÏÖ²»Í¬¶ÔÏóµÄÐòÁл¯´«Ê䣬ËüÃÇÔòÂú×ã²»ÁËÎÒÃǵ ......
һλFlexºÍJavaFXµÄRIA¿ª·¢ÕßÔÚ±¾ÆªÎÄÕÂÖжÔFlex£¬JavaFXºÍSilverlightµÄ¹¦ÄܺÍÓÅȱµã¸÷×Ô×ö³öÁËÆÀÂÛ¡£JavaFX1.1ÓÚ½ñÄê2Ô·¢²¼£¬2.0°æµÄ·¢²¼Ò²ÕýÔڼƻ®ÖС£
Flex, JavaFX, Silverlight…
̹°×À´Ëµ£¬ÔÚ¿ª·¢Õâ¸öÓ¦ÓÃÆڼ䣬ÎÒÔÚÄÚÐÄÒ»Ö±ÔڱȽÏÓÃJavaFX×öÓëÓÃAdobe Flex×öͬÑùµÄÊÂÇé¡£
¼òµ¥ËµÀ´£¬ÔÚ½ñÌ죬 Flex±ÈJav ......
Root folder
Õâ¸öĿ¼Ӧ¸ÃÌîдtomcatĿ¼Ï£¬ÄǸöjavaÏîÄ¿µÄËùÔÚλÖã¬Èç¹ûΪ´í£¬»á³öÏÖ“ Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml.”ËüÌáʾ¸ÃĿ¼WEB-INF²»´æÔÚflex-config.xml»òservice-config.xmlÎļþ£¬Èç¹ûÊÇÒ»¸öÕý³£µÄjavaÏîÄ¿£¬¾Í»áÓÐÕâ¸öÎļ ......
×î½üÓöµ½¸öÎÊÌ⣬¿ª·¢webÏîÄ¿µÄʱºò£¬¿ÉÄÜflexÖ»ÓÃÀ´ÊµÏÖÏîÄ¿µÄ²¿·ÖÄ£¿é¡£µ±flexÐèÒªÔÚ¿Í»§¶ËдÈë/¶ÁȡһЩ״̬ÐÅÏ¢µÄʱºò£¬ÎÒÃÇ»áÏëµ½ÓÃcookie¡£flexÊDz»Ö§³ÖcookieµÄ£¬Ö»ÓÐSharedObjectÕâ¸ö±¾µØ¶ÔÏó¡£ËùÒÔ½â¾öµÄ°ì·¨¾ÍÓÐÁ½¸ö£º
flexͨ¹ýµ÷ÓÃjsÀ´ÊµÏÖ¶ÔcookieµÄ²Ù×÷£»
jsͨ¹ýflexʵÏÖ¶ÔSharedObjectµÄ²Ù×÷£»
ÕâÁ½ÖÖ·½·¨ ......