Forum

Accueil » Alloy UI » English

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
How to use liferay-ui:input-move-boxes ?? jam dah 19 août 2014 04:51
RE: How to use liferay-ui:input-move-boxes ?? Pankaj Kathiriya 19 août 2014 05:09
RE: How to use liferay-ui:input-move-boxes ?? jam dah 19 août 2014 06:22
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 21 août 2014 01:22
RE: How to use liferay-ui:input-move-boxes ?? jam dah 21 août 2014 02:10
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 21 août 2014 04:10
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 04:06
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 22 août 2014 04:21
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 04:48
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 22 août 2014 05:58
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 05:58
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 22 août 2014 06:06
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 06:09
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 25 août 2014 03:11
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 06:29
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 22 août 2014 07:31
RE: How to use liferay-ui:input-move-boxes ?? jam dah 22 août 2014 07:29
RE: How to use liferay-ui:input-move-boxes ?? jam dah 23 août 2014 14:46
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 24 août 2014 22:37
RE: How to use liferay-ui:input-move-boxes ?? jam dah 25 août 2014 02:06
RE: How to use liferay-ui:input-move-boxes ?? Mayur Patel 25 août 2014 03:17
jam dah
How to use liferay-ui:input-move-boxes ??
19 août 2014 04:51
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

Hi every body,
I am newer in fileray portal. I want to user input-move-boxes in my portlet.
I have difficulty to retreive data from input-move-boxes.
In the leftBox, i have many items, i want to choose 2 or 3 items, so in the rightBox i will have those items as i choose.
The problem is that i can retreive only the last one.
the view.jsp:
 1<% 
 2          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
 3          leftBox.add(new KeyValuePair("channel1", "Channel1"));
 4          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
 5          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
 6          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
 7          leftBox.add(new KeyValuePair("channel5", "Channel5"));
 8         
 9         %> 
10      <liferay-ui:input-move-boxes 
11            leftBoxName="leftBox" 
12          leftTitle="Available channels" 
13          leftList="<%=leftBox%>" 
14          leftReorder="true" 
15          rightBoxName="rightBox" 
16          rightTitle="Selected channels" 
17          rightList="<%=rightBox%>" 
18          rightReorder="true"   
19       />   

In my processAction method, i try this code
1String[] rightBox = ParamUtil.getParameterValues(actionRequest, "rightBox");

1System.out.println(rightBox.length);
the result is 1 always.
Please, how can i retreive all the data from teh right box?
Pankaj Kathiriya
RE: How to use liferay-ui:input-move-boxes ??
19 août 2014 05:09
Réponse

Pankaj Kathiriya

Rang: Liferay Master

Publications: 721

Date d'inscription: 4 août 2010

Publications Récentes

The items on right box should be selected, then only you will get all records from rightbox.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
19 août 2014 06:22
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

thanks for you reply
then only you will get all records from rightbox.

how can i recover all records ?
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
21 août 2014 01:22
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Hi Jam,

Please refer this blog.

Thanks.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
21 août 2014 02:10
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

thanks for your reply, but it didn't work
look what i did:
view.jsp
 1<%
 2/**
 3 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 4 *
 5 * This library is free software; you can redistribute it and/or modify it under
 6 * the terms of the GNU Lesser General Public License as published by the Free
 7 * Software Foundation; either version 2.1 of the License, or (at your option)
 8 * any later version.
 9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 */
