Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Arjen  
#1 Posted : Friday, April 9, 2021 2:30:53 PM(UTC)
Arjen

Rank: Newbie

Groups: Registered
Joined: 4/9/2021(UTC)
Posts: 8
Netherlands
Location: Rotterdam

Thanks: 2 times
Hi,
I started recently building an order app with MT, but I can't get the image view correctly.

In my test SQLite DB I have 7 images stored, all 150x150 px and I would like to plot these in my app 2 images on a row and dynamically have multiple rows, depending on the number of products/images. Eventually I'd like to have 2 x 8 pictures visible on the screen and the rest accessible via a slider.
I tried to create a 1 x 1 table with repeating rows but then all pictures are positioned vertically. Using repeating columns results in attached view. Using both repeating rows and columns gives the same result as only repeating rows. Looking at the documentation using both repeating rows and columns works more like a pivottable?

Maybe I missed a function or setting, but any help would be appreciated

Edit: Added DB
File Attachment(s):
Kassa.db (676kb) downloaded 20 time(s).
Arjen attached the following image(s):
Images alignment.PNG
bbv  
#2 Posted : Friday, April 9, 2021 2:36:41 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
Your guess was correct - using repeating row/column combination is what you should do. If you attach here your SQLite database, I will return back with the ready-to-use design file
Arjen  
#3 Posted : Friday, April 9, 2021 2:42:04 PM(UTC)
Arjen

Rank: Newbie

Groups: Registered
Joined: 4/9/2021(UTC)
Posts: 8
Netherlands
Location: Rotterdam

Thanks: 2 times
DB added in original post
bbv  
#4 Posted : Friday, April 9, 2021 2:51:35 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
Here is the design file. I defined a global variable $ColNr to make it more flexible for you to decide how many columns to show
File Attachment(s):
Kassa.mtd (7kb) downloaded 20 time(s).
Arjen  
#5 Posted : Friday, April 9, 2021 3:24:27 PM(UTC)
Arjen

Rank: Newbie

Groups: Registered
Joined: 4/9/2021(UTC)
Posts: 8
Netherlands
Location: Rotterdam

Thanks: 2 times
Originally Posted by: bbv Go to Quoted Post
Here is the design file. I defined a global variable $ColNr to make it more flexible for you to decide how many columns to show


Thanks, looks great! I altered one of the statements a bit as it showed only a even number of images. Without the "-1" it shows all images, even when there are odd number of images in the DB

0 to ( count( $DB1/DB/RowSet/Row ) idiv $ColNr ) --> removed "-1"

Thanks again!

Arjen  
#6 Posted : Friday, April 9, 2021 4:27:51 PM(UTC)
Arjen

Rank: Newbie

Groups: Registered
Joined: 4/9/2021(UTC)
Posts: 8
Netherlands
Location: Rotterdam

Thanks: 2 times
One more question. Does this solution has any effect on assigning the record_ID of an image to a global element?
I created a update node that should hold the image_ID of the image I click on, but instead of getting 1 ID in return I get all values (1 - 11). I checked the book tutorial and followed all steps but it behaves differently.
File Attachment(s):
Overview_2.PNG (576kb) downloaded 19 time(s).
Arjen attached the following image(s):
Overview_1.PNG
bbv  
#7 Posted : Friday, April 9, 2021 5:26:09 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
No - the issue is because of an error in your statement - your XPath selects all ids. You need to select the current node instead. I've attached here a modified solution which will put an id on image click. I've created a function TableNode to avoid rewriting the same code, and I'm using it to select the proper node for image and for product id
File Attachment(s):
Kassa.mtd (7kb) downloaded 21 time(s).
Arjen  
#8 Posted : Friday, April 9, 2021 6:58:25 PM(UTC)
Arjen

Rank: Newbie

Groups: Registered
Joined: 4/9/2021(UTC)
Posts: 8
Netherlands
Location: Rotterdam

Thanks: 2 times
Originally Posted by: bbv Go to Quoted Post
No - the issue is because of an error in your statement - your XPath selects all ids. You need to select the current node instead. I've attached here a modified solution which will put an id on image click. I've created a function TableNode to avoid rewriting the same code, and I'm using it to select the proper node for image and for product id


Works great again, thanks for your help!
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.