B4J Question [BANano] [SOLVED] My AutoID are not unique, please help

Mashiane

Expert
Licensed User
Longtime User
Hi

I am loading the same layout with auto-id turned on for all components in the layout.

B4X:
BANano.LoadLayout(swiper1.Slide(1).Here, "swiperslide1")
    BANano.LoadLayout(swiper1.Slide(2).Here, "swiperslide1")
    BANano.LoadLayout(swiper1.Slide(3).Here, "swiperslide1")

I have noted from the generated HTML on the browser development, the assigned ids are the same for "qjzasbce"



My layout...




What can I be missing?
 
Solution
The layouts which you load multiple times should be loaded with LoadLayoutArray.

B4X:
banano.LoadLayout("#body", "baselayout")
banano.LoadLayoutArray(SHIonBaseElement1.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement2.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement3.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement4.Here, "childlayout", False)



Alwaysbusy

alwaysbusy

Expert
Licensed User
Longtime User
The layouts which you load multiple times should be loaded with LoadLayoutArray.

B4X:
banano.LoadLayout("#body", "baselayout")
banano.LoadLayoutArray(SHIonBaseElement1.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement2.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement3.Here, "childlayout", False)
banano.LoadLayoutArray(SHIonBaseElement4.Here, "childlayout", False)



Alwaysbusy
 
Upvote 1
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…