15%>
16
17<%@ include file="/init.jsp" %>
18<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
19
20<portlet:defineObjects />
21<portlet:actionURL var="distURL">
22    <portlet:param name="mvcPath" value="/view.jsp" />
23</portlet:actionURL>
24
25<aui:form name ="fm" action="<%= distURL %>" method="post">
26         
27      <aui:select name="selectPlayer" label="Select a Player">
28            <aui:option value="player1" > Player1</aui:option>
29            <aui:option value="player2" > Player2</aui:option>
30            <aui:option value="player3" > Player3</aui:option>
31            <aui:option value="player4" > Player4</aui:option>
32            <aui:option value="player5" > Player5</aui:option>
33            <aui:option value="player6" > Player6</aui:option>
34     </aui:select>   
35
36        <% 
37          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
38          leftBox.add(new KeyValuePair("channel1", "Channel1"));
39          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
40          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
41          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
42          leftBox.add(new KeyValuePair("channel5", "Channel5"));
43         
44         %> 
45      <liferay-ui:input-move-boxes 
46            leftBoxName="leftBox" 
47          leftTitle="Available channels" 
48          leftList="<%=leftBox%>" 
49          leftReorder="true" 
50          rightBoxName="rightBox" 
51          rightTitle="Selected channels" 
52          rightList="<%=rightBox%>" 
53          rightReorder="true"   
54       />   
55       
56     <aui:input type="hidden" name="hiddenRightFields"/>
57
58     <center><aui:button type="submit" value="Valider"  onclick="<portlet:namespace />submitForm();" cssClass=".submitButton"/> </center>    
59</aui:form>
60
61<aui:script>
62Liferay.provide(
63window,
64'<portlet:namespace />submitForm',
65function() {
66document.fm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.fm.<portlet:namespace />rightBox);
67document.fm.submit();
68
69}, ['liferay-util-list-fields']
70);
71</aui:script>


my process action
 1package com.amms.portlets;
 2
 3import java.io.IOException;
 4import java.util.List;
 5import java.io.File;
 6
 7import javax.portlet.ActionRequest;
 8import javax.portlet.ActionResponse;
 9import javax.portlet.PortletException;
10import javax.xml.parsers.ParserConfigurationException;
11import javax.xml.transform.TransformerException;
12import javax.xml.transform.TransformerFactoryConfigurationError;
13import javax.xml.xpath.XPathExpressionException;
14
15import org.xml.sax.SAXException;
16
17import com.liferay.portal.kernel.exception.PortalException;
18import com.liferay.portal.kernel.exception.SystemException;
19import com.liferay.portal.kernel.repository.model.FileEntry;
20import com.liferay.portal.kernel.util.KeyValuePair;
21import com.liferay.portal.kernel.util.ParamUtil;
22import com.liferay.portal.kernel.util.StringUtil;
23import com.liferay.portal.kernel.util.WebKeys;
24import com.liferay.portal.model.PortletPreferences;
25import com.liferay.portal.theme.ThemeDisplay;
26import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;
27import com.liferay.util.bridges.mvc.MVCPortlet;
28import com.netcenter.tools.NetcenterTools;
29import com.netcenter.tools.ParserXml;
30
31
32public class DistrbutionPortlet extends MVCPortlet{
33
34     @Override
35        public void processAction(
36            ActionRequest actionRequest, ActionResponse actionResponse)
37            throws IOException, PortletException {
38         
39            String selectPlayer = ParamUtil.getString(actionRequest, "selectPlayer");
40            //String[] rightBox = ParamUtil.getParameterValues(actionRequest, "rightBox");
41            String rightBox = ParamUtil.getString(actionRequest, "rightBox");
42            //String toList = ListingUtils.toggleCamelCaseWords(ParamUtil.getString(actionRequest,"hiddenLeftFields"), false);
43            String toList = ParamUtil.getString(actionRequest, "hiddenRightFields");
44                  
45            System.out.println("-------------------Parameters--------------------"+toList);
46            System.out.println("-------------------------------------------------");
47            System.out.println(selectPlayer);
48            System.out.println(rightBox);
49            
50          
51            
52            ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
53            if((selectPlayer != null)&&(rightBox != null))
54            {
55                FileEntry fileEntry;
56                try {
57                    fileEntry = DLAppServiceUtil.getFileEntry(themeDisplay.getLayout().getGroupId(), 0, "Distribution");
58                    String pathFileDestion = NetcenterTools.getDLFileAbsPath(fileEntry);
59                     File file = new File(pathFileDestion);
60                     System.out.println("-------------------File path--------------------");
61                     System.out.println(pathFileDestion);
62                     
63                     ParserXml.appendChildToChannel(file, rightBox, Long.valueOf("50"), Long.valueOf("50") );
64                     
65                     
66                } catch (PortalException e) {
67                    e.printStackTrace();
68                } catch (SystemException e) {
69                    e.printStackTrace();
70                } catch (NumberFormatException e) {
71                    e.printStackTrace();
72                } catch (XPathExpressionException e) {
73                    e.printStackTrace();
74                } catch (SAXException e) {
75                    e.printStackTrace();
76                } catch (TransformerFactoryConfigurationError e) {
77                    e.printStackTrace();
78                } catch (TransformerException e) {
79                    e.printStackTrace();
80                } catch (ParserConfigurationException e) {
81                    e.printStackTrace();
82                } 
83            }      
84            super.processAction(actionRequest, actionResponse);
85        }
86   
87}

