iOS Question [SOLVED ?] - Copy and paste designer elements between B4A and B4I platforms

Sergio Haurat

Active Member
Licensed User
Longtime User
No matter which option I enter in the application, whenever it wants to load a new B4XPage in B4I, the execution breaks


*** frmxedituser: B4XPage_Created [mainpage]
Error occurred on line: 467 (AS_TextFieldAdvanced)
Target is null. Method called: _initialize:::

*** frmxfilter: B4XPage_Created [mainpage]
Error occurred on line: 53 (B4XComboBox)
Target is null. Method called: _initialize:::

Complete log error:
Copying updated assets files (1)
Application_Start
Device locale: es
Found 161 strings.
*** : B4XPage_Foreground
*** mainpage: B4XPage_Created
Found 161 strings.
Found 161 strings.
Application_Active
*** mainpage: B4XPage_Appear [mainpage]
*** mainpage: B4XPage_Resize [mainpage]
Class (b4i_httpjob) instance released.
Class (b4i_httpjob) instance released.
*** frmxfilter: B4XPage_Created [mainpage]
Error occurred on line: 53 (B4XComboBox)
Target is null. Method called: _initialize:::

Stack Trace: (
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 540460
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 1582812
PasSportsAr HB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 160
PasSportsAr HB -[B4ICustomViewWrapper AfterDesignerScript] + 1468
PasSportsAr HB -[B4ILayoutBuilder loadLayout:::] + 1992
PasSportsAr HB -[B4IPanelWrapper LoadLayout::] + 176
PasSportsAr HB -[B4XViewWrapper LoadLayout::] + 80
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr HB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr HB -[B4IShell runMethod:] + 420
PasSportsAr HB -[B4IShell raiseEventImpl:method:args::] + 1968
PasSportsAr HB -[B4IShellBI raiseEvent:event:params:] + 1360
PasSportsAr HB -[b4i_frmfilterpage _b4xpage_created::] + 360
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr HB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr HB -[B4ICommon CallSubDebug4::::] + 832
PasSportsAr HB -[B4ICommon CallSubDebug2::::] + 272
PasSportsAr HB -[b4i_b4xpagesmanager _createpageifneeded::] + 888
PasSportsAr HB -[b4i_b4xpagesmanager _showpage::] + 636
PasSportsAr HB -[b4i_b4xpages _showpage:] + 388
PasSportsAr HB -[ResumableSub_b4xmainpage_btnTabMenu_TabClick resume::] + 1672
PasSportsAr HB -[b4i_b4xmainpage _btntabmenu_tabclick::] + 404
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr HB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr HB -[B4IShell runMethod:] + 420
PasSportsAr HB -[B4IShell raiseEventImpl:method:args::] + 1968
PasSportsAr HB -[B4IShellBI raiseEvent:event:params:] + 1360
PasSportsAr HB -[B4ICommon CallSub4::::] + 240
PasSportsAr HB -[B4ICommon CallSub2::::] + 272
PasSportsAr HB -[b4i_as_tabmenuadvanced _tabclickevent::] + 824
PasSportsAr HB -[b4i_as_tabmenuadvanced _tabclick:::] + 3960
PasSportsAr HB -[b4i_as_tabmenuadvanced _xpnl_tab_click:] + 436
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr HB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr HB -[B4IShell runMethod:] + 420
PasSportsAr HB -[B4IShell raiseEventImpl:method:args::] + 1968
PasSportsAr HB -[B4IShellBI raiseEvent:event:params:] + 1360
PasSportsAr HB __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 8508
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 15828
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 75172
libdispatch.dylib _dispatch_main_queue_callback_4CF + 44
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 354064
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 342292
CoreFoundation CFRunLoopRunSpecific + 608
GraphicsServices GSEventRunModal + 164
UIKitCore 1741FA37-4E53-371E-8DAE-D611AAB0043D + 4237580
UIKitCore UIApplicationMain + 340
PasSportsAr HB main + 100
dyld 71846EAC-EE65-3697-BF7D-790B6A07DCDB + 249420
)
 
Solution
I finally got it working. This is my analysis, it is speculative and should be corroborated by trying to simulate what I write below in some other project.

If you start your development in B4A and need to make your version in B4I (or B4J), you can copy and paste all the components (text box, panel, image and other compatible elements) of a B4XPage, and thus not perform this design task twice.

You can click in the abstract designer area and press the key combination on the keyboard Control + A to "select all" and Control + C to "copy" to the clipboard.

You must go to the designer in B4I and in its B4XPage version press Control + V to “paste” the contents of the clipboard. As you can see in image 1, it selects all...

Sergio Haurat

Active Member
Licensed User
Longtime User
You can easily check this by clicking on a custom view and if the type does not contain the name of the view, but "Panel", then you know that something was wrong when you inserted it.
@Alexander Stolte, thanks for your answers and especially for your valuable time. I am currently trying to directly delete the .bil file from the disk and start over with one of the B4XPage pages since I cannot find, neither in the code nor in the designer, any difference beyond those of each operating system.
 
Last edited:
Upvote 0

Sergio Haurat

Active Member
Licensed User
Longtime User
Have you already tried B4XPages.AddPageAndCreate ?
Yes, I've tried that too. I'm already finishing rebuilding one of the B4XPages from scratch. Surely I didn't do something right and when I get stuck, I start again step by step, if I have already spent a lot of time trying to solve something that I can't.
 
Upvote 0

Sergio Haurat

Active Member
Licensed User
Longtime User
I finally got it working. This is my analysis, it is speculative and should be corroborated by trying to simulate what I write below in some other project.

If you start your development in B4A and need to make your version in B4I (or B4J), you can copy and paste all the components (text box, panel, image and other compatible elements) of a B4XPage, and thus not perform this design task twice.

You can click in the abstract designer area and press the key combination on the keyboard Control + A to "select all" and Control + C to "copy" to the clipboard.

You must go to the designer in B4I and in its B4XPage version press Control + V to “paste” the contents of the clipboard. As you can see in image 1, it selects all components, but not those that are inherited within a panel. Pasting into B4I shows all components, including unselected ones inherited in the panels. Visually you can also see them in B4I ?

I repeat, and only because my opinion is free and can be 100% invalid, I say that something is not copied to clipboard

To make it work in my case, as you can see in image 2, I had to go to the View Tree panel and press Control+A twice to select all the rows except the first one, Activity. Next, I deleted all the content of the page in B4I and then pasted using Control+V on the keyboard, the contents of the clipboard.

1720461765106.jpeg



Image 1: Control+A (select all) from Abstract Designer
1720462209502.png


Image 2: Double Control+A from Views Tree
1720462275154.png
 
Upvote 0
Solution
Top