This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Create mobility application in v6.0 m10 or older netbeans such as netbeans 5.5 with default setting. 2. In the last nightly build, convert the HelloMidlet to visual designer. And some command to the form and add some pre-action and post-action code to the command action. 3. Make some changes to the form and save the form. the pre-action and post-action code will lost.
I was trying to reproduce it with latest development build and it works without any problem. Here is what I was doing: 1) I have created a new HelloMidlet in NetBeans 6.0 Milestone 10 2) I have started NB 6.0 dev build, and there: 3) I have converted the HelloMidlet to a new ConvertedHelloMidlet class. 4) I have opened the new class (it opens in Flow view). 5) I have added a new "Ok Command" from palette to the "HelloForm". 6) I have switched to the Source tab. Code is automatically updated for "Ok Command" component. 7) I have added "//pre" and "//post" text to the "pre-action" and "post-action" section related to "OkCommand" in commandAction method. 8) I have switched to the Flow view tab. 9) I have changed "HelloForm" "title" property to "myHelloForm1". 10) I have saved the file using Ctrl+S. 11) The code generated properly and the particular "user-code" is there. I also check to set "pre-action" and "post-action" to the "ExitCommand" in the original HelloMidlet class before the conversion. The conversion was successful and the user-code is copied there correctly. Resolving as WorksForMe. Feel free to reopen the issue, then please, add a step-by-step how to reproduce the issue together with original and converted files. Thanks.
I do more test, and I find it will not only affect the convert midlet, but affect all midlets. The following steps will always reproduce for me: 1. Create Mobility project. 2. Open HelloMIDlet, switch to source mode and add some post action code like: //hello world 3. Save and close it. 4. Open HelloMIDlet again, double click to open the form and add a textfield to it. 5. Switch to source mode, all the post action code disappear. Here is the info I get from the about dialog: Product Version: NetBeans IDE Dev (Build 200709131200) Java: 1.5.0_10; Java HotSpot(TM) Client VM 1.5.0_10-b03 System: Linux version 2.6.22 running on i386; UTF-8; zh_CN (nb) Userdir: /home/wind/.netbeans/dev
I have reproduce it. Thanks. I will fix it asap.
Fixed in main trunk. The fix is going to be visible in the tomorrow's daily build or NB 6.0 beta 2. Workaround: when making any change in the source code (between guarded-blocks e.g. pre-action, post-action, ...), then you have to save the file in the "Flow" or "Screen" view and additionally do some change in the model. Please, check whether there are not any other code-generation issues - the code generation should keep all the user-codes int the file and should be updated in case that the document is modified and an user switched to the sources or saves the file. Thanks.
*** Issue 116428 has been marked as a duplicate of this issue. ***
Fixed on release60_beta1 branch too: Checking in io/manifest.mf; /cvs/mobility/designer2/io/manifest.mf,v <-- manifest.mf new revision: 1.3.2.1; previous revision: 1.3 done Checking in io/src/org/netbeans/modules/vmd/io/CodeResolver.java; /cvs/mobility/designer2/io/src/org/netbeans/modules/vmd/io/CodeResolver.java,v <-- CodeResolver.java new revision: 1.11.6.1; previous revision: 1.11 done Checking in kit/nbproject/project.xml; /cvs/mobility/designer2/kit/nbproject/project.xml,v <-- project.xml new revision: 1.3.2.1; previous revision: 1.3 done
Due to designer2/io module spec. version update on release60_beta1 branch, the spec. version was updated on the main trunk too: Checking in io/manifest.mf; /cvs/mobility/designer2/io/manifest.mf,v <-- manifest.mf new revision: 1.4; previous revision: 1.3 done Checking in kit/nbproject/project.xml; /cvs/mobility/designer2/kit/nbproject/project.xml,v <-- project.xml new revision: 1.4; previous revision: 1.3 done
verified together with issue 116527. The fix is available in trunk daily builds or at Update Center for the 6.0 Beta1 build.
*** Issue 120013 has been marked as a duplicate of this issue. ***