Picklist- Move buttons not working

UI Components for JSF
recusado
Posts: 4
Joined: 31 Oct 2014, 14:44

31 Oct 2014, 15:09

Hi, I'm trying to use a list of options, but the movement buttons are not working.

I checked in the showcase, but does not work well. (http://www.primefaces.org/showcase/ui/d ... List.xhtml)

Could someone provide an example of how to use these buttons?

The following code:
XHTML:

Code: Select all

		<p:pickList id="plColumnsCarTable" value="#{dataView.columnsCarsTable}" var="column" converter="columnCarModelConvert"
			itemValue="#{column.property}" itemLabel="#{column.header}" showTargetControls="true">
			<p:ajax event="transfer" listener="#{dataView.onTransfer}" />
		</p:pickList>
ManagedBean

Code: Select all

	
        private DualListModel<ColumnCarTableModel> columnsCarsTable;

	@PostConstruct
	public void init() {
		this.addDualListCarsTable();

	}

	private void addDualListCarsTable() {
		List<ColumnCarTableModel> source = new ArrayList<ColumnCarTableModel>();
		List<ColumnCarTableModel> target = new ArrayList<ColumnCarTableModel>();

		source.add(new ColumnCarTableModel("id"));
		source.add(new ColumnCarTableModel("year"));
		source.add(new ColumnCarTableModel("brand"));
		source.add(new ColumnCarTableModel("color"));
		source.add(new ColumnCarTableModel("sold"));
		source.add(new ColumnCarTableModel("price"));

		this.columnsCarsTable = new DualListModel<ColumnCarTableModel>(source, target);
	}

	public void onTransfer(TransferEvent event) {

	}
I appreciate everyone's attention

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

31 Oct 2014, 16:52

The buttons in the showcase works well for me in several FF versions from 26 to recent

and please remove the duplicate post...

recusado
Posts: 4
Joined: 31 Oct 2014, 14:44

31 Oct 2014, 18:20

kukeltje wrote:The buttons in the showcase works well for me in several FF versions from 26 to recent

and please remove the duplicate post...
Good Afternoon, I appreciate your answer.
I already removed the duplicate post.

But, in the showcase the buttons not working. Maybe I did not describe the problem clearly.

The add buttons and remove buttons working well in showcase, but de move buttons (down, up, first and last) not working.

If you have a working example, please introduce me.

Again thank you for your attention and the attention of all who come to help.

PS: Below image with highlighted buttons for print taken from primafaces own showcase.
Link for the image: justpaste.it/hsd6

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

31 Oct 2014, 23:08

The up-down buttons are indeed not working for me if ff 33 mobile. Will check other versions tomorrow

recusado
Posts: 4
Joined: 31 Oct 2014, 14:44

03 Nov 2014, 12:50

OK.

Thanks for your attention.

bjoern
Posts: 9
Joined: 28 Jul 2014, 15:52

03 Nov 2014, 13:22

Seems to be a bug in PF 5.1.

PF 5.0 used a table to render the picklist.
PF 5.1 uses divs instead of the table.

I patched picklist.js to fix it for me.

The old code is:

Code: Select all

if(this.cfg.showSourceControls) {
    $(this.jqId + ' td.ui-picklist-source-controls .ui-picklist-button-move-up').click(function() {_self.moveUp(_self.sourceList);});
    $(this.jqId + ' td.ui-picklist-source-controls .ui-picklist-button-move-top').click(function() {_self.moveTop(_self.sourceList);});
    $(this.jqId + ' td.ui-picklist-source-controls .ui-picklist-button-move-down').click(function() {_self.moveDown(_self.sourceList);});
    $(this.jqId + ' td.ui-picklist-source-controls .ui-picklist-button-move-bottom').click(function() {_self.moveBottom(_self.sourceList);});
}

if(this.cfg.showTargetControls) {
    $(this.jqId + ' td.ui-picklist-target-controls .ui-picklist-button-move-up').click(function() {_self.moveUp(_self.targetList);});
    $(this.jqId + ' td.ui-picklist-target-controls .ui-picklist-button-move-top').click(function() {_self.moveTop(_self.targetList);});
    $(this.jqId + ' td.ui-picklist-target-controls .ui-picklist-button-move-down').click(function() {_self.moveDown(_self.targetList);});
    $(this.jqId + ' td.ui-picklist-target-controls .ui-picklist-button-move-bottom').click(function() {_self.moveBottom(_self.targetList);});
}
I replaced td.ui-picklist-source-controls with div.ui-picklist-source-controls and td.ui-picklist-target-controls with div.ui-picklist-target-controls:

Code: Select all

        if(this.cfg.showSourceControls) {
            $(this.jqId + ' div.ui-picklist-source-controls .ui-picklist-button-move-up').click(function() {_self.moveUp(_self.sourceList);});
            $(this.jqId + ' div.ui-picklist-source-controls .ui-picklist-button-move-top').click(function() {_self.moveTop(_self.sourceList);});
            $(this.jqId + ' div.ui-picklist-source-controls .ui-picklist-button-move-down').click(function() {_self.moveDown(_self.sourceList);});
            $(this.jqId + ' div.ui-picklist-source-controls .ui-picklist-button-move-bottom').click(function() {_self.moveBottom(_self.sourceList);});
        }

        if(this.cfg.showTargetControls) {
            $(this.jqId + ' div.ui-picklist-target-controls .ui-picklist-button-move-up').click(function() {_self.moveUp(_self.targetList);});
            $(this.jqId + ' div.ui-picklist-target-controls .ui-picklist-button-move-top').click(function() {_self.moveTop(_self.targetList);});
            $(this.jqId + ' div.ui-picklist-target-controls .ui-picklist-button-move-down').click(function() {_self.moveDown(_self.targetList);});
            $(this.jqId + ' div.ui-picklist-target-controls .ui-picklist-button-move-bottom').click(function() {_self.moveBottom(_self.targetList);});
        }
Last edited by bjoern on 03 Dec 2014, 13:09, edited 1 time in total.
PF 5.3, JSF 2.1

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

03 Nov 2014, 16:21

Thanks for looking into this. Please file an issue

ebianchini
Posts: 22
Joined: 06 May 2011, 15:45
Location: São Paulo/Brazil

06 Nov 2014, 15:22

As I faced this problem today and I couldn't find an issue filed about it, I've opened one Issue 7620 - PickList source/target buttons doesn't work
Glassfish 3.1.2.2 build 5
JSF Mojarra 2.1.26
PrimeFaces 5.1
Google Chrome 38.0.2125.104

Everton Bianchini

chr0x
Posts: 4
Joined: 20 Nov 2014, 03:56
Location: Vitória, Brazil

25 Nov 2014, 15:17

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?
PF 5.1 / JSF 2.1

chr0x
Posts: 4
Joined: 20 Nov 2014, 03:56
Location: Vitória, Brazil

25 Nov 2014, 15:21

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?
PF 5.1 / JSF 2.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 76 guests