what's wrong in my code ?? Thanks
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
21 août 2014 04:10
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Hi Jam,

If you are using <aui:form> then you need to modify below code in JSP,

1document.<portlet:namespace />fm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.<portlet:namespace />fm.<portlet:namespace />rightBox);
2document.<portlet:namespace />fm.submit();


This should work emoticon
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 04:06
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

unfortunately, this didn't work for me
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 04:21
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Hi Jam,

Please refer below jsp in which i'm using the same component,

 1<%@page import="java.util.List"%>
 2<%@page import="java.util.ArrayList"%>
 3<%@ include file="init.jsp" %>
 4
 5<portlet:actionURL var="saveFieldsURL">
 6    <portlet:param name="tools" value="LISTING"/>
 7    <portlet:param name="action" value="saveFieldsURL"/>
 8    <portlet:param name="isEdit" value="${isEdit}"/>
 9</portlet:actionURL>
10<form method="post" action="${saveFieldsURL}" id="columnViewPopupFrm" name="columnViewPopupFrm">
11    <input type="hidden" name="listingState" id="<portlet:namespace />listingState" value="${listingState}" />
12    <header><div class="dialog-header text-center"><h4>Drag to Add or Reorder Columns</h4></div></header>
13    <section>
14        <div class="dialog-body">
15            <div id="dd-contain" class="aui-w100 aui-helper-clearfix"> 
16            <liferay-ui:input-move-boxes rightList="${displayFields}" rightTitle="Visible Columns" leftBoxName="allFieldsList" leftList="${hiddenFields}" rightBoxName="displayFieldsList" leftTitle="All Columns" leftReorder="false" rightReorder="true" cssClass="custom-move-boxes" />
17                <input name="<portlet:namespace />hiddenLeftFields" id="<portlet:namespace />hiddenLeftFields" type="hidden" />
18                <input name="<portlet:namespace />hiddenRightFields" id="<portlet:namespace />hiddenRightFields" type="hidden" />
19            </div>
20        </div>
21    </section>
22    <footer>
23        <div class="aui-w100 aui-helper-clearfix dialog-footer">
24            <div class="aui-column-first aui-column">
25                <a href="#" class="cancel" onclick="<portlet:namespace/>columnDialog.close();<portlet:namespace/>columnDialog.destroy();">Cancel</a>
26            </div>
27            <div class="aui-column-last aui-column">
28                <a href="#" onclick="<portlet:namespace />submitForm();" class="save">Save</a>
29            </div>
30        </div>
31    </footer>
32</form>
33
34<aui:script>
35Liferay.provide(
36window,
37'<portlet:namespace />submitForm',
38function() {
39document.columnViewPopupFrm.<portlet:namespace />hiddenLeftFields.value = Liferay.Util.listSelect(document.columnViewPopupFrm.<portlet:namespace />allFieldsList);
40document.columnViewPopupFrm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.columnViewPopupFrm.<portlet:namespace />displayFieldsList);
41document.columnViewPopupFrm.submit();
42}, ['liferay-util-list-fields']
43);
44</aui:script>


