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

TOPIC:

Duplicated ID Issue in select drop-down 10 Sep 2013 04:38 #11034

  • vlemos
  • vlemos's Avatar Topic Author
  • Away
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin, please review the coding of the combo-box. Currently the generated select ID and the hidden input ID are identical and therefore the value of the input is never updated. However, any small change in one of the IDs resolves the issue. Regards v

Test change made.
$html = '<select id="_<%DOM_ID%>" name="<%INPUT_NAME%>"<%STYLE%><%CLASS%><%SELECTORS%>'

Changes to the "'formControl" value should also help to resolve the issue.without changes to jdom.
"'formControl' => '_ajxjform',"


Code @ \dom\html\form\input\select\combo.php
class JDomHtmlFormInputSelectCombo extends JDomHtmlFormInputSelect
{
	var $level = 5;			//Namespace position : function
	var $last = true;		//This class is last call
	var $canEmbed = true;
	
	.
	.
	.

	function build()
	{
		
		if ($this->groupBy)
			$options = $this->buildOptionsGroup();
		else
			$options = $this->buildOptions();


		if ($this->ui == 'chosen')
		{
			JDom::_('framework.jquery.chosen');			
			$this->addClass('chzn-select');
		}

		$html =	'<select id="<%DOM_ID%>" name="<%INPUT_NAME%>"<%STYLE%><%CLASS%><%SELECTORS%>'
			.	($this->size?' size="' . $this->size . '"':'') . '>' .LN
			.	$this->indent($this->buildDefault(), 1)
			.	$this->indent($options, 1)
			.	'</select>'.	LN
			.	'<%VALIDOR_ICON%>'.LN
			.	'<%MESSAGE%>';

		return $html;

	}
	.
	.
	.
}


Generated HTML
status\view.html.php
/* Ajax List : 
 * Called from:
 */
	$model = $this->getModel();
	$items = $model->getItems();
	$selected = (is_array($values))?$values[count($values)-1]:$values;
	$event = 'jQuery("#jform_internalid").val(this.value);';
	echo '<div class="ajaxchain-filter ajaxchain-filter-hz">';
		echo '<div class="separator">';
			echo JDom::_('html.form.input.select', array(
				'dataKey' => 'internalid',
				'dataValue' => $selected,
				'formControl' => 'jform',
				'labelKey' => 'image',
				'list' => $items,
				'listKey' => 'id',
				'nullLabel' => 'COM_FILTER_NULL_STATUS_ITEM',
				'selectors' => array(
						'onchange' => $event
					)
				));
		echo '</div>';
	echo '</div>';
	break;


Generated HTML contains:
<select id="jform_internalid"
<input id="jform_internalid"
<div class="controls">
	<div id="_ajax_status_select11">
		<div class="ajaxchain-filter ajaxchain-filter-hz">
			<div class="separator">
				<select onchange="jQuery(&quot;#jform_internalid&quot;).val(this.value);" name="jform[internalid]" id="jform_internalid">
					<option value="">- status item -</option>
					<option value="1">blue-marker.png</option>
					<option selected="selected" value="2">yellow-marker.png</option>
					<option value="3">green-marker.png</option>
				</select>
			</div>
		</div>
	</div>
	<input type="hidden" value="" name="jform[internalid]" id="jform_internalid">
</div>

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

Last edit: by vlemos.

Duplicated ID Issue in select drop-down 10 Sep 2013 19:15 #11054

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I have seen this issue already fixed in local.
A nice upgrade is coming soon. I am testing it.
Coding is now a piece of cake

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

Duplicated ID Issue in select drop-down 23 Sep 2013 17:39 #11148

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed now since 2.6
Coding is now a piece of cake
The following user(s) said Thank You: vlemos

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

  • Page:
  • 1
Time to create page: 0.055 seconds

  I am so so so looking forward to see how far this can go. Seems like the skies the limit at the moment.
Kevin (Forum) 

Get Started