Other Adding b4x classes

ilan

Expert
Licensed User
Longtime User
hi

i started lately working more and more with b4xpages and xui and I get into a problem.
i am not sure if I am doing it as the creator intended but my file structure looks like this:

1651241223466.png


as you can tell I am putting all classes or code modules on an upper level than the b4x project folder and I link them with a relative path.
but my question is if i am now working on b4j and i am adding a new class it is added inside the b4j folder after testing it and finishing it i close b4j -> cut the class file -> put it on the upper level, and then link again with a relative path after opening the b4j app. like this if i will make changes i don't need to update each file on each folder.

so why is there no option to allow me to create the class in a specific folder and then decide how to link it, or is it already possible?

thanx, ilan
 

klaus

Expert
Licensed User
Longtime User
When you add a new CustomView you get this message:

1651248217682.png


Here, you can add it to the parent folder, you need to check it.
This is what LucaMs suggested.
Anyway in the other IDEs you need to load it with the relative link.
I understand your question, when you add the class the first time, if you add it to the parent folder it is not a relative link.
This is not a problem in most cases.
I have not tested how this behaves when you change the project name which is the parent folder.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I tested this, in an existing B4XPages project:
- I added a new CustomView module to the parent folder.
- Saved the project.
- Closed the IDE.
- Renamed the project folder.
- Reopened the project and the new CustomView is present.
Therefore, when adding a new Class in the parent folder it is added with a relative link.
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I tested this, in an existing B4XPages project:
- I added a new CustomView module to the parent folder.
- Saved the project.
- Closed theIDE.
- Renamed the project folder.
- Reopened the project and the new CustomView is present.
Therefore, when adding a new Class in the parent folder it is added with a relative link.
It's "simple": when you create a new module, if you DON'T check "Add to parent folder", the module will be created in the specific platform folder and it will not be shared. If you check that box, the module will be created in the parent folder and in the IDE currently open you will see that the module is "linked", you will see the "symbol" (..).

If you change the name of the project folder you will have no problem, but the names of the project file and the .meta file will not change. Same thing if you change the name of the parent folder: everything else will not change.

(All obvious? Better than nothing ? )
 
Upvote 0
Top