Thanks.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 04:48
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

Thanks for your replies and for your time that you spent.
but really i got nothing, please can you look what's wrong in my code.
Can you test it?
view.jsp
 1<%
 2/**
 3 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 4 *
 5 * This library is free software; you can redistribute it and/or modify it under
 6 * the terms of the GNU Lesser General Public License as published by the Free
 7 * Software Foundation; either version 2.1 of the License, or (at your option)
 8 * any later version.
 9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 */
15%>
16
17<%@ include file="/init.jsp" %>
18<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
19
20<portlet:defineObjects />
21<portlet:actionURL var="distURL">
22    <portlet:param name="mvcPath" value="/view.jsp" />
23</portlet:actionURL>
24
25<aui:form name ="<portlet:namespace />fm" action="<%= distURL %>" method="post">
26         
27      <aui:select name="selectPlayer" label="Select a Player">
28            <aui:option value="player1" > Player1</aui:option>
29            <aui:option value="player2" > Player2</aui:option>
30            <aui:option value="player3" > Player3</aui:option>
31            <aui:option value="player4" > Player4</aui:option>
32            <aui:option value="player5" > Player5</aui:option>
33            <aui:option value="player6" > Player6</aui:option>
34     </aui:select>   
35
36        <% 
37          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
38          leftBox.add(new KeyValuePair("channel1", "Channel1"));
39          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
40          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
41          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
42          leftBox.add(new KeyValuePair("channel5", "Channel5"));
43         
44         %> 
45      <liferay-ui:input-move-boxes 
46            leftBoxName="leftBox" 
47          leftTitle="Available channels" 
48          leftList="<%=leftBox%>" 
49          leftReorder="true" 
50          rightBoxName="rightBox" 
51          rightTitle="Selected channels" 
52          rightList="<%=rightBox%>" 
53          rightReorder="true"   
54       />   
55     <aui:input type="hidden" name="<portlet:namespace />hiddenRightFields" id="<portlet:namespace />hiddenRightFields"/>
56     <center><aui:button type="submit" value="Valider"  onclick="<portlet:namespace />submitForm();" cssClass=".submitButton"/> </center>    
57</aui:form>
58
59<aui:script>
60Liferay.provide(
61window,
62'<portlet:namespace />submitForm',
63function() {
64document.fm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.fm.<portlet:namespace />rightBox);
65document.fm.submit();
66
67}, ['liferay-util-list-fields']
68);
69
70</aui:script>

java code
 1package com.amms.portlets;
 2
 3import java.io.IOException;
 4import java.util.List;
 5import java.io.File;
 6
 7import javax.portlet.ActionRequest;
 8import javax.portlet.ActionResponse;
 9import javax.portlet.PortletException;
