Dialog() , images and ui().pages()

185 views
Skip to first unread message

Wojciech Sikora @gmail

unread,
Apr 23, 2024, 5:48:43 AM4/23/24
to mementodatabase
Would anyone know why I can't display photos in dialog() using ui().pages(children: Object[])

This script works for widgets, but not for dialog().

let images = []
let entries = lib().entries()
for (var i in entries) {
images.push(ui().image(entries[i].field('Photo')[0]).height(200))
}

dialog()
.view(
ui().layout([
ui().pages(images)
])
)
.show()


All I see is something like in the screenshot.
  

Screenshot_2024-04-23-11-29-37-605_com.luckydroid.droidbase.png

Mmm

unread,
Apr 23, 2024, 7:05:06 AM4/23/24
to mementodatabase
Здесь Вам не помогут. Мы - пользователи программы, не её разработчики. 
В dialog() не отображается и одна картинка (объект ui().image() ). 

Задайте свой вопрос в поддержку Memento. 
Кроме того, поинтересуйтесь как получить индекс отображаемой страницы объекта ui().page() при использовании её в dialog(). 

С интересом почитаем ответ разработчика, если Вы опубликует его здесь. 

вторник, 23 апреля 2024 г. в 12:48:43 UTC+3, Wojciech S.:

Mmm

unread,
Oct 2, 2025, 4:50:43 AM (2 days ago) Oct 2
to mementodatabase
В версии MDB 5.7.0 это исправлено. 
Картинки отображаются в окнах dialog(), как отдельный элемент, так и в виде страниц.

вторник, 23 апреля 2024 г. в 14:05:06 UTC+3, Mmm:

Wojciech Sikora @gmail

unread,
Oct 2, 2025, 2:45:29 PM (2 days ago) Oct 2
to Mmm, mementodatabase
Thanks for info

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mementodatabase/de137d83-55dd-4bb4-ab86-835defa14d45n%40googlegroups.com.

Wojciech Sikora @gmail

unread,
Oct 3, 2025, 6:45:58 AM (24 hours ago) Oct 3
to Mmm, mementodatabase
And how to show in dialog() all images but from one entry only not from hole library?

Mmm

unread,
Oct 3, 2025, 8:42:27 AM (22 hours ago) Oct 3
to mementodatabase
Шаблон с примером:

пятница, 3 октября 2025 г. в 13:45:58 UTC+3, Wojciech S.:
ui_pages.jpg
ui_image.png

Wojciech Sikora @gmail

unread,
12:40 AM (6 hours ago) 12:40 AM
to Mmm, mementodatabase
Many thanks for that. 

Could you write how add to these photos also captions from the entry?

Mmm

unread,
4:33 AM (2 hours ago) 4:33 AM
to mementodatabase
Как показать объект ui().image() вместе с описанием я не знаю.
Но можно создать объект ui().layout() и поместить в него два объекта: ui().image() и ui().text().

let e = entry();

let photos = e.field('image');
let img = e.images('image');

let items = [];

for (let i in photos) {
    items.push( 
        ui().layout([
            ui().image(photos[i]).width_match_parent(),
            ui().text('\n' + img[i].caption)
        ])
    );
}

dialog()
    .view(ui().pages(items)) 
    .positiveButton('Ok')
    .show();

Как выровнять текст в объекте ui().text() по центру - я тоже не знаю.

суббота, 4 октября 2025 г. в 07:40:27 UTC+3, Wojciech S.:
Scr_1.png
Reply all
Reply to author
Forward
0 new messages