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

TOPIC:

JDOM: Missing listOptions on radio control 02 Oct 2013 16:07 #11277

An example would make easier to understand what the problem is.
The following is just an example.

When passing this as $options:
$options = array();
$options["1"] = array("value" => "1", "text" => JText::_("ENUM_DAY_MONDAY"));
$options["2"] = array("value" => "2", "text" => JText::_("ENUM_DAY_TUESDAY"));
$options["3"] = array("value" => "3", "text" => JText::_("ENUM_DAY_WEDNESDAY"));
$options["4"] = array("value" => "4", "text" => JText::_("ENUM_DAY_THURSDAY"));
$options["5"] = array("value" => "5", "text" => JText::_("ENUM_DAY_FRIDAY"));
$options["6"] = array("value" => "6", "text" => JText::_("ENUM_DAY_SATURDAY"));
$options["7"] = array("value" => "7", "text" => JText::_("ENUM_DAY_SUNDAY"));

to this:
		$jdomOptions = array_merge(array(
				'dataKey' => $this->getOption('name'),
				'domClass' => $this->getOption('class'),
				'domId' => $this->id,
				'domName' => $this->name,
				'dataValue' => (string)$this->value,
				'labelKey' => $this->getOption('labelKey'),
				'list' => $options,
				'listKey' => $this->getOption('listKey'),
				'nullLabel' => $this->getOption('nullLabel'),
				'responsive' => $this->getOption('responsive'),
				'submitEventName' => ($this->getOption('submit') == 'true'?'onclick':null),
				'viewType' => $this->getOption('viewType')
			), $this->jdomOptions);
		
		$this->input = JDom::_('html.form.input.radio', $jdomOptions);

the JDOM doesn't read the list, and the render has options with no attributes, because it's expecting an OBJECT and we are passing an ARRAY.

FIX
add the following code to the line 78 of the file dom\html\form\input\select\radio.php
$item = (object)$item;
The following user(s) said Thank You: admin

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

Last edit: by Tomaselli.

JDOM: Missing listOptions on radio control 07 Oct 2013 00:16 #11301

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed.

K++
Coding is now a piece of cake
The following user(s) said Thank You: Tomaselli

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

  • Page:
  • 1
Time to create page: 0.074 seconds
I have been using Cook for only a day now and it is the next best thing to Jagermeister. It is very easy to use and I see some of the greatest Joomla Components ever! coming from Cook users.
Naude (Forum)

Get Started