10import javax.xml.parsers.ParserConfigurationException;
11import javax.xml.transform.TransformerException;
12import javax.xml.transform.TransformerFactoryConfigurationError;
13import javax.xml.xpath.XPathExpressionException;
14
15import org.xml.sax.SAXException;
16
17import com.liferay.portal.kernel.exception.PortalException;
18import com.liferay.portal.kernel.exception.SystemException;
19import com.liferay.portal.kernel.repository.model.FileEntry;
20import com.liferay.portal.kernel.util.KeyValuePair;
21import com.liferay.portal.kernel.util.ParamUtil;
22import com.liferay.portal.kernel.util.StringUtil;
23import com.liferay.portal.kernel.util.WebKeys;
24import com.liferay.portal.model.PortletPreferences;
25import com.liferay.portal.theme.ThemeDisplay;
26import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;
27import com.liferay.util.bridges.mvc.MVCPortlet;
28import com.netcenter.tools.NetcenterTools;
29import com.netcenter.tools.ParserXml;
30
31
32public class DistrbutionPortlet extends MVCPortlet{
33
34     @Override
35        public void processAction(
36            ActionRequest actionRequest, ActionResponse actionResponse)
37            throws IOException, PortletException {
38         
39            String selectPlayer = ParamUtil.getString(actionRequest, "selectPlayer");
40            //String[] rightBox = ParamUtil.getParameterValues(actionRequest, "rightBox");
41            String rightBox = ParamUtil.getString(actionRequest, "rightBox");
42            //String toList = ListingUtils.toggleCamelCaseWords(ParamUtil.getString(actionRequest,"hiddenLeftFields"), false);
43            String toList = ParamUtil.getString(actionRequest, "hiddenRightFields");
44               
45            System.out.println("-------------------Parameters--------------------"+toList);
46            System.out.println("-------------------------------------------------");
47            System.out.println(selectPlayer);
48            System.out.println(rightBox);
49            
50          
51            
52            ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
53            if((selectPlayer != null)&&(rightBox != null))
54            {
55                FileEntry fileEntry;
56                try {
57                    fileEntry = DLAppServiceUtil.getFileEntry(themeDisplay.getLayout().getGroupId(), 0, "Distribution");
58                    String pathFileDestion = NetcenterTools.getDLFileAbsPath(fileEntry);
59                     File file = new File(pathFileDestion);
60                     System.out.println("-------------------File path--------------------");
61                     System.out.println(pathFileDestion);
62                     
63                     ParserXml.appendChildToChannel(file, rightBox, Long.valueOf("50"), Long.valueOf("50") );
64                     
65                     
66                } catch (PortalException e) {
67                    e.printStackTrace();
68                } catch (SystemException e) {
69                    e.printStackTrace();
70                } catch (NumberFormatException e) {
71                    e.printStackTrace();
72                } catch (XPathExpressionException e) {
73                    e.printStackTrace();
74                } catch (SAXException e) {
75                    e.printStackTrace();
76                } catch (TransformerFactoryConfigurationError e) {
77                    e.printStackTrace();
78                } catch (TransformerException e) {
79                    e.printStackTrace();
80                } catch (ParserConfigurationException e) {
81                    e.printStackTrace();
82                } 
83            }      
84            super.processAction(actionRequest, actionResponse);
85        }
86}

thanks a lot
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 05:58
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Hi Jam,

I've modified my code with whatever you want and I'm able to get values,

Please try below code. It's working fine emoticon

 1<form name ="columnViewPopupFrm" action="<%= saveFieldsURL %>" method="post" id="columnViewPopupFrm">
 2         
 3      <aui:select name="selectPlayer" label="Select a Player">
 4            <aui:option value="player1" > Player1</aui:option>
 5            <aui:option value="player2" > Player2</aui:option>
 6            <aui:option value="player3" > Player3</aui:option>
 7            <aui:option value="player4" > Player4</aui:option>
 8            <aui:option value="player5" > Player5</aui:option>
 9            <aui:option value="player6" > Player6</aui:option>
10     </aui:select>   
11
12        <% 
13          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
14          leftBox.add(new KeyValuePair("channel1", "Channel1"));
15          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
16          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
17          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
18          leftBox.add(new KeyValuePair("channel5", "Channel5"));
19          rightBox.add(new KeyValuePair("channel5", "Channel5"));
20         
21         %> 
22      <liferay-ui:input-move-boxes 
23            leftBoxName="leftBox" 
24          leftTitle="Available channels" 
25          leftList="<%=leftBox%>" 
26          leftReorder="true" 
27          rightBoxName="rightBox" 
28          rightTitle="Selected channels" 
29          rightList="<%=rightBox%>" 
30          rightReorder="true"   
31       />   
32      
33     <input type="hidden" name="<portlet:namespace />hiddenRightFields" id="<portlet:namespace />hiddenRightFields"/>
34     <a href="#" onclick="<portlet:namespace />submitForm();" class="save">Save</a>    
35</form>
36
37<aui:script>
38Liferay.provide(
39window,
40'<portlet:namespace />submitForm',
41function() {
42document.columnViewPopupFrm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.columnViewPopupFrm.<portlet:namespace />rightBox);
43document.columnViewPopupFrm.submit();
44
45}, ['liferay-util-list-fields']
46);
47
48</aui:script>


