Button to display next image in database

Hello, I am trying to create a button to bring the next picture associated with a external Id  that a user upload to the database. Right now my app can display just one, but how can I make it call the next one? I added and attribute to the data base so the user can select the order of the pictures, but I don't know how to implemented. I am building a traditional web app. The pictures are stored in the FotosMaterial ->Fotos. The order in MaterialEstudio ->Orden. The Id in commond would be the Training id.

Yomarie Hichez wrote:

Hello, I am trying to create a button to bring the next picture associated with a external Id  that a user upload to the database. Right now my app can display just one, but how can I make it call the next one? I added and attribute to the data base so the user can select the order of the pictures, but I don't know how to implemented. I am building a traditional web app. The pictures are stored in the FotosMaterial ->Fotos. The order in MaterialEstudio ->Orden. The Id in commond would be the Training id.


Hi,


Get all the records based on external id on preparation and then call button click, on button click you can implement multiple solutions using the counter, row number, etc.



Hi Yomarie,


To complement what JitendraYadav wrote:

You can have an aggregate where you fetch the image based in a n input (like (MaterialStudio.Order = Order) being order a local variable that store the current position that you want to see. Than, In your onClick, you can increment or decrement the Order value, refresh data and than ajax refresh your image. Than, your image widget will be filled with the image from that aggregate.

Don't forget to predict the behavior for orders that don't exist.


Hope this can help. 


Best regards,

Ricardo M Pereira