Hello Folks:
I'm trying to learn Dolphin and I've developed a tiny app based in Personal Money, but the option "Save" don't works. "Save As" works ok, but "Save" don't save the changes in the file. I've heard that may be that the Shell must know the filename, then I've tried generating a method beforeSave, with something like "nameShell filename: filename", then the "Save" works ok, but another window shell is generated. Can someone to recommend a good method to make the Save option works?. TIA. --- Germán Arduino. |
Germán,
I think we will need a bit more information before being able to help. > I'm trying to learn Dolphin and I've developed a tiny app based in Personal > Money, but the option "Save" don't works. "Save As" works ok, but "Save" > don't save the changes in the file. What actually happens?. Does it raise a walkback, write to the file and save the wrong thing, write to the file but not save anything new or just not write to the file at all (file updated timestamp never changes) > I've heard that may be that the Shell must know the filename, then I've > tried generating a method beforeSave, with something like "nameShell > filename: filename", then the "Save" works ok, but another window shell is > generated. It should do this for you automatically. DocumentShell (I'm assuming you have subclassed from DocumentShell) has an instance variable that remembers the filename. If you ask it to #save without previously using #saveAs then it will automatically invoke #saveAs for you and remember the selected filename for future use. Further #saves should then use this stored String and not need to invoke #saveAs first. You can preset this filename by evaluating the following from within your shell before you call #save. self filename: 'a filename string' Opening another widow shell seems a bit strange but without seeing the code I can't really say what is wrong. > Can someone to recommend a good method to make the Save option works?. You'll really need to post some code showing exactly what you are doing (or mail it to me if you would prefer not to go public at this stage) Regards Ian |
Hello Ian:
Thanks by your response. I've tried with a "self halt" in the fileSave method of DocumentShell, and the test with PersonalMoney have worked ok!. After, without self halt, only evaluating "PersonalMoneyShell show" in the workpsace, again don't works. > What actually happens?. By example I change owner from "Name LastName" to "Name LastName OtherThing" , I make a "save" in the menu and next, open the same file and "OtherThing" isn't in the owner field. In the other field (by example accounts) works ok, only owner don't works. But this (at least one time) worked ok when I've put the self halt and try with the debug. > It should do this for you automatically. DocumentShell (I'm assuming you > have subclassed from DocumentShell) has an instance variable that remembers > the filename. If you ask it to #save without previously using #saveAs then > it will automatically invoke #saveAs for you and remember the selected > filename for future use. Further #saves should then use this stored String > and not need to invoke #saveAs first. > Yes, I've read about this and is ok. > Opening another widow shell seems a bit strange but without seeing the code > I can't really say what is wrong. Not problem, forget that, now trying only with Personal Money without changing a only one line of code. > You'll really need to post some code showing exactly what you are doing (or > mail it to me if you would prefer not to go public at this stage) Not problem with posting my code (I'm novice and must to learn) but nothing other code than original Personal Money. Thanks Again by your help and Best Regards. --- Germán Arduino |
Germán,
> By example I change owner from "Name LastName" to "Name LastName OtherThing" > , I make a "save" in the menu and next, open the same file and "OtherThing" > isn't in the owner field. In the other field (by example accounts) works ok, > only owner don't works. Right, I think I can see what you are doing. Is this right ... 1) Start a PersonalMoneyShell 2) Using the File/Open menu option to open a PersonalMoney file 3) Edit the account name 4) Save the PersonalMoney file 5) Exit PersonalMoneyShell When you evaluate 1 and 2 again then the alteration you made isn't there any more?. If that is what is happening then the problem is step 3. Editing the field isn't enough - you have to take the focus off of the edit field, by pressing the tab key or selecting an account with the mouse for example, before the change is accepted. If you add a "3a) Press tab key" to the above list than you should be OK. When you were inserting halts then the Walkback screen opening would, I imagine, be enough to take the focus from the edit field and accept the change. If this isn't the problem then please ask again. > Not problem with posting my code (I'm novice and must to learn) but nothing > other code than original Personal Money. Sorry, I misunderstood your original question. Regards Ian |
> If that is what is happening then the problem is step 3. Editing the field
> isn't enough - you have to take the focus off of the edit field, by pressing > the tab key or selecting an account with the mouse for example, before the > change is accepted. If you add a "3a) Press tab key" to the above list than > you should be OK. > > When you were inserting halts then the Walkback screen opening would, I > imagine, be enough to take the focus from the edit field and accept the > change. > > If this isn't the problem then please ask again. ok!! That was the problem! The lack of "Press tab key". Then PersonalMoney is working as is expected > > Sorry, I misunderstood your original question. > Sorry because my English isn't so good (I'm from Argentina). > Regards > Ian > Regards and Thanks You very much byt the help. --- Germán Arduino. |
Free forum by Nabble | Edit this page |