Forums

persistence of filter

emmexx 02 Dec, 2012
I'm developing a summary page, a sort of homemade chrono connectivity 😀

In the page many records are listed and I added a link to each record in order to open a form where the user can edit it.

Now I'm trying to add a filter that persists between the edit operations.
What the user should be able to do is:
- select a value from a drop down control
- "submit" to filter the records in the summary page
- edit a record and save or run an event that updates a field of a record
- go back to the summary page with the filter still active.

I created the filter using Data to Session and Session to Data and it works only if I don't try to edit a record. Session data isn't kept when clicking on a link.

My question is:
Is there a chronoform way to let a filter persist between forms accessed by way of a link and not submitting?
At the moment I'm using javascript to inject a parameter to the link to let the filters pass from one page to the other but I'm not very satisfied of this method. Is there a better way to do that?

Thank you
maxx
GreyHead 02 Dec, 2012
HI Maxx,

You could add it directly to the Joomla! User session. That will persist until the end of the session or until you remove it.

Bob
emmexx 02 Dec, 2012

You could add it directly to the Joomla! User session. That will persist until the end of the session or until you remove it.



Thank you Bob, now I know that joomla manages sessions too. 😶

I used getUserState() and setUserState() and it works like a charm!

Bye
maxx
GreyHead 03 Dec, 2012
Hi Maxx,

Great, I thought of the UserState methods - but after I'd posted :-(

Bob
This topic is locked and no more replies can be posted.