LWGShane Well-Known Member Licensed User Longtime User Sep 15, 2025 #1 I would love to see the two abilities be added to the B4X lineup: Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog. Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules. I would also suggesting making this feature (if implemented) compatible with wish #1. Thanks for the consideration.
I would love to see the two abilities be added to the B4X lineup: Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog. Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules. I would also suggesting making this feature (if implemented) compatible with wish #1. Thanks for the consideration.
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #2 LWGShane said: Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules Click to expand... It would be very useful to be able to create custom classes (or code modules) just as you can with projects. An alternative would be to save a module/class with "Save As," thus having a duplicate (which, however, must then be loaded into the project). (?) "Save as template"
LWGShane said: Duplicate module... Suppose you have a module (a CRUD,BREAD, or other module) that you use as a template. Now I know you can create a new module and then select all and paste, but I would like a "native" way to duplicate modules Click to expand... It would be very useful to be able to create custom classes (or code modules) just as you can with projects. An alternative would be to save a module/class with "Save As," thus having a duplicate (which, however, must then be loaded into the project). (?) "Save as template"
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #3 LWGShane said: Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog. Click to expand... Yes, it could be useful in some cases, especially with B4XPages. But what bothers me is having to go through N menu items (the mouse cursor sometimes moves to the wrong item and you have to go back to the starting point); "many" missing buttons like this would be useful.
LWGShane said: Add multiple modules of the same type by using a separating character (ex: ";") in the "Add New Module" dialog. Click to expand... Yes, it could be useful in some cases, especially with B4XPages. But what bothers me is having to go through N menu items (the mouse cursor sometimes moves to the wrong item and you have to go back to the starting point); "many" missing buttons like this would be useful.
aeric Expert Licensed User Longtime User Sep 16, 2025 #4 1. Code Snippets is useful especially use with template tag. 2. Reusable projects can also zip as Project Templates. 3. The project template and b4xlib can contain reusable classes. These features eliminate copy and paste code.
1. Code Snippets is useful especially use with template tag. 2. Reusable projects can also zip as Project Templates. 3. The project template and b4xlib can contain reusable classes. These features eliminate copy and paste code.
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #5 aeric said: 1. Code Snippets is useful especially use with template tag. 2. Reusable projects can also zip as Project Templates. 3. The project template and b4xlib can contain reusable classes. These features eliminate copy and paste code. Click to expand... Direct, toolbar-accessible methods would be better in many ways, which I won't list here. If it's complicated for Erel to add template class/module management, perhaps the following solution would be easier -PERHAPS - for him: implement drag-and-drop of files (classes/modules) from a folder to the IDE-project (the File tab currently accepts file drops). You could then create a macro/comment to open your folder containing the template classes and...!
aeric said: 1. Code Snippets is useful especially use with template tag. 2. Reusable projects can also zip as Project Templates. 3. The project template and b4xlib can contain reusable classes. These features eliminate copy and paste code. Click to expand... Direct, toolbar-accessible methods would be better in many ways, which I won't list here. If it's complicated for Erel to add template class/module management, perhaps the following solution would be easier -PERHAPS - for him: implement drag-and-drop of files (classes/modules) from a folder to the IDE-project (the File tab currently accepts file drops). You could then create a macro/comment to open your folder containing the template classes and...!
aeric Expert Licensed User Longtime User Sep 16, 2025 #6 LucaMs said: You could then create a macro/comment to open your folder containing the template classes and...! Click to expand... If you put the code snippets inside a b4xlib then it is available by start typing "code". If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab. For me this is very convenient already. Example, I have added WebController and ApiController classes in my web project template in the past. Just not many B4X developers make use of these features. [Web] Tutorial - Using MinimaList Controller and Code Snippets Introduction This tutorial is based on MinimaList API Server (version 2.05) on how to use MinimaList Controller library. For this tutorial, we will cover on using this library for creating API controller. Update: This tutorial is updated for library version 1.05. How to install Download... www.b4x.com
LucaMs said: You could then create a macro/comment to open your folder containing the template classes and...! Click to expand... If you put the code snippets inside a b4xlib then it is available by start typing "code". If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab. For me this is very convenient already. Example, I have added WebController and ApiController classes in my web project template in the past. Just not many B4X developers make use of these features. [Web] Tutorial - Using MinimaList Controller and Code Snippets Introduction This tutorial is based on MinimaList API Server (version 2.05) on how to use MinimaList Controller library. For this tutorial, we will cover on using this library for creating API controller. Update: This tutorial is updated for library version 1.05. How to install Download... www.b4x.com
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #7 aeric said: If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab. For me this is very convenient already. Click to expand... I really like that one, but I don't understand how it works! If I use one of my project templates, will I have that menu item to add a class that is part of the project template to the current project? P.S. Mario, just try!
aeric said: If the custom class is distributed inside project template, it is available when adding module from menu Project or right click in module tab. For me this is very convenient already. Click to expand... I really like that one, but I don't understand how it works! If I use one of my project templates, will I have that menu item to add a class that is part of the project template to the current project? P.S. Mario, just try!
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #8 LucaMs said: P.S. Mario, just try! Click to expand... Tried: no, unfortunately it is not like that. It seemed really unlikely to me.
LucaMs said: P.S. Mario, just try! Click to expand... Tried: no, unfortunately it is not like that. It seemed really unlikely to me.
aeric Expert Licensed User Longtime User Sep 16, 2025 #9 LucaMs said: I really like that one, but I don't understand how it works! Click to expand... Unzip the b4xlib to see. You need to add the class with file extension .b4x_excluded Last edited: Sep 16, 2025
LucaMs said: I really like that one, but I don't understand how it works! Click to expand... Unzip the b4xlib to see. You need to add the class with file extension .b4x_excluded
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #10 aeric said: You need to add the class with file extension .b4x_excluded Click to expand... I'd forgotten about it, and most importantly, I think I've written several times that it would be useful to be able to create your own class templates, like for projects, but Erel never commented with something like: "It's already possible" (perhaps he didn't do it so as not to make me look bad!) Perhaps, I repeat: perhaps, at the time I thought it was only for B4A (or maybe that was the case at the time, initially). Thank you, @aeric
aeric said: You need to add the class with file extension .b4x_excluded Click to expand... I'd forgotten about it, and most importantly, I think I've written several times that it would be useful to be able to create your own class templates, like for projects, but Erel never commented with something like: "It's already possible" (perhaps he didn't do it so as not to make me look bad!) Perhaps, I repeat: perhaps, at the time I thought it was only for B4A (or maybe that was the case at the time, initially). Thank you, @aeric
aeric Expert Licensed User Longtime User Sep 16, 2025 #11 LucaMs said: I'd forgotten about it, Click to expand... Maybe you are not. Actually I think this is not a documented or an official feature. The concept was first introduced in jar library. One day I was curious and made my own experiment and it did work with b4xlib too. My bad I didn't share this idea but it is one of the "hidden" ideas in my WebAPI Controller b4xlib as a "bonus" for who "followed" and test my libraries. It just not obvious. https://www.b4x.com/android/forum/threads/custom-class-templates.90550/ https://www.b4x.com/android/forum/threads/custom-class-templates-in-b4x.90552/#post-572445
LucaMs said: I'd forgotten about it, Click to expand... Maybe you are not. Actually I think this is not a documented or an official feature. The concept was first introduced in jar library. One day I was curious and made my own experiment and it did work with b4xlib too. My bad I didn't share this idea but it is one of the "hidden" ideas in my WebAPI Controller b4xlib as a "bonus" for who "followed" and test my libraries. It just not obvious. https://www.b4x.com/android/forum/threads/custom-class-templates.90550/ https://www.b4x.com/android/forum/threads/custom-class-templates-in-b4x.90552/#post-572445
stevel05 Expert Licensed User Longtime User Sep 16, 2025 #12 LucaMs said: drag-and-drop of files (classes/modules) from a folder to the IDE-project Click to expand... Already available, drop them on the Modules tab.
LucaMs said: drag-and-drop of files (classes/modules) from a folder to the IDE-project Click to expand... Already available, drop them on the Modules tab.
LucaMs Expert Licensed User Longtime User Sep 16, 2025 #13 stevel05 said: Already available, drop them on the Modules tab. Click to expand... Yeah, I don't even know what I wrote
stevel05 said: Already available, drop them on the Modules tab. Click to expand... Yeah, I don't even know what I wrote
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #14 LucaMs said: Perhaps, I repeat: perhaps, at the time I thought it was only for B4A (or maybe that was the case at the time, initially). Click to expand... It is so, in B4A it doesn't work
LucaMs said: Perhaps, I repeat: perhaps, at the time I thought it was only for B4A (or maybe that was the case at the time, initially). Click to expand... It is so, in B4A it doesn't work
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #15 LucaMs said: It is so, in B4A it doesn't work Click to expand... I see that my test.b4xlib doesn't "work" (for what we said) even in B4J. (Added also a code module, just for test, but it was obvious that this could not be done, but in the Modules tab I do not even see clsMyClass, neither in B4A, nor in B4J).
LucaMs said: It is so, in B4A it doesn't work Click to expand... I see that my test.b4xlib doesn't "work" (for what we said) even in B4J. (Added also a code module, just for test, but it was obvious that this could not be done, but in the Modules tab I do not even see clsMyClass, neither in B4A, nor in B4J).
aeric Expert Licensed User Longtime User Sep 18, 2025 #16 LucaMs said: I see that my test.b4xlib doesn't "work" (for what we said) even in B4J. View attachment 167025 (Added also a code module, just for test, but it was obvious that this could not be done, but in the Modules tab I do not even see clsMyClass, neither in B4A, nor in B4J). View attachment 167026 Click to expand... Hmm... I just tested. B4xlib doesn't work in B4A but you can use .jar + .xml library. B4Xlib Custom Class works in B4A, B4i and B4J !!! B4XLib structure: manifest.txt file: Code: Copy Author=Aeric Poon Version=1.00 CustomClassTemplates=Aeric's B4XPage|B4XPage3,Aeric's Sample Class|SampleClass Attachments CustomClass.jar CustomClass.jar 773 bytes · Views: 239 CustomClass.xml CustomClass.xml 401 bytes · Views: 234 AericCustomClass.b4xlib AericCustomClass.b4xlib 1 KB · Views: 252 Last edited: Sep 18, 2025
LucaMs said: I see that my test.b4xlib doesn't "work" (for what we said) even in B4J. View attachment 167025 (Added also a code module, just for test, but it was obvious that this could not be done, but in the Modules tab I do not even see clsMyClass, neither in B4A, nor in B4J). View attachment 167026 Click to expand... Hmm... I just tested. B4xlib doesn't work in B4A but you can use .jar + .xml library. B4Xlib Custom Class works in B4A, B4i and B4J !!! B4XLib structure: manifest.txt file: Code: Copy Author=Aeric Poon Version=1.00 CustomClassTemplates=Aeric's B4XPage|B4XPage3,Aeric's Sample Class|SampleClass
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #17 aeric said: Hmm... I just tested. B4xlib doesn't work in B4A but you can use .jar + .xml library. B4Xlib Custom Class works in B4A, B4j and B4i !!! View attachment 167028 B4XLib structure: View attachment 167034 manifest.txt file: Code: Copy Author=Aeric Poon Version=1.00 CustomClassTemplates=Aeric's B4XPage|B4XPage3,Aeric's Sample Class|SampleClass Supported Platforms=B4A,B4J,B4i Click to expand... So the trick is that: CustomClassTemplates in the manifest file, I suppose. Never read before!
aeric said: Hmm... I just tested. B4xlib doesn't work in B4A but you can use .jar + .xml library. B4Xlib Custom Class works in B4A, B4j and B4i !!! View attachment 167028 B4XLib structure: View attachment 167034 manifest.txt file: Code: Copy Author=Aeric Poon Version=1.00 CustomClassTemplates=Aeric's B4XPage|B4XPage3,Aeric's Sample Class|SampleClass Supported Platforms=B4A,B4J,B4i Click to expand... So the trick is that: CustomClassTemplates in the manifest file, I suppose. Never read before!
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #18 LucaMs said: So the trick is that: CustomClassTemplates in the manifest file, I suppose. Never read before! Click to expand... No
LucaMs said: So the trick is that: CustomClassTemplates in the manifest file, I suppose. Never read before! Click to expand... No
aeric Expert Licensed User Longtime User Sep 18, 2025 #19 LucaMs said: Never read before! Click to expand... Yes. You can unzip B4XPages.b4xlib to see how it works!
LucaMs said: Never read before! Click to expand... Yes. You can unzip B4XPages.b4xlib to see how it works!
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #20 aeric said: Yes. You can unzip B4XPages.b4xlib to see how it works! Click to expand... But why did you post a .jar file? (I have to wait (hope) that my damned headache goes away and then read better)
aeric said: Yes. You can unzip B4XPages.b4xlib to see how it works! Click to expand... But why did you post a .jar file? (I have to wait (hope) that my damned headache goes away and then read better)