iterate a List Records with Next and Previous buttons

iterate a List Records with Next and Previous buttons

  

Hi everyone!

I have a Questions Entity with a list of questions (let's say 27 questions)

I have a List Record bound to the Questions Aggregate.

I want to move to the previous or next question when I press Previous or Next button. 


Example of what I want to achieve is like our video courses... you see we have a Previous Lesson & Next Lesson buttons which move to the next or previous video/lesson.

What's the best way to implement this in my case?

Thanks.


Hi Sthamza,

To implement something like the lessons in Courses, you should iterate using the database directly and not a list kept in memory.

Build a screen with an input parameter that receives the QuestionId and in the Preparation retrieve that record from the DB, along with the info if there are Previous and Next questions. Depending on it, just show or hide the navidation buttons.


Cheers,

Tiago.

Tiago Gafeira wrote:

Hi Sthamza,

To implement something like the lessons in Courses, you should iterate using the database directly and not a list kept in memory.

Build a screen with an input parameter that receives the QuestionId and in the Preparation retrieve that record from the DB, along with the info if there are Previous and Next questions. Depending on it, just show or hide the navidation buttons.


Cheers,

Tiago.

So which widget should I use to display the question instead of the List Record?


Hello again, 

In a scenario where you display one questions at a time, you can use a ShowRecord or a Form.

Are the questions going to be answered in the application?


Cheers,

Tiago.

Tiago Gafeira wrote:

Hello again, 

In a scenario where you display one questions at a time, you can use a ShowRecord or a Form.

Are the questions going to be answered in the application?


Cheers,

Tiago.

Yes Tiago, the questions are going to be answered in the application. I'd really appreciate your suggestions on what I should/can use to hold/store the answers.


Solution

Please check the attached module for ideas. Does not include answers.


Solution

Tiago Gafeira wrote:

Please check the attached module for ideas. Does not include answers.


This OML is going into my archives.

Thanks a lot Tiago, really appreciate your efforts.