Keep stored values on select

More
7 years 4 months ago #65457 by jrodgar
hi!

We have some selects where there is a list of values stored on sql. Some of this values are not available with the time, but we want to keep the old value stored when looking at it on the front (maybe on the backend also?)

For example, imagine that I have a table like

id,name,validTo
1,Foo,null
2,Bar,2014

I don´t want the user to be able to select "Bar", but if it was selected on the past, I want to keep that info

If I make my sql query something like

select * fom list where validTo is null or validTo > today

I don´t see Bar on the select (this is nice) but I don´t see it neither on the front

There is an additional complication and that is that maybe Bar is modifiable (and called later Barrr), so its not as easy as store also the label... although it could be a compromise

What do you think?

Regards

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago - 6 years 11 months ago #65458 by ggppdk
Replied by ggppdk on topic Keep stored values on select
Hello

-- in all cases whatever solution is proposed the rows should not be deleted from YOUR sql table

About solution, i think it can be to add a state properties 'state' in our SQL SELECT

state: 0 : unpublished -- hide it in form, but show it in form if field has the value already, hide values when item is viewed
state: 1 : or missing: published -- show it (current behaviour)
state: 2 : archived -- hide it in form, but show it in form if field has the value already (otherwise show as disabled), also show existing values when item is viewed
state: -2: trashed -- hide it in form, and delete existing on form save, hide values when item is viewed

SELECT col1 as value, col2 as text, col3 as valgrp, col4 as image, col5 as state ...


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 6 years 11 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #65461 by jrodgar
that sounds wonderful!

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #67262 by jrodgar
any estimate on this? :)

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago - 6 years 11 months ago #67275 by ggppdk
Replied by ggppdk on topic Keep stored values on select
Hello

Yes have implemented states:
- "published, archived, unpublished" as described above

[strike]the "trashed" state was not done and probably will not be done later either because it could lead to issues[/strike]
No 'Trashed' will be done too

Needs a little more testing and it will go to github too


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 6 years 11 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #67285 by ggppdk
Replied by ggppdk on topic Keep stored values on select
Hello

it is now on github , you may test it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.532 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline