Fixed in 5.1.3;
https://code.google.com/p/primefaces/is ... il?id=7620
Picklist- Move buttons not working
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Posts: 22
- Joined: 06 May 2011, 15:45
- Location: São Paulo/Brazil
Hi ch0x. You can use this javascript snippet to fix the bug, if you don't want to update the PrimeFaces.chr0x wrote:Hi! I'm facing the same problem here with these buttons. There's something I can do to fix the Move UP and Move DOWN buttons for the picklist?
Code: Select all
fixPickList = function() {
if (typeof PrimeFaces.widget.PickList != 'undefined') {
PrimeFaces.widget.PickList.prototype.bindButtonEvents = function() {
var a = this;
PrimeFaces.skinButton(this.jq.find(".ui-button"));
$(this.jqId + " .ui-picklist-button-add").click(function() {
a.add();
});
$(this.jqId + " .ui-picklist-button-add-all").click(function() {
a.addAll();
});
$(this.jqId + " .ui-picklist-button-remove").click(function() {
a.remove();
});
$(this.jqId + " .ui-picklist-button-remove-all").click(function() {
a.removeAll();
});
if (this.cfg.showSourceControls) {
$(
this.jqId
+ " div.ui-picklist-source-controls .ui-picklist-button-move-up")
.click(function() {
a.moveUp(a.sourceList);
});
$(
this.jqId
+ " div.ui-picklist-source-controls .ui-picklist-button-move-top")
.click(function() {
a.moveTop(a.sourceList);
});
$(
this.jqId
+ " div.ui-picklist-source-controls .ui-picklist-button-move-down")
.click(function() {
a.moveDown(a.sourceList);
});
$(
this.jqId
+ " div.ui-picklist-source-controls .ui-picklist-button-move-bottom")
.click(function() {
a.moveBottom(a.sourceList);
});
}
if (this.cfg.showTargetControls) {
$(
this.jqId
+ " div.ui-picklist-target-controls .ui-picklist-button-move-up")
.click(function() {
a.moveUp(a.targetList);
});
$(
this.jqId
+ " div.ui-picklist-target-controls .ui-picklist-button-move-top")
.click(function() {
a.moveTop(a.targetList);
});
$(
this.jqId
+ " div.ui-picklist-target-controls .ui-picklist-button-move-down")
.click(function() {
a.moveDown(a.targetList);
});
$(
this.jqId
+ " div.ui-picklist-target-controls .ui-picklist-button-move-bottom")
.click(function() {
a.moveBottom(a.targetList);
});
}
};
}
};
Glassfish 3.1.2.2 build 5
JSF Mojarra 2.1.26
PrimeFaces 5.1
Google Chrome 38.0.2125.104
Everton Bianchini
JSF Mojarra 2.1.26
PrimeFaces 5.1
Google Chrome 38.0.2125.104
Everton Bianchini
Hi ebianchini! This solution didn't work for me :/ebianchini wrote:Hi ch0x. You can use this javascript snippet to fix the bug, if you don't want to update the PrimeFaces.chr0x wrote:Hi! I'm facing the same problem here with these buttons. There's something I can do to fix the Move UP and Move DOWN buttons for the picklist?
You have to call fixPickList on document ready.Code: Select all
fixPickList = function() { if (typeof PrimeFaces.widget.PickList != 'undefined') { PrimeFaces.widget.PickList.prototype.bindButtonEvents = function() { var a = this; PrimeFaces.skinButton(this.jq.find(".ui-button")); $(this.jqId + " .ui-picklist-button-add").click(function() { a.add(); }); $(this.jqId + " .ui-picklist-button-add-all").click(function() { a.addAll(); }); $(this.jqId + " .ui-picklist-button-remove").click(function() { a.remove(); }); $(this.jqId + " .ui-picklist-button-remove-all").click(function() { a.removeAll(); }); if (this.cfg.showSourceControls) { $( this.jqId + " div.ui-picklist-source-controls .ui-picklist-button-move-up") .click(function() { a.moveUp(a.sourceList); }); $( this.jqId + " div.ui-picklist-source-controls .ui-picklist-button-move-top") .click(function() { a.moveTop(a.sourceList); }); $( this.jqId + " div.ui-picklist-source-controls .ui-picklist-button-move-down") .click(function() { a.moveDown(a.sourceList); }); $( this.jqId + " div.ui-picklist-source-controls .ui-picklist-button-move-bottom") .click(function() { a.moveBottom(a.sourceList); }); } if (this.cfg.showTargetControls) { $( this.jqId + " div.ui-picklist-target-controls .ui-picklist-button-move-up") .click(function() { a.moveUp(a.targetList); }); $( this.jqId + " div.ui-picklist-target-controls .ui-picklist-button-move-top") .click(function() { a.moveTop(a.targetList); }); $( this.jqId + " div.ui-picklist-target-controls .ui-picklist-button-move-down") .click(function() { a.moveDown(a.targetList); }); $( this.jqId + " div.ui-picklist-target-controls .ui-picklist-button-move-bottom") .click(function() { a.moveBottom(a.targetList); }); } }; } };
I think I made a mistake on the call method. Can you describe how you have called your function? I'm trying to call it directly via xhtml.
PS: If you could contact me via email I will be very grateful (I saw in your profile that you're from Brazil, me too). You can find my e-mail at my profile page.
PF 5.1 / JSF 2.1
-
- Posts: 22
- Joined: 06 May 2011, 15:45
- Location: São Paulo/Brazil
Code: Select all
customiseAutoComplete = function() {
if (typeof PrimeFaces.widget.AutoComplete != 'undefined') {
PrimeFaces.widget.AutoComplete.prototype.search = function(c) {
if (c === undefined || c === null) {
return
}
if (this.cfg.cache && this.cache[c]) {
this.panel.html(this.cache[c]);
this.showSuggestions(c);
return
}
if (!this.active) {
return
}
var d = this;
if (this.cfg.itemtip) {
this.itemtip.hide()
}
var b = {
source : this.id,
process : this.id,
update : this.id,
formId : this.cfg.formId,
onstart : function() {
$(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query');
},
oncomplete : function(xhr, args, status) {
$(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query');
},
onsuccess : function(g, e, f) {
PrimeFaces.ajax.Response.handle(g, e, f, {
widget : d,
handle : function(h) {
this.panel.html(h);
if (this.cfg.cache) {
this.cache[c] = h
}
this.showSuggestions(c)
}
});
return true
}
};
b.params = [ {
name : this.id + "_query",
value : c
} ];
if (this.hasBehavior("query")) {
var a = this.cfg.behaviors.query;
a.call(this, b)
} else {
PrimeFaces.ajax.AjaxRequest(b)
}
};
}
};
$(document).ready(function() {
fixPickList();
});
PS: I do prefer to talk here, so the solution will be available to all that can be searching for it.
Glassfish 3.1.2.2 build 5
JSF Mojarra 2.1.26
PrimeFaces 5.1
Google Chrome 38.0.2125.104
Everton Bianchini
JSF Mojarra 2.1.26
PrimeFaces 5.1
Google Chrome 38.0.2125.104
Everton Bianchini
Hi ebianchini, your workaround has solved my problem. Thanks! o/ebianchini wrote:Put this in a javascript file, add this file to your page and the problem must be gone.Code: Select all
customiseAutoComplete = function() { if (typeof PrimeFaces.widget.AutoComplete != 'undefined') { PrimeFaces.widget.AutoComplete.prototype.search = function(c) { if (c === undefined || c === null) { return } if (this.cfg.cache && this.cache[c]) { this.panel.html(this.cache[c]); this.showSuggestions(c); return } if (!this.active) { return } var d = this; if (this.cfg.itemtip) { this.itemtip.hide() } var b = { source : this.id, process : this.id, update : this.id, formId : this.cfg.formId, onstart : function() { $(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query'); }, oncomplete : function(xhr, args, status) { $(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query'); }, onsuccess : function(g, e, f) { PrimeFaces.ajax.Response.handle(g, e, f, { widget : d, handle : function(h) { this.panel.html(h); if (this.cfg.cache) { this.cache[c] = h } this.showSuggestions(c) } }); return true } }; b.params = [ { name : this.id + "_query", value : c } ]; if (this.hasBehavior("query")) { var a = this.cfg.behaviors.query; a.call(this, b) } else { PrimeFaces.ajax.AjaxRequest(b) } }; } }; $(document).ready(function() { fixPickList(); });
PS: I do prefer to talk here, so the solution will be available to all that can be searching for it.
PF 5.1 / JSF 2.1
it didnt solve my problem. i think still something missing in this lineebianchini wrote:Put this in a javascript file, add this file to your page and the problem must be gone.Code: Select all
customiseAutoComplete = function() { if (typeof PrimeFaces.widget.AutoComplete != 'undefined') { PrimeFaces.widget.AutoComplete.prototype.search = function(c) { if (c === undefined || c === null) { return } [b]if (this.cfg.cache && this.cache[c]) {[/b] this.panel.html(this.cache[c]); this.showSuggestions(c); return } if (!this.active) { return } var d = this; if (this.cfg.itemtip) { this.itemtip.hide() } var b = { source : this.id, process : this.id, update : this.id, formId : this.cfg.formId, onstart : function() { $(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query'); }, oncomplete : function(xhr, args, status) { $(PrimeFaces.escapeClientId(d.id)).toggleClass('ui-autocomplete-query'); }, onsuccess : function(g, e, f) { PrimeFaces.ajax.Response.handle(g, e, f, { widget : d, handle : function(h) { this.panel.html(h); if (this.cfg.cache) { this.cache[c] = h } this.showSuggestions(c) } }); return true } }; b.params = [ { name : this.id + "_query", value : c } ]; if (this.hasBehavior("query")) { var a = this.cfg.behaviors.query; a.call(this, b) } else { PrimeFaces.ajax.AjaxRequest(b) } }; } }; $(document).ready(function() { fixPickList(); });
PS: I do prefer to talk here, so the solution will be available to all that can be searching for it.
<script type="text/javascript">
customiseAutoComplete = function() {
...
};
$(document).ready(function() {
fixPickList();
});
</script>
error in this line
if (this.cfg.cache && this.cache[c]) {
IDEA 14.0.2
Java 1.6.0_45
Weblogic 12.1.3
Primefaces 5.1
Java 1.6.0_45
Weblogic 12.1.3
Primefaces 5.1
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests