240
Views
6
Comments
Solved
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.


List record Question.PNG
2018-07-03 08-33-54
Tiago Gafeira
Champion
Solution

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


Questions.oml
2017-09-07 08-16-06
Thabiso

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.

2018-07-03 08-33-54
Tiago Gafeira
Champion

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.

2017-09-07 08-16-06
Thabiso

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?


2018-07-03 08-33-54
Tiago Gafeira
Champion

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.

2017-09-07 08-16-06
Thabiso

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.


2018-07-03 08-33-54
Tiago Gafeira
Champion
Solution

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


Questions.oml
2017-09-07 08-16-06
Thabiso

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.