Open GoogleCodeExporter opened 9 years ago
Original comment by johgep
on 1 Apr 2011 at 9:29
Is this issue already exists with latest version?
Original comment by johgep
on 12 Nov 2011 at 11:34
Yes I reproduce it whith the last version
Original comment by jflefeb...@sopragroup.com
on 14 Nov 2011 at 8:49
The autocompleter with selectBox is working with an static list. In your use
case you should use the <sj:select /> tag with autocomplete="true" instead.
<s:url id="remoteurl" action="jsonsample"/>
<sj:select
href="%{remoteurl}"
autocomplete="true"
id="echo3"
name="echo"
list="languageObjList"
listKey="myKey"
listValue="myValue"
emptyOption="true"
headerKey="-1"
headerValue="Please Select a Language"/>
Original comment by johgep
on 14 Nov 2011 at 11:47
Sorry but that does not work.
I would like to have (like struts 2 dojo autocompleter) an autocompleter that
complete in ajax and have the possibility to select an item with the selectbox
(ajax mode)
Original comment by jflefeb...@sopragroup.com
on 16 Nov 2011 at 7:25
Any idea to make it work with JSON ?
Original comment by jflefeb...@sopragroup.com
on 10 Feb 2012 at 8:54
Pleuse find my code to enable this fonctionnality. Do you wich to include it
into your very good framework !!!!
// Met un max width a la liste de tous les autocompleters de la page
// et autorise vide comme option valide
var originalAutocompleterFunction=jQuery.struts2_jquery_ui.autocompleter;
jQuery.struts2_jquery_ui.autocompleter = function($elem, options) {
originalAutocompleterFunction.call(this,$elem, options);
// Vide est une option valide
if(options.forceValidOption) {
$elem.keyup(function(event) {
var val = $elem.val();
if(!val){
jQuery(jQuery.struts2_jquery.escId(options.hiddenid)).val('');
}
});
}
$elem.autocomplete('widget').css("max-width", $elem.width());
if(options.selectBoxIcon && !options.selectBox) {
jQuery.struts2_jquery.require([ "js/base/jquery.ui.widget" + self.minSuffix + ".js", "js/base/jquery.ui.button" + self.minSuffix + ".js", "js/plugins/jquery.combobox" + self.minSuffix + ".js" ]);
var initialMinLength = $elem.autocomplete( "option", "minLength" );
var height = $elem.outerHeight(true);
//var buttonId = 'autocompleter_fleche_'getUniqueId();
var button = jQuery("<button type='button'> </button>")
.attr("tabIndex", -1)
//.attr("id", buttonId)
.attr("title", "Show All Items")
.insertAfter($elem).button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.css( "marginLeft", "-1px" )
.css( "width", height )
.css( "height", height )
.removeClass("ui-corner-all")
.addClass("ui-corner-right ui-button-icon")
.click(function() {
// close if already visible
if ($elem.autocomplete("widget").is(":visible")) {
$elem.autocomplete("close");
return;
}
// work around a bug (likely same cause as #5265)
jQuery(this).blur();
// pass empty string as value to search for, displaying all results
$elem.autocomplete({ minLength: 0 });
$elem.autocomplete("search", $elem.val());
$elem.focus();
$elem.autocomplete({ minLength: initialMinLength });
});
button.find(".ui-button-icon-only .ui-button-text").css( "padding", "0.35em" );
button.css( "margin", 0 ).css( "padding", "0.48em 0 0.47em 0.45em;" );;
button.position({
of: $elem,
my: "left center" ,
at: "right center" ,
offset: "0 0"
});
}
};
Original comment by jflefeb...@sopragroup.com
on 23 May 2012 at 7:22
Original issue reported on code.google.com by
jflefeb...@sopragroup.com
on 30 Mar 2011 at 12:16