Hello all
I want to pass a value to a Chronoconnectivity list to filter the list - for example to have the user select "State" in a Chronoform and then call the Connection with that parameter so that it then filters the list to records containing that value.
A similar functionality to the very easy to use DB Record Loader actions in Chronoforms.
So here is what I tried:
I have a Connection which works when executed directly - shows all records and allows filtering by the standard search. The table has a column named "State".
I have a ChronoForm which has a Text Box with field name "state". I create a Chronoconnectivity Task event in the OnSubmit event and place my Connection name in there, I select Task as List Data, and the field name "state" in the Field Name and "State" in the Data Field name - this is the column name in the table.
I place the Chronoconnectivity Task Event sequence number in the Connection Front-end in the List Task area.
When I run the form I enter a value in State Text Box and click submit. It runs the Connection but displays the basic connection as if I had run it directly with no filter - it shows all records. I note that the calling URL to the Connection does not include the parameter so it is fairly clear why it doesn't work - the question is how to get it in there.
The URL shows like this
mydomain/component/com_chronoforms/chronoform,Chronoconnectivity_Task_Test/?chronoform=Chronoconnectivity_Task_Test&event=submit
I am sure this is such a standard functionality that I have done something very simple wrong. Any clues will be much appreciated.
Cheers
Tim
I want to pass a value to a Chronoconnectivity list to filter the list - for example to have the user select "State" in a Chronoform and then call the Connection with that parameter so that it then filters the list to records containing that value.
A similar functionality to the very easy to use DB Record Loader actions in Chronoforms.
So here is what I tried:
I have a Connection which works when executed directly - shows all records and allows filtering by the standard search. The table has a column named "State".
I have a ChronoForm which has a Text Box with field name "state". I create a Chronoconnectivity Task event in the OnSubmit event and place my Connection name in there, I select Task as List Data, and the field name "state" in the Field Name and "State" in the Data Field name - this is the column name in the table.
I place the Chronoconnectivity Task Event sequence number in the Connection Front-end in the List Task area.
When I run the form I enter a value in State Text Box and click submit. It runs the Connection but displays the basic connection as if I had run it directly with no filter - it shows all records. I note that the calling URL to the Connection does not include the parameter so it is fairly clear why it doesn't work - the question is how to get it in there.
The URL shows like this
mydomain/component/com_chronoforms/chronoform,Chronoconnectivity_Task_Test/?chronoform=Chronoconnectivity_Task_Test&event=submit
I am sure this is such a standard functionality that I have done something very simple wrong. Any clues will be much appreciated.
Cheers
Tim
Hi Tim,
You can do this by simply naming your form field "fltr[Model][field]" and add the "Model.field" to the filters list in the connection settings, then set the form action URL to the connection's url!
That's how it should work in v5, and I think v4 may be the same!
Regards,
Max
You can do this by simply naming your form field "fltr[Model][field]" and add the "Model.field" to the filters list in the connection settings, then set the form action URL to the connection's url!
That's how it should work in v5, and I think v4 may be the same!
Regards,
Max
Thanks Max,
I tried that and got a blank screen after the submit.
I am puzzled by two things:
1. In the instructions for the filters, it says "Comma separated list of fields to be used as filters, if you are using the field 'Model.name' as a filter field then the form field name should = 'filter_model_name'. Does this mean my form field should be named like this? I have tried this by changing what you suggest to a field name of "fliter_M1_state" with again a blank return.
2. I am not sure what you mean by "set the form action URL to the connection's url!". In the Chronoconnectivity Task settings there is no place for a URL, only for a Connection name. So how do I set the URL?
Sorry, I know this should be easy. Should I upgrade to V5?
Cheers
Tim
I tried that and got a blank screen after the submit.
I am puzzled by two things:
1. In the instructions for the filters, it says "Comma separated list of fields to be used as filters, if you are using the field 'Model.name' as a filter field then the form field name should = 'filter_model_name'. Does this mean my form field should be named like this? I have tried this by changing what you suggest to a field name of "fliter_M1_state" with again a blank return.
2. I am not sure what you mean by "set the form action URL to the connection's url!". In the Chronoconnectivity Task settings there is no place for a URL, only for a Connection name. So how do I set the URL?
Sorry, I know this should be easy. Should I upgrade to V5?
Cheers
Tim
Hi Max,
Sorry, my mistake. It is working now.
Many many thanks.
Where do I send the beer?
Cheers
Tim
Sorry, my mistake. It is working now.
Many many thanks.
Where do I send the beer?
Cheers
Tim
No problems!🙂
Just a note, you can install v5 beside v4, so you may use it for new connections and keep v4 for existing ones, and they should work together just fine!
Regards,
Max
Just a note, you can install v5 beside v4, so you may use it for new connections and keep v4 for existing ones, and they should work together just fine!
Regards,
Max
I am sorry but I spoke too soon - this is still not working for me. I tried the settings above - thought it was working - but I have found that it is not.
I have a very simple setup, one table, one connection, no model ID. I have a simple form with one field and a submit button. My wish is that an entry in this field will select rows in a CC Connection and display them.
I have gone to basics.
One form with a single field which I named 'filter_state', and a submit button. The Submit event with a CC task in it, which uses the connection that I have set up on the table. The connection works - I can run the front end and see and search the fields I want, including a column State.
The CC Task event is set to List Data and has the Data field set to 'filter_state'. So I expect that the value of this field will be passed to the connection.
I assumed that the 'Filters field names' setting should contain the table column name that the filter will apply to - otherwise I don't see how the connection knows how to make the SQL statement.
When I run the form I can enter a valid value (one where I know there is at least one matching table row) but whatever I try the connection returns the entire table, and no filtering takes place. I have tried many combinations but I cannot make any other result.
I'm sure there is a simple answer I just don't know what it is. I don't need anything fancy here - it is a simple selection with a single field in a single table.
Cheers
Tim
I have a very simple setup, one table, one connection, no model ID. I have a simple form with one field and a submit button. My wish is that an entry in this field will select rows in a CC Connection and display them.
I have gone to basics.
One form with a single field which I named 'filter_state', and a submit button. The Submit event with a CC task in it, which uses the connection that I have set up on the table. The connection works - I can run the front end and see and search the fields I want, including a column State.
The CC Task event is set to List Data and has the Data field set to 'filter_state'. So I expect that the value of this field will be passed to the connection.
I assumed that the 'Filters field names' setting should contain the table column name that the filter will apply to - otherwise I don't see how the connection knows how to make the SQL statement.
When I run the form I can enter a valid value (one where I know there is at least one matching table row) but whatever I try the connection returns the entire table, and no filtering takes place. I have tried many combinations but I cannot make any other result.
I'm sure there is a simple answer I just don't know what it is. I don't need anything fancy here - it is a simple selection with a single field in a single table.
Cheers
Tim
This topic is locked and no more replies can be posted.
