L Levit Member Licensed User Longtime User Oct 20, 2020 #1 Hi Everyone! I have an app with several pages (using TabstripViewpager) and it uses my custom class that is a special keyboard, accessed in every page. Starting now with B4xPages I want to include several more pages in that app. I declared "Public kbd as MySpecialKbdClass" in main activity and loaded it in main layout but I can not open the keyboard from each B4xpage. I have searched about it in B4XPages but the only way I can access "kbd" in each B4XPage is declaring "Private kbd as MySpecialKbdClass" in every B4XPage and loading it in every layout of each B4xPage. I am repeating myself. Is this the right way to do it? ... Or am I missing something? Thanks!
Hi Everyone! I have an app with several pages (using TabstripViewpager) and it uses my custom class that is a special keyboard, accessed in every page. Starting now with B4xPages I want to include several more pages in that app. I declared "Public kbd as MySpecialKbdClass" in main activity and loaded it in main layout but I can not open the keyboard from each B4xpage. I have searched about it in B4XPages but the only way I can access "kbd" in each B4XPage is declaring "Private kbd as MySpecialKbdClass" in every B4XPage and loading it in every layout of each B4xPage. I am repeating myself. Is this the right way to do it? ... Or am I missing something? Thanks!
Erel B4X founder Staff member Licensed User Longtime User Oct 20, 2020 #2 Levit said: I declared "Public kbd as MySpecialKbdClass" in main activity and loaded it in main layout Click to expand... Not good. Put it in B4XMainPage. Code: B4XPages.MainPage.kbd.DoSomething Upvote 0
Levit said: I declared "Public kbd as MySpecialKbdClass" in main activity and loaded it in main layout Click to expand... Not good. Put it in B4XMainPage. Code: B4XPages.MainPage.kbd.DoSomething
L Levit Member Licensed User Longtime User Oct 20, 2020 #3 Thank you Erel! I also tried declaring it in B4XMainPage but I guess I was calling it in wrong way. let me try " B4XPages.MainPage.kbd.DoSomething " Last edited: Oct 20, 2020 Upvote 0
Thank you Erel! I also tried declaring it in B4XMainPage but I guess I was calling it in wrong way. let me try " B4XPages.MainPage.kbd.DoSomething "
L Levit Member Licensed User Longtime User Oct 20, 2020 #4 Yes, I was calling it in wrong way. " B4XPages.MainPage.kbd.DoSomething " works. But my problem still persists. Say I am at "page 9" and I call " B4XPages.MainPage.kbd.DoSomething ". The keyboard will appear in "B4XMainPage", But I need it in "page 9". So, what is the best to do? Should I declare it in each page or there is another way? thanks. Upvote 0
Yes, I was calling it in wrong way. " B4XPages.MainPage.kbd.DoSomething " works. But my problem still persists. Say I am at "page 9" and I call " B4XPages.MainPage.kbd.DoSomething ". The keyboard will appear in "B4XMainPage", But I need it in "page 9". So, what is the best to do? Should I declare it in each page or there is another way? thanks.
Erel B4X founder Staff member Licensed User Longtime User Oct 21, 2020 #5 Code: B4XPages.MainPage.kbd.DoSomething (Root) In DoSomething, remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. Other options are also good. Upvote 0
Code: B4XPages.MainPage.kbd.DoSomething (Root) In DoSomething, remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. Other options are also good.
L Levit Member Licensed User Longtime User Oct 21, 2020 #6 Erel said: Code: B4XPages.MainPage.kbd.DoSomething (Root) In DoSomething, remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. Other options are also good. Click to expand... If I understand it right I can call form any page, for example : Code: B4XPages.MainPage.kbd.ShowKbd (Root) And the keyboard will appear in the page I called it from. To achieve this I need to : " remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. " <------ But Where should I do this? In DoSomething ???? or Showkbd???? Sorry, but I don`t understand where and which top panel are we talking about. Add to Root ..... In Main or B4XMainPage? thank you Upvote 0
Erel said: Code: B4XPages.MainPage.kbd.DoSomething (Root) In DoSomething, remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. Other options are also good. Click to expand... If I understand it right I can call form any page, for example : Code: B4XPages.MainPage.kbd.ShowKbd (Root) And the keyboard will appear in the page I called it from. To achieve this I need to : " remove the top panel from its parent (B4XView.RemoveViewFromParent) and add it to Root. " <------ But Where should I do this? In DoSomething ???? or Showkbd???? Sorry, but I don`t understand where and which top panel are we talking about. Add to Root ..... In Main or B4XMainPage? thank you
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2020 #7 Levit said: But Where should I do this? Click to expand... In "DoSomething". I cannot answer all these questions as I'm not familiar with your code. The important thing to remember is that B4XPages classes are regular classes. You can put the code wherever you like. It doesn't matter. Upvote 0
Levit said: But Where should I do this? Click to expand... In "DoSomething". I cannot answer all these questions as I'm not familiar with your code. The important thing to remember is that B4XPages classes are regular classes. You can put the code wherever you like. It doesn't matter.
L Levit Member Licensed User Longtime User Oct 22, 2020 #8 That's OK. Knowing that "DoSomething" is actually the right direction I can, eventually, work it out. Erel said: The important thing to remember is that B4XPages classes are regular classes. You can put the code wherever you like. It doesn't matter. Click to expand... That's an important tip. By the way..... B4Xpages should be called "B4XAwesomePages". Thank you Erel. Upvote 0
That's OK. Knowing that "DoSomething" is actually the right direction I can, eventually, work it out. Erel said: The important thing to remember is that B4XPages classes are regular classes. You can put the code wherever you like. It doesn't matter. Click to expand... That's an important tip. By the way..... B4Xpages should be called "B4XAwesomePages". Thank you Erel.