Filter list from other list Custom link

Status
Not open for further replies.

jo-ka

Member
Hello,

I know I can Pre-Filter a list directly on it's settings. Usually I use the Pre-Filters to get the record from the logged in user only, like WHERE {user___id} = {$my->id}. This is ok, I know how to use it.

Now I need to filter the results based on user, but also from the selection made on another list.

For example, I have a list with online tests results, pre-filtered with {$my->id}, where are stored all the results from online tests. Each of these records are from multiple users for multiple tests.

So I have another list, where the user is going before, where I display the Test name, and the global results.

From here, I want to link the Test Name field to the results table, filtering the user ID, which is ok, but also the answers only from the test selected.

So I've made a custom link on the Test Name field like this:
index.php?option=com_fabrik&view=list&listid=41&rowid={#___c_quiz_id}

This takes me to the list, but doesn't filter the list with the test ID.

I don't know if this is the right approach (I believe not) , but the main idea it to have the ability to filter the list with {$my->id} and Quiz_Id from the first list link.

Is there any way to do this?

Thanks in advance.
 
You can't filter a list with "rowid" (this is for forms).

Use &your-id-element(of list41) = {...}
Is this placeholder replaced correctly with the rowid you are expecting to see?

Or do you directly want to see the record?
Then use something like
view=details&formid=41&rowid={#___c_quiz_id}
 
Thanks troester. I really want to see the list with the records associated with Quiz ID (10 records)

Unfortunately I'm still not able to do it.
If I use the list Prefilter like:

AND #___quiz_id_raw = 14 - It works, of course.

Then I tried your suggestion, and forced the Quiz ID to 14 just to test:

index.php?option=com_fabrik&view=list&listid=41&{#_quiz_id_raw}=14

It forwards me to the list, but not filtering the quiz_id.

So, I was thinking of something in the list Pre-Filter, which receive the form post or something...

(Of course I'm replacing # with my database table name)

Thanks in advance
 
{#_quiz_id_raw}=14
No
it must look like
&table___quiz_id_raw=14
without {} (this is for placeholders) and with 3 underscores
I'm not sure if it's with or without _raw

Is this the id element of your list41?
Or is it a foreign key (in list41) pointing to the list you are on?
If it's a FK and you set this element as dbjoin (in list41) you can enable "Related data" in your current list and you will get the link automatically.
 
OK, tried without {} but the result is the same. Let me try to be more specific.

I have a list that is linked to an existing quiz Joomla module. This list holds the users quiz results. In this case, this is list 47. Let's call it Quiz Results.
Here I have some fields, like:

id | quiz_id | user_id | result | etc...

So, I display this lists to user's, pre-filtered on the menu item, in order to users see their finished quizzes.

quiz_id field is a database join to another table, lets call it #___quizzes, which stores the Quizzes info, like Quiz name, Description, Category etc.

Then, I have another list, List 41 let's call it Detailed Results, which is linked to the same results table as list 47, but with some INNER JOINS, so I can grab detailed results for the quiz, and in this list, for example, I list the quiz questions, the user choice, the correct answer, etc.

So the link I want to have is from the Quiz Results List (47) to Detailed Results List (41) - And this is working where all the records are shown, records for all users and for all tests, but I want to see listed only the Detailed results of the user (with {$my->id} filter on the menu link) plus that the list is also filtered with the ID of the quiz from which I've clicked before on Quiz Result List (47).

I don't know if the "Related Data" is helpful here, because I've never used it. I was looking into WiKi and I don't think this is the way, I don't know... Also, I don't know if what I'm trying to achieve is really possible.

Imagine that when you click on quiz_id from Quiz Results List (47) and you're redirected to Detailed Results List (41), and here you have the List Filters Option enabled and triggered with the quiz_id value.

I'm sorry if I can't explain better, but in my opinion, this is more likely a filters issue than a Custom Link issue, because I can link to list 41 correctly, what I'm missing is a filter (at list in my understanding).

Thanks in advance.
 
Dear Hugh,
Yes, in fact.
Because I need to split information to end users. So, the List 47 only display basic Quiz Results, like Test Name, User ID, Result (x out of y), etc.

The second list, 41, is where I display the details, and because of that I need to have joins to other tables, where is stored information like quiz questions, the right answer, the user choice, etc, etc.

So, my idea is to make a link from the first List element (47) with the global results, to the second one (41) with details. This is working, except the Quiz ID filter, this is, when I click on first list on Test ID element 14 (not the row id), I'm linked to List 41, to filter out only the details for Test ID 14...

Am I doing the things wrong?

Thanks in advance.
 
So your link needs to filer as ... &tablename___id_raw={tablename___id_raw}

If it's the same table, and you just want to filter it to the one clicked on the first copy, then you need to filter on the PK.

-- hugh
 
Tried this:
index.php?option=com_fabrik&view=list&listid=41&vbcko_quiz_r_student_quiz___c_id={vbcko_quiz_r_student_quiz___c_id}, also tried this before but,

It works for the first test I click previously. After this, it looks like the first "filter" becomes cached and I have to logout and logon so I can see other results...

Strange isn't it?
 
OK, this worked. Thanks!!!

The only issue it that if I group the first list (List 47) then I get no results on the second list (41).
Any idea?
 
Don't really now what was the problem. But it looks like is solved now, after redoing all groupings, and disabling and enabling SEO friendly URLs.

I think it's solved now.

Thanks for your support.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top