Skip to Content Skip to Menu

Query Drop Down (Single Select) with static options

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 3 months ago #247323 by carin
I have successfully set up a Query Drop Down (Single Select) field. Now I face the problem that I dont know how to add some static options. At least I need to make the default option empty so the validation can kick in when this required field is not filled (option chosen) by the user. Right now the default option on the form is the first db query result which is not appropriate.

Thanks

CB 2.0

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #247345 by krileon
You can't add static options. It gets its options entirely from your database query. So you'd need to add the options to your database table.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 3 months ago - 10 years 3 months ago #247385 by carin

So you'd need to add the options to your database table.

... it is a "Query" field, so it collects info from different tables. My other "Query Drop Down (Single Select)" collects usergroups ... where exactly do I add my static option?

The field itself should at least support the Joomla standard values like "- select -" so the field does have a reasonable default value. I know it is possible to code the field that way because SEBLOD solved that by adding input fields to the Query field setup page. Please do that for the CB fields too.

Thanks

CB 2.0
Last edit: 10 years 3 months ago by carin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #247415 by krileon

... it is a "Query" field, so it collects info from different tables. My other "Query Drop Down (Single Select)" collects usergroups ... where exactly do I add my static option?

Use joins and unions as needed to merge multiple tables together in your query.

The field itself should at least support the Joomla standard values like "- select -" so the field does have a reasonable default value. I know it is possible to code the field that way because SEBLOD solved that by adding input fields to the Query field setup page. Please do that for the CB fields too.

This will be possible with CB 2.0. It's just not possible in CB 1.x. With CB 2.0 you'll be able to specify options like any other select field in addition to the query options, but it won't function until CB Query Field new release after CB 2.0 goes stable.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 3 months ago #247418 by carin
"This will be possible with CB 2.0"

Ah, good news ... so on Thursday, right?

CB 2.0

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #247421 by krileon
The options will be there, yes, but they won't do anything. CB Query Field has no idea they exist or what to do with them. CB Query Field will see a new release after CB 2.0 goes stable (as will all the other incubator projects).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

Moderators: beatnantkrileon
Powered by Kunena Forum