Page 1 of 1
Process show images IFS folder
Posted: Tue Nov 29, 2016 1:48 pm
by JPG
I have a screen that shows a image retrieved from the IFS.
What I intend to achieve is the following:
1.- Access a folder, scroll and display on the previous screen each of the possible images that are with previous or next button. That is, directly display the first one already on the screen without previous selection and go showing the successive ones if any.
How can I do it in an easy way ?.
Thanks
Re: Process show images IFS folder
Posted: Tue Nov 29, 2016 4:32 pm
by Glenn
I'm not sure I understand...
Do you want a screen that shows an image from an IFS folder and allows you to show the next or previous image using buttons? Would it look something like below?
- browse.png (47.45 KiB) Viewed 513 times
Re: Process show images IFS folder
Posted: Tue Nov 29, 2016 6:12 pm
by Scott Klement
I would create a screen like the one Glenn shows. I would have the RPG program read the IFS directory and put all of the filenames into a big string, (maybe in JSON format? Or just comma-separated, or whatever...) the string would be in a hidden variable on the display. Javascript code in the screen would change the image source property of the image widget to the next/previous image in the list when you click the buttons.
Should be very easy. Biggest problem would be the limit to the size of the string. You could overcome that by using AJAX to get the list rather than a hidden field, but of course that adds complexity. Maybe start with what's easy (hidden field) and switch to the more complex option (AJAX) if it's a problem.
Just my opinion
Re: Process show images IFS folder
Posted: Wed Nov 30, 2016 5:55 am
by JPG
Yes. The screen is just as Glenn says.
And the idea of Scott seems viable. I go to it.
Thank you.
Re: Process show images IFS folder
Posted: Wed Nov 30, 2016 1:35 pm
by SeanTyree
Another option would be a hidden subfile grid. You could then have each subfile record contain an image filename and iterate through the rows of the subfile.
Re: Process show images IFS folder
Posted: Fri Dec 02, 2016 3:38 am
by JPG
Tks