Thanks.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 05:58
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

Really, thanks for your help.
I didn't know what's the matter, but it still not working for me
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 06:06
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Use simple form instead of AlloyUI form and remove <portlet:namespace /> while submitting form as i've given in last post. Replace code which I've sent & It should work.

In Java class,

1String toList = ParamUtil.getString(actionRequest, "hiddenRightFields");
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 06:09
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

i did, but nothing
view.jsp
 1<%
 2/**
 3 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 4 *
 5 * This library is free software; you can redistribute it and/or modify it under
 6 * the terms of the GNU Lesser General Public License as published by the Free
 7 * Software Foundation; either version 2.1 of the License, or (at your option)
 8 * any later version.
 9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 */
15%>
16
17<%@ include file="/init.jsp" %>
18<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
19
20<portlet:defineObjects />
21<portlet:actionURL var="distURL">
22    <portlet:param name="mvcPath" value="/view.jsp" />
23</portlet:actionURL>
24
25<form  id="fm" name ="fm" action="<%= distURL %>" method="post">
26         
27      <aui:select name="selectPlayer" label="Select a Player">
28            <aui:option value="player1" > Player1</aui:option>
29            <aui:option value="player2" > Player2</aui:option>
30            <aui:option value="player3" > Player3</aui:option>
31            <aui:option value="player4" > Player4</aui:option>
32            <aui:option value="player5" > Player5</aui:option>
33            <aui:option value="player6" > Player6</aui:option>
34     </aui:select>   
35
36        <% 
37          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
38          leftBox.add(new KeyValuePair("channel1", "Channel1"));
39          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
40          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
41          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
42          leftBox.add(new KeyValuePair("channel5", "Channel5"));
43          rightBox.add(new KeyValuePair("channel5", "Channel5"));
44         
45         %> 
46      <liferay-ui:input-move-boxes 
47            leftBoxName="leftBox" 
48          leftTitle="Available channels" 
49          leftList="<%=leftBox%>" 
50          leftReorder="true" 
51          rightBoxName="rightBox" 
52          rightTitle="Selected channels" 
53          rightList="<%=rightBox%>" 
54          rightReorder="true"
55          cssClass="custom-move-boxes" 
56       />   
57      
58     <input type="hidden"  name="<portlet:namespace />hiddenRightFields" id="<portlet:namespace />hiddenRightFields"/>
59     <center><aui:button type="submit" value="Valider"  onclick="<portlet:namespace />submitForm();" /> </center>    
60<form>
61
62<aui:script>
63Liferay.provide(
64window,
65'<portlet:namespace />submitForm',
66function() {
67document.fm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.fm.<portlet:namespace />rightBox);
68document.fm.submit();
69
70}, ['liferay-util-list-fields']
71);
72
73</aui:script>
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
25 août 2014 03:11
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Hi Jam,

If you are using liferay version 6.2 then refer below blog,

http://mpatel3.blogspot.in/2014/08/liferay-62-changes-portlet-namespace-in.html

Thanks.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 06:29
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

yes, i am using liferay6.2
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 07:31
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Have you tried below code?

1String toList = actionRequest.getParameter(actionResponse.getNamespace()+"hiddenRightFields");

or
you can set the requires-namespaced-parameters setting to false in your liferay-portlet.xml

1<requires-namespaced-parameters>false</requires-namespaced-parameters>


There should be some version specific issue because i'm using liferay 6.1 GA3 and it's working fine.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
22 août 2014 07:29
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

