Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • giori
  • giori's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 14
What exactly must be changed in the JDOM code in the templates to transform a dropdown box into a radio box?

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

Last edit: by admin.

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

  • giori
  • giori's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 14
No help?

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

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

  • giori
  • giori's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 14
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!

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

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

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

Last edit: by admin.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

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

Last edit: by admin.

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

  • giori
  • giori's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 14
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 :)

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

Last edit: by giori.
  • Page:
  • 1
Time to create page: 0.062 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started