6 Replies Latest reply on Nov 30, 2010 4:03 AM by stefan zedlacher

    Problems with dataservice list update

    stefan zedlacher Level 1

      Hi,

      I'm using a PHP dataservice to manage different user data. Following the examples I created a search text field, a search button (get procedure) and a list (results). So far so good, everything is working. I created also a table from the datasource with the (automatic created) send button for the update. Also working, even the list updates immediately. Then I created a create procedure with another button. Works fine while not doing the get procedure. But when I select a item from the list (filled by the get procedure) and I decide to create a new item, i clear the list, clear the list.selectedIndex (=-1) but when I create the new item it appears in the list but the previous selected Item also changes (item.id and everything) so I have TWO identical items in the list! But if I do a reload, everything is as it should be (the new item is added, the old, previous selected on has its old name). So the PHP procs working as expected.

      I tried a lot with the procedures in flex, but nothing worked.

      What am I doing wrong? Is there a way to clear the token or the list/selected index?

      Any suggestions are welcome!
      g stefan

        • 1. Re: Problems with dataservice list update
          Aurelien Vannieuwenhuyze Level 1

          Hello,

           

          I don't know if my answer can help you...

           

          The result of the PHP request must be stored in an ArrayCollection.

          This ArrayCollection could be used as a dataProvider of your first list (Through Databinding).

           

          Create another ArrayCollection for the dataProvider of the other list.

           

          By the itemClick event of the first list, you can now

          - Clear the list

          - Add the element to the other list

           

          This is an example (Flex 3.5) :

           

           

           

          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application

           

           

          xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">

           

           

           

          <mx:Script>

          <![CDATA[

           

           

          import mx.collections.ArrayCollection;

           

          import mx.events.ListEvent;

           

           

           

          //Result of your PHP request

          [

           

          Bindable]

           

          public var listItemA:ArrayCollection = new ArrayCollection([{label:"ITEM 1",data:"1"},{label:"ITEM 2",data:"2"},{label:"ITEM 3",data:"3"}]);

           

          [

          Bindable]

           

          public var listItemB:ArrayCollection = new ArrayCollection();

           

           

          public function copyItemToB(e:ListEvent):void

          {

           

           

          //Clearing the list B

          listItemB.removeAll();

           

           

           

          //Adding the new Element;

          listItemB.addItem(e.currentTarget.selectedItem);

          }

           

          ]]>

           

           

          </mx:Script>

           

           

           

           

          <mx:List x="26" y="21" dataProvider="{listItemA}" itemClick="copyItemToB(event)"></mx:List>

           

           

          <mx:List x="109" y="21" height="156" dataProvider="{listItemB}" width="76"></mx:List>

           

           

          </mx:Application>

           

           

           

          I Hope to have you helped

          • 2. Re: Problems with dataservice list update
            stefan zedlacher Level 1

            THX,

            I tried that but the problem is, that I use a spark.component.list and not an ArrayCollection. Changing the <s:List> to the <mx:List> ends at the point where I have to convert the valueObjects from the PHP dataservice to static Objects for the ArrayCollection. Nevertheless I tried it also with the <mx:List> attaching the values step by step - same result. I'll try with the ArrayCollection but I have a large amount of data so converting every valueObject to an ArrayCollection would be enormous.....

            lg stefan

            • 3. Re: Problems with dataservice list update
              Aurelien Vannieuwenhuyze Level 1

              hello,

               

              Can you send me a part of your code ?

               

              Thx.

              • 4. Re: Problems with dataservice list update
                stefan zedlacher Level 1

                Hi,

                here is the code and a link to a movie that shows you the problem.
                Also, here ist the URL to the online version where you could try (only change the dataset id to 3 or 2 or another number)
                Hope you find something...
                THX, stefan
                -- CODE --

                <?xml version="1.0" encoding="utf-8"?>

                <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" creationComplete="creationComplete();"

                   xmlns:s="library://ns.adobe.com/flex/spark"

                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="1000" minHeight="600"

                   xmlns:phplistuseruserservice="services.phplistuseruserservice.*"

                   xmlns:valueObjects="valueObjects.*"

                   xmlns:svreguliererausgeschiedenservice="services.svreguliererausgeschiedenservice.*" backgroundColor="#C7C7C7"

                   xmlns:sbpersonenparagraphservice="services.sbpersonenparagraphservice.*"

                   xmlns:skillsservice="services.skillsservice.*"

                   xmlns:skillsbewertungservice="services.skillsbewertungservice.*"

                   xmlns:campuskurseservice="services.campuskurseservice.*"

                   xmlns:versichererservice="services.versichererservice.*"

                   xmlns:bewerberservice1="services.bewerberservice1.*"

                   xmlns:skillspersonenservice="services.skillspersonenservice.*"

                   xmlns:campusteilnehmerexternservice="services.campusteilnehmerexternservice.*"

                   xmlns:campusanmeldungenservice="services.campusanmeldungenservice.*"

                   xmlns:net="flash.net.*" height="888"

                   xmlns:bemerkungenservice="services.bemerkungenservice.*"

                   xmlns:erinnerungenservice="services.erinnerungenservice.*"

                   xmlns:aktenvermerkeservice="services.aktenvermerkeservice.*"

                   xmlns:components="mh.components.*"

                   xmlns:zehnet="zehnet.flex.controls.*"

                   xmlns:dokumenteservice="services.dokumenteservice.*"

                   xmlns:besonderheitenservice="services.besonderheitenservice.*"

                   xmlns:bewerberservice="services.bewerberservice.*"

                   xmlns:benutzergruppenservice="services.benutzergruppenservice.*"

                   xmlns:svreguliererversichererservice="services.svreguliererversichererservice.*"

                   xmlns:example="com.example.programmingas3.fileio.*">

                <s:layout>

                <s:VerticalLayout horizontalAlign="center" paddingTop="10" gap="10"/>

                </s:layout>

                <fx:Style source="phpListPersonal.css"/>

                 

                <fx:Script>

                <![CDATA[

                import flashx.textLayout.formats.Float;

                 

                import mx.collections.ArrayCollection;

                import mx.controls.Alert;

                import mx.controls.List;

                import mx.core.FlexGlobals;

                import mx.events.CalendarLayoutChangeEvent;

                import mx.events.FlexEvent;

                import mx.events.ListEvent;

                import mx.rpc.events.ResultEvent;

                 

                import org.alivepdf.display.Display;

                import org.alivepdf.fonts.*;

                import org.alivepdf.layout.*;

                import org.alivepdf.pages.Page;

                import org.alivepdf.pdf.PDF;

                import org.alivepdf.saving.Method;

                 

                import spark.events.IndexChangeEvent;

                import spark.events.TextOperationEvent;

                Ê

                 

                // ---FUNKTIONEN--- //

                 

                 

                 

                // nicht mit dem ersten sondern mit einem anderen Canvas im Viewstack starten

                private function creationComplete(): void {

                //Security.loadPolicyFile("http://www.example.com/typo3conf/ext/my_ext/pi1/static/crossdomain.xml");

                Security.allowDomain("*");

                Security.loadPolicyFile("http://intern.faircheck.at/crossdomain.xml");

                 

                //Security.loadPolicyFile("http://localhost/faircheck/faircheck_personaldB-debug/crossdomain.xml");

                viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("BemerkungenCanvas"));

                 

                /*

                //ONLY FOR TESTING!!!!

                 

                //viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("fileUploadCanvas"));

                viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("paragraphCanvas"));

                 

                //Buttons active (enabled) schalten

                 

                PersonParagraphBtn.enabled = true;

                skillsBewertungBtn.enabled = true;

                skillsBtn.enabled = true;

                BewerberBtn.enabled = true;

                campusKurseBtn.enabled = true;

                campusPersonenBtn.enabled = true;

                PersonNewsletterBtn.enabled = true;

                VersichererBtn.enabled = true;

                //Zeile Unten

                btnSaveImage.enabled = true;

                btnSaveErinnerung.enabled = true;

                btnSaveBemerkung.enabled = true;

                btnSaveAktenvermerk.enabled = true;

                btnSaveAusbildgunsausweis.enabled = true;

                btnSaveBesonderheiten.enabled = true;

                */

                 

                 

                 

                //focusManager.setFocus(username);

                //username.setFocus();

                //FlexGlobals.topLevelApplication.addEventListener(KeyboardEvent.KEY_UP, username.setFocus());

                /*

                if (ExternalInterface.available) {

                ExternalInterface.call('setFocus');

                } else {

                Alert.show("Browser not available");

                }

                */ Ê Ê Ê Ê Ê Ê Ê

                }

                 

                //-----RELOAD SCRIPT-------------//

                 

                private function reloadpage(event:MouseEvent):void

                {

                 

                var ref:URLRequest = new URLRequest("javascript:location.reload(true)");

                navigateToURL(ref, "_self");

                 

                //login ausfŸhren !!

                //checkLogin(yes);

                 

                }

                 

                private function reloadpagePersonen(event:MouseEvent):void {

                viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("BemerkungenCanvas"));

                }

                 

                 

                 

                 

                //-----FILE UPLOADER-----------//

                 

                protected function dataGrid_creationCompleteHandler(event:FlexEvent):void

                {

                getAllSB_Personen_paragraphResult.token = sBPersonenparagraphService.getAllSB_Personen_paragraph("","");

                }

                 

                 

                protected function comboBoxFileUploaderPersonen_creationCompleteHandler(event:FlexEvent):void

                {

                if(!sB_Personen_paragraph.personalID){

                getAllSB_Personen_paragraphResult.token = sBPersonenparagraphService.getAllSB_Personen_paragraph("","");

                }

                }

                 

                /*

                protected function comboBoxBenutzergruppen_creationCompleteHandler(event:FlexEvent):void

                {

                getColumnsSB_Personen_paragraphResult.token = sBPersonenparagraphService.getColumnsSB_Personen_paragraph();

                //getColumnsSB_Personen_paragraphResult.token = sBPersonenparagraphService.getColumnsSB_Personen_paragraph();

                }

                */

                 

                 

                //-----SCREENSHOT EXPORT-------//

                 

                import mx.graphics.ImageSnapshot;

                import mx.graphics.codec.*;

                Ê

                private const jpegEnc:JPEGEncoder = new JPEGEncoder();

                private const xmlObj:XML = describeType(FileReference);

                 

                /*Ê

                private function init():void {

                //textArea.text = xmlObj.toXMLString();

                }

                */

                 

                 

                public var call:int = 0;

                private function getDateForDokumente(dokGruppe:String, personenID:int):Date {

                //getAllDokumenteResult.token = dokumenteService.getAllDokumente(personenID);

                var datum:Date = new Date();

                var dokDate:Date;

                var count:int = 0;

                call++;

                //getAllDokumenteResult.lastResult[0].Rubrik

                 

                for (var item:String in getAllDokumenteResult.lastResult){

                count+=1;

                if(getAllDokumenteResult.lastResult[item].Rubrik == dokGruppe){

                //if(Datum == dok

                dokDate = getAllDokumenteResult.lastResult[item].Datum;

                } else {

                //dokDate = datum;

                }

                }

                 

                /*

                for (var documents in getAllErinnerungenByDatasetIDResult.lastResult){

                count+=1;

                if(documents.Rubrik == dokGruppe){

                //if(Datum == dok

                dokDate = documents.Datum;

                } else {

                //dokDate = datum;

                }

                }

                */

                //dokDate = dokumente[0].Datum;

                //return (call.toString()+' - '+count.toString()+' '+personenID.toString());

                return dokDate;

                //return datum;

                //trace(dokDate);

                }

                 

                //-------------BEMERKUNGEN FUNKTIONEN-------//

                 

                protected function btnSendBemerkungen_clickHandler(event:MouseEvent):void

                {

                bemerkungen.personalID = personalIDTextInputBemerkungen.text;

                bemerkungen.Benutzer = benutzerTextInputBemerkungen.text;

                 

                bemerkungen.zeitstempel = zeitstempelDateFieldBemerkungen.selectedDate;

                bemerkungen.Bemerkung = bemerkungTextInputBemerkungen.text;

                 

                bemerkungen.idDatensatz = parseInt(idDatasetTextInputBemerkungen.text);

                bemerkungen.tableDatensatz = comboBoxDatasetTableBemerkungen.selectedItem.toString();

                 

                if(bemerkungen.id==0){

                //CREATE Functions here

                createBemerkungenResult.token = bemerkungenService.createBemerkungen(bemerkungen);

                //Clear list

                getBemerkungenByDatasetIDResult.token = bemerkungenService.getBemerkungenByDatasetID("0","0");

                //reloadpage(event);

                } else {

                updateBemerkungenResult.token = bemerkungenService.updateBemerkungen(bemerkungen);

                }

                //getBemerkungenByDatasetIDResult.token = bemerkungenService.getBemerkungenByDatasetID(idDatasetTextInput.text,tableDatasetTextInpu t.text);

                 

                }

                 

                 

                protected function btnDeleteBemerkungen_clickHandler(event:MouseEvent):void

                {

                // DELETE Function here

                deleteBemerkungenResult.token = bemerkungenService.deleteBemerkungen(bemerkungen.id);

                }

                 

                protected function btnGetBemerkungenByDatasetID_clickHandler(event:MouseEvent):void

                {

                getBemerkungenByDatasetIDResult.token = bemerkungenService.getBemerkungenByDatasetID(idDatasetTextInputBemerkungen.text,tableData setTextInputBemerkungen.text);

                 

                }

                 

                 

                protected function listBemerkungenDaten_changeHandler(event:IndexChangeEvent):void

                {

                bemerkungen = listBemerkungenDaten.selectedItem;

                }

                 

                protected function listBemerkungenMX_changeHandler(event:ListEvent):void

                {

                // TODO Automatisch generierter Methoden

                bemerkungen.Bemerkung = listBemerkungenMX.selectedItem.Bemerkung;

                }

                 

                [Bindable

                public var listItemB:ArrayCollection = new ArrayCollection();Ê

                 

                protected function btnClearBemerkungen_clickHandler(event:MouseEvent):void

                {

                listItemB.removeAll();

                listBemerkungenDaten.selectedIndex=-1;

                //listBemerkungenDaten.removeAll();

                 

                //listItemB = listBemerkungenDaten;

                bemerkungen.id = 0;

                 

                personalIDTextInputBemerkungen.text = txtUserPersonalID.text; //personalIDTextInputErinnerungen.text;

                benutzerTextInputBemerkungen.text = txtUserKuerzel.text; //benutzerTextInputErinnerungen.text;

                 

                 

                //Datum neu berechnen

                Ê//ÊÊÊÊdStart.selectedDate = new Date(new Date().getTime() - (5 * millisecondsPerDay));ÊÊ

                //ÊÊÊÊÊdEnd.selectedDate = new Date();

                zeitstempelDateFieldBemerkungen.selectedDate = new Date();

                bemerkungTextInputBemerkungen.text = "";;

                //personalIDTextInputBemerkungen.text = "";

                //benutzerTextInputBemerkungen.text = "";

                ///idDatasetTextInput.text = "";

                ///comboBoxDatasetTable.text = "SB_Personen_paragraph";

                ///getBemerkungenByDatasetIDResult.token = bemerkungenService.getBemerkungenByDatasetID(idDatasetTextInput.text,tableDatasetTextInpu t.text);

                ///createBemerkungenResult2.token = bemerkungenService.createBemerkungen(bemerkungen);

                }

                 

                 

                 

                protected function listSearchParagraphVersicherer_creationCompleteHandler(event:FlexEvent):void

                {

                 

                }

                 

                 

                 

                protected function btnPersonenDokumenteCanvas_clickHandler(event:MouseEvent):void

                {

                // TODO Automatisch generierter Methoden-Stub

                }

                 

                 

                protected function btnGetDokumente_clickHandler(event:MouseEvent):void

                {

                getAllDokumenteResult.token = dokumenteService.getAllDokumente(sB_Personen_paragraph.id);

                }

                 

                /*

                protected function dataGridDokumentePersonen_creationCompleteHandler(event:FlexEvent):void

                {

                getAllDokumenteResult.token = dokumenteService.getAllDokumente(sB_Personen_paragraph.id);

                }

                */

                 

                public function insertDocument():void {

                //uploader.upload();

                //uploader.Filereference

                //mx..controls.Alert.show();

                //mx..controls.Alert.show('Jetzt geht es in die DATABASE!');

                }

                 

                 

                ]]>

                </fx:Script>

                 

                <!-- STATES -->

                <!--

                <s:states>

                <s:State name="State1"/>

                <s:State name="register"/>

                </s:states>

                -->

                 

                <!-- DECLARATIONS -->

                <fx:Declarations>

                 

                 

                <s:CallResponder id="getAllSV_Regulierer_ausgeschiedenResult"/>

                <svreguliererausgeschiedenservice:SVReguliererausgeschiedenService id="sVReguliererausgeschiedenService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                 

                <valueObjects:SB_Personen_paragraph id="sB_Personen_paragraph"/>

                <sbpersonenparagraphservice:SBPersonenparagraphService id="sBPersonenparagraphService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                <s:CallResponder id="getAllSB_Personen_paragraphResult"/>

                <s:CallResponder id="updateSB_Personen_paragraphResult"/>

                <s:CallResponder id="getColumnsSB_Personen_paragraphResult"/>

                <s:CallResponder id="getAllSB_Personen_paragraphByKuerzelResult"/>

                <!-- bei den Versicherern-->

                <s:CallResponder id="getAllSB_Personen_paragraphByKuerzelResult3"/>

                 

                <valueObjects:Bemerkungen id="bemerkungen"/>

                <bemerkungenservice:BemerkungenService id="bemerkungenService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                <s:CallResponder id="getAllBemerkungenResult"/>

                <s:CallResponder id="getBemerkungenByDatasetIDResult"/>

                <s:CallResponder id="createBemerkungenResult"/>

                 

                 

                <valueObjects:Dokumente id="dokumente"/>

                <dokumenteservice:DokumenteService id="dokumenteService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                <s:CallResponder id="createDokumenteResult"/>

                <s:CallResponder id="updateDokumenteResult"/>

                <s:CallResponder id="deleteDokumenteResult"/>

                <s:CallResponder id="getAllDokumenteResult"/>

                 

                <valueObjects:Erinnerungen id="erinnerungen"/>

                <erinnerungenservice:ErinnerungenService id="erinnerungenService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                <s:CallResponder id="createErinnerungenResult"/>

                <s:CallResponder id="deleteErinnerungenResult"/>

                <s:CallResponder id="getAllErinnerungenByDatasetIDResult"/>

                <s:CallResponder id="updateErinnerungenResult"/>

                 

                <s:CallResponder id="createBemerkungenResult2"/>

                <s:CallResponder id="updateBemerkungenResult"/>

                <s:CallResponder id="deleteBemerkungenResult"/>

                 

                </fx:Declarations>

                 

                <mx:ViewStack id="viewstack1" width="1000" height="621" y="65">

                 

                <!-- BEMERKUNGEN EINGABE DATEN -->

                <!--<s:NavigatorContent label="bemerkungenCanvas" width="100%" height="100%"></s:NavigatorContent> -->

                <mx:Canvas id="BemerkungenCanvas" label="Bemerkungen" backgroundColor="#E8E8E8">

                <s:Label text="Bemerkungen Eingabe Daten" fontSize="14" x="14" y="10"/>

                 

                <mx:Form x="352" y="37" paddingLeft="5" paddingRight="5" paddingBottom="5" paddingTop="5" height="249" width="371" borderVisible="true" borderStyle="solid" borderColor="#9D9D9D">

                <mx:FormHeading label="Bemerkungen"/>

                <mx:FormItem label="Zeitstempel">

                <mx:DateField id="zeitstempelDateFieldBemerkungen" selectedDate="{bemerkungen.zeitstempel}"/>

                </mx:FormItem>

                <mx:FormItem label="Bemerkung" height="49" width="312">

                <s:TextArea id="bemerkungTextInputBemerkungen" verticalAlign="top" text="{bemerkungen.Bemerkung}" width="205" height="49"/>

                </mx:FormItem>

                <mx:FormItem label="Tabelle" width="290">

                <!--<mx:ComboBox x="775" y="523" id="comboboxUserGruppe" dataProvider="{ [ 'Regulierer', 'Intern', 'Key Account', 'Kooperationspartner','Franchisenehmer','Bewerber Ausgeschiedene','Externe (Campus)','Superuser','Administrator' ] }" textAlign="right" width="179"/>-->

                 

                <mx:ComboBox id="comboBoxDatasetTableBemerkungen" dataProvider="{ [ 'SB_Personen_paragraph', 'Skills', 'Bewertungen', 'Bewerber', 'Campus Kurse', 'Campus Personen', 'Newsletter', 'Versicherer' ] }" />

                </mx:FormItem>

                <mx:FormItem label="PersonalID" width="307">

                <s:TextInput id="personalIDTextInputBemerkungen" text="{bemerkungen.personalID}" width="207"  selectable="true" editable="false" contentBackgroundColor="#E0DCDC"/>

                </mx:FormItem>

                <mx:FormItem label="KŸrzel" width="316">

                <s:TextInput id="benutzerTextInputBemerkungen" text="{bemerkungen.Benutzer}" width="207"  selectable="true" editable="false" contentBackgroundColor="#E0DCDC"/>

                </mx:FormItem>

                <s:HGroup width="354" height="40" paddingLeft="0" paddingRight="0" paddingTop="10" paddingBottom="10" gap="5">

                <s:Button id="btnDeleteBemerkungen" label="Lšschen"  click="btnDeleteBemerkungen_clickHandler(event)"/>

                <!--

                <s:Button id="btnCreateBemerkungen" label="Create"  click="btnCreateBemerkungen_clickHandler(event)" enabled="false"/>

                -->

                <s:Button id="btnSendBemerkungen" label="speichern (send)" click="btnSendBemerkungen_clickHandler(event)"/>

                <s:Button label="neu (clear)" id="btnClearBemerkungen" click="btnClearBemerkungen_clickHandler(event)"/>

                </s:HGroup>

                </mx:Form>

                <mx:Form x="6" y="37" height="249" width="340" paddingLeft="5" paddingRight="5" paddingBottom="5" paddingTop="5" borderVisible="true" borderStyle="solid" borderColor="#9D9D9D">

                <mx:FormItem label="TableDataset"  width="222">

                <s:TextInput id="tableDatasetTextInputBemerkungen" text="SB_Personen_paragraph"/>

                </mx:FormItem>

                <mx:FormItem label="IdDataset" width="222">

                <s:TextInput id="idDatasetTextInputBemerkungen" text="{sB_Personen_paragraph.id.toString()}"/>

                </mx:FormItem>

                <s:Button label="Bemerkungen Abfragen" id="btnGetBemerkungenByDatasetID" click="btnGetBemerkungenByDatasetID_clickHandler(event)"/>

                <s:List width="270" id="listBemerkungenDaten" labelField="Bemerkung" change="listBemerkungenDaten_changeHandler(event)">

                <s:AsyncListView list="{getBemerkungenByDatasetIDResult.lastResult}" />

                </s:List>

                </mx:Form>

                <s:TextArea x="731" y="57" text="{listBemerkungenDaten.selectedItem.id}" height="131" enabled="false"/>

                <s:TextArea x="733" y="226" text="{bemerkungen.id}" height="60" enabled="false"/>

                <s:Label x="731" y="37" text="selectedItem Liste" color="#999999"/>

                <s:Label x="731" y="205" text="Objekt Bemerkungen id" color="#999999"/>

                <mx:List x="14" y="294" width="267" id="listBemerkungenMX" dataProvider="{getBemerkungenByDatasetIDResult.lastResult}" labelField="Bemerkung" change="listBemerkungenMX_changeHandler(event)" enabled="false"></mx:List>

                 

                <s:HGroup width="1000" height="30" textAlign="right" x="-2" y="476">

                <s:Label text="angemeldet als: " verticalAlign="bottom" paddingLeft="0" paddingTop="5"/>

                <s:TextInput id="txtUserLogOn" textAlign="left" paddingTop="5" contentBackgroundAlpha="0.0" borderVisible="false" color="#FFFFFF" width="280"/>

                <s:TextInput id="txtUserKuerzel" textAlign="right" paddingTop="5" contentBackgroundAlpha="0.0" borderVisible="false" color="#FFFFFF" width="574" text="Gast"/>

                <s:TextInput id="txtUserPersonalID" paddingTop="5" contentBackgroundAlpha="0.0" borderVisible="false" color="#FFFFFF" width="43" text="0000" textAlign="left"/>

                </s:HGroup>

                </mx:Canvas>

                </mx:ViewStack>

                </s:Application>

                 

                 

                 

                 

                • 5. Re: Problems with dataservice list update
                  Aurelien Vannieuwenhuyze Level 1

                  Hello,

                   

                  When i test your application on IE with Flash Debugger Active X (you can download it for Mac at this adress : http://www.adobe.com/support/flashplayer/downloads.html), i have this error when i use the clear button :

                   

                  Error: Attempting to update a UID property 'id' which is not supported.

                  at mx.data::DataMessageCache/logUpdate()

                  at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::logUpdate()

                  at mx.data::ConcreteDataService/itemUpdateHandler()

                  at flash.events::EventDispatcher/dispatchEventFunction()

                  at flash.events::EventDispatcher/dispatchEvent()

                  at mx.data.utils::Managed$/setProperty()

                  at valueObjects::_Super_Bemerkungen/set id()

                  at BemerkungenStandalone/btnClearBemerkungen_clickHandler()

                  at BemerkungenStandalone/__btnClearBemerkungen_click()

                   

                  And all the ID have the 0 value.

                   

                  I'm looking for a solution

                   

                  Regards

                   

                  Aurélien

                   

                   

                   

                   

                   

                  Date: Tue, 30 Nov 2010 03:18:34 -0700

                  From: forums@adobe.com

                  To: aurelien.vannieuwenhuyze@hotmail.fr

                  Subject: Problems with dataservice list update

                   

                  Hi,here is the code and a link to a movie that shows you the problem.

                  http://stefan.zedlacher.net/adobe/listProblems.html

                  Also, here ist the URL to the online version where you could try (only change the dataset id to 3 or 2 or another number)

                  http://intern.faircheck.at/db/personen/BemerkungenStandalone.html

                   

                  Hope you find something...

                  THX, stefan

                   

                  -- CODE --

                  <?xml version="1.0" encoding="utf-8"?>

                  <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" creationComplete="creationComplete();"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="1000" minHeight="600"

                     xmlns:phplistuseruserservice="services.phplistuseruserservice.*"

                     xmlns:valueObjects="valueObjects.*"

                     xmlns:svreguliererausgeschiedenservice="services.svreguliererausgeschiedenservice.*" backgroundColor="#C7C7C7"

                     xmlns:sbpersonenparagraphservice="services.sbpersonenparagraphservice.*"

                     xmlns:skillsservice="services.skillsservice.*"

                     xmlns:skillsbewertungservice="services.skillsbewertungservice.*"

                     xmlns:campuskurseservice="services.campuskurseservice.*"

                     xmlns:versichererservice="services.versichererservice.*"

                     xmlns:bewerberservice1="services.bewerberservice1.*"

                     xmlns:skillspersonenservice="services.skillspersonenservice.*"

                     xmlns:campusteilnehmerexternservice="services.campusteilnehmerexternservice.*"

                     xmlns:campusanmeldungenservice="services.campusanmeldungenservice.*"

                     xmlns:net="flash.net.*" height="888"

                     xmlns:bemerkungenservice="services.bemerkungenservice.*"

                     xmlns:erinnerungenservice="services.erinnerungenservice.*"

                     xmlns:aktenvermerkeservice="services.aktenvermerkeservice.*"

                     xmlns:components="mh.components.*"

                     xmlns:zehnet="zehnet.flex.controls.*"

                     xmlns:dokumenteservice="services.dokumenteservice.*"

                     xmlns:besonderheitenservice="services.besonderheitenservice.*"

                     xmlns:bewerberservice="services.bewerberservice.*"

                     xmlns:benutzergruppenservice="services.benutzergruppenservice.*"

                     xmlns:svreguliererversichererservice="services.svreguliererversichererservice.*"

                     xmlns:example="com.example.programmingas3.fileio.*">

                  <s:layout>

                  <s:VerticalLayout horizontalAlign="center" paddingTop="10" gap="10"/>

                  </s:layout>

                  <fx:Style source="phpListPersonal.css"/>

                   

                  <fx:Script>

                  <![CDATA[

                  import flashx.textLayout.formats.Float;

                   

                  import mx.collections.ArrayCollection;

                  import mx.controls.Alert;

                  import mx.controls.List;

                  import mx.core.FlexGlobals;

                  import mx.events.CalendarLayoutChangeEvent;

                  import mx.events.FlexEvent;

                  import mx.events.ListEvent;

                  import mx.rpc.events.ResultEvent;

                   

                  import org.alivepdf.display.Display;

                  import org.alivepdf.fonts.*;

                  import org.alivepdf.layout.*;

                  import org.alivepdf.pages.Page;

                  import org.alivepdf.pdf.PDF;

                  import org.alivepdf.saving.Method;

                   

                  import spark.events.IndexChangeEvent;

                  import spark.events.TextOperationEvent;

                  Ê

                   

                  // -FUNKTIONEN- //

                   

                   

                   

                  // nicht mit dem ersten sondern mit einem anderen Canvas im Viewstack starten

                  private function creationComplete(): void {

                  //Security.loadPolicyFile("http://www.example.com/typo3conf/ext/my_ext/pi1/static/crossdomain.xml");

                  Security.allowDomain("*");

                  Security.loadPolicyFile("http://intern.faircheck.at/crossdomain.xml");

                   

                  //Security.loadPolicyFile("http://localhost/faircheck/faircheck_personaldB-debug/crossdomain.xml");

                  viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("BemerkungenCanvas"));

                   

                  /*

                  //ONLY FOR TESTING!!!!

                   

                  //viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("fileUploadCanvas" ));

                  viewstack1.selectedIndex = viewstack1.getChildIndex(viewstack1.getChildByName("paragraphCanvas") );

                   

                  //Buttons active (enabled) schalten

                   

                  PersonParagraphBtn.enabled = true;

                  skillsBewertungBtn.enabled = true;

                  skillsBtn.enabled = true;

                  BewerberBtn.enabled = true;

                  campusKurseBtn.enabled = true;

                  campusPersonenBtn.enabled = true;

                  PersonNewsletterBtn.enabled = true;

                  VersichererBtn.enabled = true;

                  //Zeile Unten

                  btnSaveImage.enabled = true;

                  btnSaveErinnerung.enabled = true;

                  btnSaveBemerkung.enabled = true;

                  btnSaveAktenvermerk.enabled = true;

                  btnSaveAusbildgunsausweis.enabled = true;

                  btnSaveBesonderheiten.enabled = true;

                  */

                   

                   

                   

                  //focusManager.setFocus(username);

                  //username.setFocus();

                  //FlexGlobals.topLevelApplication.addEventListener(KeyboardEvent.KEY_U P, username.setFocus());

                  /*

                  if (ExternalInterface.available) {

                  ExternalInterface.call('setFocus');

                  } else {

                  Alert.show("Browser not available");

                  }

                  */ Ê Ê Ê Ê Ê Ê Ê

                  }

                   

                  //

                   

                  • 6. Re: Problems with dataservice list update
                    stefan zedlacher Level 1

                    Hi,

                    yes, I got the same error some times. I think it has to do with some database entries but I'm not sure. In the code, the "reset" of the id (bemerkungen.id = 0) is only a workaround to clear the selected id. You could see both ids in the two textfields on the right.

                    Thx, stefan