i am using lifreray6.2ga2, i tried to add <requires-namespaced-parameters>false</requires-namespaced-parameters> to liferay-portal.xml. but nothing work.
Thanks
view.jsp
 1<%
 2/**
 3 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 4 *
 5 * This library is free software; you can redistribute it and/or modify it under
 6 * the terms of the GNU Lesser General Public License as published by the Free
 7 * Software Foundation; either version 2.1 of the License, or (at your option)
 8 * any later version.
 9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 */
15%>
16
17<%@ include file="/init.jsp" %>
18<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
19
20<portlet:defineObjects />
21
22<portlet:actionURL var="distURL">
23    <portlet:param name="mvcPath" value="/view.jsp" />
24</portlet:actionURL>
25
26<form  id="fm" name ="fm" action="<%= distURL %>" method="post">
27         
28      <aui:select name="selectPlayer" label="Select a Player">
29            <aui:option value="player1" > Player1</aui:option>
30            <aui:option value="player2" > Player2</aui:option>
31            <aui:option value="player3" > Player3</aui:option>
32            <aui:option value="player4" > Player4</aui:option>
33            <aui:option value="player5" > Player5</aui:option>
34            <aui:option value="player6" > Player6</aui:option>
35     </aui:select>   
36
37        <% 
38          List leftBox = new ArrayList(), rightBox = new ArrayList(); 
39          leftBox.add(new KeyValuePair("channel1", "Channel1"));
40          leftBox.add(new KeyValuePair("channel2", "Channel2")); 
41          leftBox.add(new KeyValuePair("channel3", "Channel3")); 
42          leftBox.add(new KeyValuePair("channel4", "Channel4")); 
43          leftBox.add(new KeyValuePair("channel5", "Channel5"));         
44         %> 
45      <liferay-ui:input-move-boxes 
46            leftBoxName="leftBox" 
47          leftTitle="Available channels" 
48          leftList="<%=leftBox%>" 
49          leftReorder="true" 
50          rightBoxName="rightBox" 
51          rightTitle="Selected channels" 
52          rightList="<%=rightBox%>" 
53          rightReorder="true"
54          cssClass="custom-move-boxes" 
55       />         
56     <aui:input type="hidden"  name="hiddenRightFields" id="hiddenRightFields"/>
57     <center><aui:button type="submit" value="Valider"  onclick="<portlet:namespace />submitForm();" /> </center>    
58</form>
59
60<aui:script>
61Liferay.provide(
62window,
63'<portlet:namespace />submitForm',
64function() {
65document.fm.<portlet:namespace />hiddenRightFields.value = Liferay.Util.listSelect(document.fm.<portlet:namespace />rightBox);
66submitForm(document.<portlet:namespace />fm);
67
68}, ['liferay-util-list-fields']
69);
70
71</aui:script>

in the java code
1String toList = actionRequest.getParameter(actionResponse.getNamespace()+"hiddenRightFields");
jam dah
RE: How to use liferay-ui:input-move-boxes ??
23 août 2014 14:46
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

Thanks a lot for your help, it work now.
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
24 août 2014 22:37
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

What was the issue? can you please describe?

Thanks.
jam dah
RE: How to use liferay-ui:input-move-boxes ??
25 août 2014 02:06
Réponse

jam dah

Rang: New Member

Publications: 15

Date d'inscription: 13 août 2014

Publications Récentes

Hi, the issue was
1- with namespace, i am using liferay 6.2
1<requires-namespaced-parameters>false</requires-namespaced-parameters>

2- i forgot to clear project from eclipse
Thanks a lot Mayur.
Mayur Patel
RE: How to use liferay-ui:input-move-boxes ??
25 août 2014 03:17
Réponse

Mayur Patel

Rang: Expert

Publications: 357

Date d'inscription: 17 novembre 2010

Publications Récentes

Nice to hear from you Jamemoticon Happy Learning emoticon