Get element from ListRecord

Get element from ListRecord

  

Hi,

I have a List Record that has X number of elements (they vary depending on what I´m showing). Each element of those has a slider (default RangeSlider), that defines a rating number that I want to associate with the element of the List Record.

What I´m currently doing is a Server Action that happens OnChange when the user moves the slider. Problem is, that it always modifies the last element of the List Record, and I can´t seem to find a way to modify the element associate with the slider that was changed.

Any parameter that I´m not familiar with that gets the List Record element?

Thanks in advance.

Hi Rui,

You are using ListRecord.Current and you always get the last element?

Regards,

Marcelo

Exactly Marcelo.

The problem is I have no way of knowing which element of the List Record is associated with the Slider the user moved, and for some reason, he´s always using the last Element on the server action (CreateRating function)

Hi Rui,

You can always have an input on the onChange action with the element you are updating. But this is a workaround. Do you have a .oml where i can reproduce this error to check it better?

Regards,

Marcelo

Yes I´ve passed an argument on the OnChange but I´m not managing to send the element in any way. 

Hi,

Where do we have to look? :)
There are a lot of screens where i can't understand the language :p No clue where to look.


Greetings,
Niels F.

Yeah sorry about that. The application is getting quite large already.

Answer1 is where you want to look. First screen there is

Solution

Hi Rui,

The Input is inside a List Records, which means that inside any Screen Actions triggered by an element like the OnChange, the ListRecords.Current (in your case questionListRecord.Current) is the current record, i.e. the one causing the OnChange.

In the On Change parameters, you are using the GetInquiryQuestionsByInquiryId. This is not good practice, use the questionListRecord (i.e. the name of the List Records) instead. However, this is not needed, as like I said above, inside the Screen Action you can already use the questionListRecord.Current.

Solution

I would love to test your suggestions, but somehow my App stopped working. Something related to the DBs probably. Worst thing to debug ever.