Buy Now
Sign in

Dropdown to events

ieraora , February 16 2020, 23:38
I
ieraora 135
February 16 2020, 23:38 #391212
Hello, I search an Idea...
I would create a dropdown (with button) with selects that run events like PUBLISH SELECTED, but I'm very unskilled
I've only create
VIEWS > DROPDOWN > NAME various_events
OPTIONS
publish_selected= PUBLISH SELECTED
unpublish_selected= UNPUBLISH SELECTED
VIEWS > TOOLBAR BUTTON > NAME toolbar_button55 > LIST VIEW NAME articles_list
How can I connect first option (publish_selected) to FUNCTION publish_articles_group and second option to another FUNCTION?
Thank for you reply.
healyhatman 9
February 17 2020, 03:31 #391213
Can you share a screenshot of your view so I can better understand how you're organising your data?
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 06:29 #391215
Annotazione_2020-02-17_072505.pngAnnotazione_2020-02-17_072632.png
Annotazione_2020-02-17_072725.png
Annotazione_2020-02-17_072830.png
Attachments
Annotazione_2020-02-17_072505.png
Annotazione_2020-02-17_072505.png
(24.63 KiB)
251 Downloads/Views
Annotazione_2020-02-17_072632.png
Annotazione_2020-02-17_072632.png
(32.5 KiB)
246 Downloads/Views
Annotazione_2020-02-17_072725.png
Annotazione_2020-02-17_072725.png
(30.16 KiB)
254 Downloads/Views
Annotazione_2020-02-17_072830.png
Annotazione_2020-02-17_072830.png
(66.59 KiB)
246 Downloads/Views
healyhatman 9
February 17 2020, 10:26 #391221
The problem here is that the articles_list is one "form", and the select is in a separate form, so it won't have the data from both. It would probably be better to have a "publish" button and an "unpublish" button. They can both submit to the same event, just append say &action=publish or &action=unpublish to the URL and perform the appropriate action.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 11:31 #391222
Thank you healyhatman for your reply. Publish and unpublish is only an example for us, I need to add at least 6 options (public/private... buy/free).
what do you mean with "separate form"?
healyhatman 9
February 17 2020, 11:42 #391223
The "list view name" option for the toolbar button is actually referencing the name of a FORM element. When you submit a form on a website it submits ONE form element. The buttons are outside of the the form referenced by the list view name option - namely, the list (which will be wrapped inside <form> tags).
So the only way to do it is to either wrap the whole lot of it in form tags (so use a Form Area, put {view:your_buttons} and {view:your_list} inside it, and in your toolbar button set the "list view name" to the name of that parent form element, or do what I said, or make your own jQuery code to submit the value of the dropdown along with the list selections.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 12:01 #391224
Sorry, but the list view name for me is refering to a TABLE VIEW
Annotazione_2020-02-17_125658.png
Annotazione_2020-02-17_125910.png
I need to 6 options to change these columns. Repeate, piublish/unpublish was only to do simple the ticket
Attachments
Annotazione_2020-02-17_125658.png
Annotazione_2020-02-17_125658.png
(35.43 KiB)
234 Downloads/Views
Annotazione_2020-02-17_125910.png
Annotazione_2020-02-17_125910.png
(87.45 KiB)
239 Downloads/Views
healyhatman 9
February 17 2020, 12:11 #391226
Yes, "list view name" for you references a table. But if you look at the code, you will see a <form> tag surrounding the table. So REALLY it's referencing a <form> element on the page. That's why you can put the NAME of a form area on there, and it will submit the data from the referenced form.
You can right click your table and click "inspect element" and have a look if you don't believe me.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 12:20 #391227
Ok. but really there isn't a way with CC6 to reach this solution? Is difficult for me think this. Can I open a ticket?
healyhatman 9
February 17 2020, 12:43 #391229
I already explained 3 options for doing it. It's not a "CC6 problem", it's a "way the internet browsers and HTML forms have been designed to work for the past 30 years" thing.
Best option: use a Form Area, put your toolbar, select, table view, everything inside it. Your toolbar button's "list view name" set to the name of the form area.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 13:17 #391230
Ok, done. See below, Is correct?
Now how can I implement events with various options of select?
Annotazione_2020-02-17_141041.png
Annotazione_2020-02-17_141253.png
Annotazione_2020-02-17_141405.png
Attachments
Annotazione_2020-02-17_141041.png
Annotazione_2020-02-17_141041.png
(24.16 KiB)
212 Downloads/Views
Annotazione_2020-02-17_141253.png
Annotazione_2020-02-17_141253.png
(41.49 KiB)
221 Downloads/Views
Annotazione_2020-02-17_141405.png
Annotazione_2020-02-17_141405.png
(28.89 KiB)
218 Downloads/Views
healyhatman 9
February 17 2020, 13:19 #391231
Your read data actions {fn:} can stay outside the form area, it's the VIEWS that need to be inside it.
Put a {debug:} in the event you're submitting to, and click your toolbar button and you should be able to see all the data available to you. Use an event switcher accordingly.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 17 2020, 13:37 #391232
I've this error.
Annotazione_2020-02-17_143256.png
And is correct a switcher like this?
Annotazione_2020-02-17_143702.png
Attachments
Annotazione_2020-02-17_143256.png
Annotazione_2020-02-17_143256.png
(43.62 KiB)
218 Downloads/Views
Annotazione_2020-02-17_143702.png
Annotazione_2020-02-17_143702.png
(27.44 KiB)
217 Downloads/Views
I
ieraora 135
February 18 2020, 19:53 #391256
Sorry, there are no suggestions?
healyhatman 9
February 18 2020, 21:44 #391257
Turn off "require selection" in the toolbar button.
That data provider has an extra } at the end which shouldn't be there. And pretty sure you want {data:name_of_dropdown}
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 19 2020, 01:20 #391261
This is my work, Where I wrong?
healyhatman 9
February 19 2020, 05:17 #391264
Your list needs to be inside the form as well
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 19 2020, 07:05 #391265

  
Array
(
[cont] => manager
[conn] => BE_gestione_galleria-toogle-copy
[event] => try_dropdown
[select54] => publish_selected
[gcb] => Array
(
[0] => 320
[1] => 321
)

[Foto] => Array
(
[320] => Array
(
[p_description] => galleria 2
[g_tag] => sub1
[p_cu] => Q0GREI
)

[321] => Array
(
[p_description] => galleria 2
[g_tag] => sub1
[p_cu] => Q0GREI
)

[322] => Array
(
[p_description] => galleria 2
[g_tag] => sub1
[p_cu] => Q0GREI
)

[323] => Array
(
[p_description] => galleria 2
[g_tag] => sub1
[p_cu] => Q0GREI
)

)

[format] => html
[Itemid] => 157
[option] => com_chronoconnectivity6
[view] => connection
)
Array
(
[switch20] => Array
(
[finished] => 1
[var] =>
)

)

And Now?
healyhatman 9
February 19 2020, 10:24 #391267
You should be able to sort yourself out from here surely? Everything looks to be there. gcb is your selections, select54 is your dropdown (PLEASE name it something else). Your switch data source is "{data:various_events}" but you haven't actually named your dropdown that.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I
ieraora 135
February 19 2020, 11:43 #391268
Sorry, I try without success.
I think switch isn't correct, but I don't know the way.
{data:various_events} take name of dropdown, is correct?
I tried the Values setup of switch in this way
{var.various_events:publish_selected}={fn:publish_articles_group}
{var.various_events:unpublish_selected}={error:saving the article failed.}