Welcome, Guest
Username: Password: Remember me

TOPIC: [FAQ] How to create a radio box?

[FAQ] How to create a radio box? 30 Nov 2011 10:00 #646

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
What exactly must be changed in the JDOM code in the templates to transform a dropdown box into a radio box?
Last Edit: 08 Dec 2011 20:24 by admin.
The administrator has disabled public write access.

[FAQ] How to create a radio box? 05 Dec 2011 19:27 #669

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
No help?
The administrator has disabled public write access.

[FAQ] How to create a radio box? 07 Dec 2011 10:30 #677

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
Maybe I did not express myself clearly, but I would like to know, how to create radio buttons with Cook such as an exclusive selection of 5 choices like:

Number of Voices: x Solo x Duet x Trio x Quartet x Multiple.

or Marital Status: x Single x Married x Divorced x Widowed

I could not find out how this an be done with Cook. Thank you for helping!
The administrator has disabled public write access.

[FAQ] How to create a radio box? 08 Dec 2011 10:28 #680

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3710
  • Thank you received: 984
  • Karma: 140
Just because there are different ways to do this, and maybe the shortest for me is to develop the functionality.

If you instance a boolean, Cook furnish you the JDom radio class.
Maybe you can look inside this radio class to understand how the items are furnished in parameters.
It should be a way. I don't remember exacly all source code, so I have to check, it should be possible with only few lines to transform the select list array to an object for the JDom radio class.

Stay in touch.
I'm so sorry to have lot of work for the moment.


I promise I don't forget you.
Coding is now a piece of cake
Last Edit: 08 Dec 2011 10:29 by admin.
The administrator has disabled public write access.

[FAQ] How to create a radio box? 08 Dec 2011 20:12 #681

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3710
  • Thank you received: 984
  • Karma: 140
Well.
It was more easy to make a little fix in jdom radio than to have a long explanation.

Regenerate your component and if you are already in production, only overwite JDom
(or only html/form/input/radio.php)


Maybe you don't have this file. No panic. To get this JDom class, your project MUST contain at least 1 boolean PRESENT in a at least 1 layout.


In the template, in your code :
<?php echo JDom::_('html.form.input.select', array(...


Change to :
<?php echo JDom::_('html.form.input.radio', array(...


This is the power of JDom !
JDom has not been created for incredible controls, but ONLY to be able to abtract the HTML controls.


This works also in the filters as well.

JDom has to progress even more.
If you like the concept and understand the framework, you can propose me your controls.
Coding is now a piece of cake
Last Edit: 08 Dec 2011 20:22 by admin.
The administrator has disabled public write access.

Re: [FAQ] How to create a radio box? 08 Dec 2011 20:37 #683

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
Thank you for the explanations. You see, I did have the intuition to make the change you proposed below from html.input.select to html.input.radio. That much I understod with JDom. But when I regenerated and tried out I got an error message. That's why I was unsure whether it was the right thing to do. Obviously that was only part of the work. I did not have a boolean field in my table. So I will try it out tomorrow.

My first Cook generated component for an intranet was 'bienvenue'! They already asked for more :)
Last Edit: 08 Dec 2011 20:38 by giori.
The administrator has disabled public write access.
Time to create page: 0.116 seconds

Get Started