B4J Question [BANano] [SOLVED] Handling parent & child layouts

Mashiane

Expert
Licensed User
Longtime User
Ola

I have a master layout and also created a single child layout based on custom views. I want to load the child layout to a specific element id of the master layout.

This is my code.

B4X:
'load the layout we will use
    BANano.LoadLayout("#body", "mashlayout")
    'load the button inside the template1 id
    BANano.LoadLayout("#template1", "viewbutton")

This is what is generated..

HTML:
<div id="app">
    <v-app id="inspire">
        <v-app-bar id="navbar" app="true" color="indigo" dark="true" tile="true" value="true">
            <v-app-bar-nav-icon id="navmenu" v-on:click.stop="navmenu_clickstop"></v-app-bar-nav-icon>
            <v-toolbar-title id="navbartitle">Application</v-toolbar-title>
        </v-app-bar>
        <v-navigation-drawer id="navdrawer" v-model="drawer" app="true"></v-navigation-drawer>
        <v-content id="mashcontent">
            <v-container id="mashcontainer" fluid="true" class="fill-height">
                <v-row id="r1" align="center" justify="center">
                    <v-col id="r1c1" class="text-center">
                        <v-tooltip id="tooltip1" fixed="true" left="true" open-on-hover="true"><template id="template1"
                                v-slot:activator="{ on }"></template><span id="span2">Source</span></v-tooltip>
                    </v-col>
                </v-row>
            </v-container>
        </v-content>
        <v-footer id="navfooter" app="true" color="indigo" tile="true"><span id="span1" class="white--text">©
                2019</span></v-footer>
    </v-app>
</div>

What can I be missing here? Thanks.
 

Mashiane

Expert
Licensed User
Longtime User
Update: I took this part of the template out and specified another id for the second load layout ....

HTML:
<v-tooltip id="tooltip1" fixed="true" left="true" open-on-hover="true"><template id="template1"

                                v-slot:activator="{ on }"></template><span id="span2">Source</span></v-tooltip>

It loaded fine without this part. Me thinks perhaps the issue is the "{ on }" value of the attribute. Could be wrong through.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
It would be good to give me a (small) sample project so I can find out what went wrong.

Some questions to ask oneself:
1. did it show any errors in the browsers log?
2. did it find the #template id after loading the first layout?
B4X:
    dim tmpObj as BANanoElement
    tmpObj.initialize("#template1")
    log(tmpObj)
3. What generated html did you expect (what is in de layouts)?
4. Did you have only one tag with 'template1' as id? (I say this because I had it recently that two layouts used the same name for a component and it gave me trouble as they need to be unique in html)

Alwaysbusy
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Thanks...

1. did it show any errors in the browsers log?

Nope

2. did it find the #template id after loading the first layout?
I will check as I didnt investigate before.

3. What generated html did you expect (what is in de layouts)?
I will redo as I removed the part and did other things.

4. Did you have only one tag with 'template1' as id?
Yes.

Let me rerun and see, will create a small example if all else fails. Ta!
 
Upvote 0
Top