Android Question Error on calling a sub from a b4Xpage to another B4Xpage

DALB

Active Member
Licensed User
Hello,

You can try the zip file below.
I need to call a sub of a B4Xpage (p1) from an other B4Xpage (p2).

When the pointer arrives to the page p1, it has to fill labels and edittexts.
These ones are declared as B4Xview.
But at the first label, the process stops telling that the label is not initialized.

I'm sure not having done a complete understanding about this call from page to page.

So, is there any good person who can light my spirit to solve it ?
I have read the videos and some answers on the forum, but something is wrong, but where ?

Thank you for helping me for this error.
 

josejad

Expert
Licensed User
Longtime User
Upvote 0

DALB

Active Member
Licensed User
Ah yes, 'xcuse me...here it is.
 
Upvote 0

DALB

Active Member
Licensed User
!!! it doesn't work !
Ah, file to big...that's ok now !
 

Attachments

  • consoAutos19Prob1.zip
    58.9 KB · Views: 57
Upvote 0

DALB

Active Member
Licensed User
Thanks you Klaus...
But at which place ? If I put it in B4xMainPage it doesn't work. I have seen that it was the place to declare all the B4Xpages.
I've also tried in B4xdonnees, It doesn't work too !
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I changed it in the B4XMainPage module here, and it works.
B4X:
public Sub initialiserLesViews
    pagemenu.Initialize
    B4XPages.AddPage("b4xmenu",pagemenu)
    pagesaisie.Initialize
'    B4XPages.AddPage("b4xsaisie",pagesaisie)
    B4XPages.AddPageAndCreate("b4xsaisie",pagesaisie)
    pagedonnees.Initialize
    B4XPages.AddPage("b4xdonnees",pagedonnees)
End Sub
 
Upvote 0

DALB

Active Member
Licensed User
Glups! with your advice, it doesn't work!
Error occurred on line: 760 (b4xsaisie)
java.lang.RuntimeException: Object should first be initialized (B4XView).
I've understood that the initialization is not necessary.
Opening the B4xsaisie page, normally all the views are declared in Class_Globals.
This means that the initialization is done because the views are B4Xviews.
What happens in this case ?
 
Upvote 0

DALB

Active Member
Licensed User
yes, that's right !
I'll read all the sub to understand where the problem is !
 
Upvote 0
Top