# R52525 - /trunk/etemplate/js/et2\_widget\_selectbox.js

**URL:** <http://discourse.egroupware.org/t/r52525-trunk-etemplate-js-et2-widget-selectbox-js/65010>\
**Category:** eGW-svn\
**Created:** [April 16, 2015, 12:10pm UTC](http://discourse.egroupware.org/t/r52525-trunk-etemplate-js-et2-widget-selectbox-js/65010 "2015-04-16T12:10:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralfbecker\_sf](http://discourse.egroupware.org/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ralfbecker\_sf](http://discourse.egroupware.org/u/ralfbecker_sf)\
**Post date:** [April 16, 2015, 12:10pm UTC](http://discourse.egroupware.org/t/r52525-trunk-etemplate-js-et2-widget-selectbox-js/65010/1 "2015-04-16T12:10:55Z")

</div>

Author: ralfbecker  
New Revision: 52525

URL: [http://svn.stylite.de/viewvc/egroupware?rev=52525&view=rev](http://svn.stylite.de/viewvc/egroupware?rev=52525&view=rev)  
Log:  
reverting previous commit, as it breaks in other places

Modified:  
trunk/etemplate/js/et2\_widget\_selectbox.js

# Modified: trunk/etemplate/js/et2\_widget\_selectbox.js URL: [http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2\_widget\_selectbox.js?rev=52525&r1=52524&r2=52525&view=diff](http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2_widget_selectbox.js?rev=52525&r1=52524&r2=52525&view=diff)

— trunk/etemplate/js/et2\_widget\_selectbox.js (original)  
+++ trunk/etemplate/js/et2\_widget\_selectbox.js Thu Apr 16 14:10:55 2015  
@@ -495,7 +495,9 @@  
}  
else  
{

- 

```
  			this.egw().debug("warn", "Tried to set value '%s' that isn't an option", _value, this);

```

- 

```
  			var debug_value = _value;

```

- 

```
  			if(debug_value === null) debug_value == 'NULL';

```

- 

```
  			this.egw().debug("warn", "Tried to set value '%s' that isn't an option", debug_value, this);
  		}
  		return;
  	}

```

@@ -527,7 +529,9 @@  
{  
if(jQuery(“input[value=’”+\_value+"’]", this.multiOptions).prop(“checked”, true).length == 0)  
{

- 

```
  		this.egw().debug("warn", "Tried to set value that isn't an option", this, _value);

```

- 

```
  		var debug_value = _value;

```

- 

```
  		if(debug_value === null) debug_value == 'NULL';

```

- 

```
  		this.egw().debug("warn", "Tried to set value '%s' that isn't an option", debug_value, this);
  	}
  }

```

@@ -770,6 +774,7 @@  
{  
var name\_parts = widget.id.replace(/[/g,’[’).replace(/]|]/g,’’).split(’[’);

- 

```
  var type_options = [];
  var content_options = {};

  // First check type, there may be static options. There's some special handling

```

@@ -785,12 +790,12 @@  
attrs.other = attrs.other.split(’,’);  
}  
// Copy, to avoid accidental modification

- 

```
  	content_options = this[type_function].call(this, widget, attrs);

```

- 

```
  	jQuery.extend(true, type_options, this[type_function].call(this, widget, attrs));
  	widget._type = old_type;
  }

  // Try to find the options inside the "sel-options"

```

- 

```
  if(jQuery.isEmptyObject(content_options) && widget.getArrayMgr("sel_options"))

```

- 

```
  if(widget.getArrayMgr("sel_options"))
  {
  	// Try first according to ID
  	content_options = widget.getArrayMgr("sel_options").getEntry(widget.id);

```

@@ -879,6 +884,32 @@  
if (content\_options == null)  
{  
content\_options = {};

- 

```
  }

```

- 
- 

```
  // Include type options, preferring any content options

```

- 

```
  if(type_options.length || !jQuery.isEmptyObject(type_options))

```

- 

```
  {

```

- 

```
  	for(var i in content_options)

```

- 

```
  	{

```

- 

```
  		var value = typeof content_options[i] == 'object' && typeof content_options[i].value !== 'undefined' ? content_options[i].value : i;

```

- 

```
  		var added = false;

```

- 
- 

```
  		// Override any existing

```

- 

```
  		for(var j in type_options)

```

- 

```
  		{

```

- 

```
  			if(type_options[j].value === value)

```

- 

```
  			{

```

- 

```
  				added = true;

```

- 

```
  				type_options[j] = content_options[i];

```

- 

```
  				break;

```

- 

```
  			}

```

- 

```
  		}

```

- 

```
  		if(!added)

```

- 

```
  		{

```

- 

```
  			type_options.splice(i,0,content_options[i]);

```

- 

```
  		}

```

- 

```
  	}

```

- 

```
  	content_options = type_options;
  }
  return content_options;

```

},  
@@ -1068,10 +1099,10 @@  
attrs.select\_options = egw.window.et2\_selectbox.type\_cache[this.cache\_id];

```
  		egw.window.setTimeout(jQuery.proxy(function() {

```

- 

```
  			this.widget.set_select_options(egw.window.et2_selectbox.type_cache[this.cache_id]||{});

```

- 

```
  			this.widget.set_select_options(et2_selectbox.find_select_options(this.widget,{}, this.widget.options));
  		},this),1);
  	},{widget:widget,cache_id:cache_id}));

```

- 

```
  	return {};

```

- 

```
  	return [];
  }
  else
  {

```

* * *

BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT  
Develop your own process in accordance with the BPMN 2 standard  
Learn Process modeling best practices with Bonita BPM through live exercises  
[http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-](http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-) event?utm\_  
source=Sourceforge\_BPM\_Camp\_5\_6\_15&utm\_medium=email&utm\_campaign=VA\_SF

* * *

eGroupWare-cvs mailing list  
[eGroupWare-cvs@lists.sourceforge.net](mailto:eGroupWare-cvs@lists.sourceforge.net)  
[https://lists.sourceforge.net/lists/listinfo/egroupware-cvs](https://lists.sourceforge.net/lists/listinfo/egroupware-cvs)
