Fórum

How to use input-move-boxes?

thumbnail
Andrej Litowka, modificado 13 Anos atrás.

How to use input-move-boxes?

Junior Member Postagens: 79 Data de Entrada: 30/06/10 Postagens Recentes
Hello all,

is ther any description or documentation for input-move-boxes? I have a list of users and would like let a portlet user to select which one should be displayed, but I'm not sure how the the nput-move-boxes work. The rightList is obviously my users' list. But how I have to define the left list and save settings?

Thanks and regards,
Andrej
thumbnail
mohammed azam, modificado 13 Anos atrás.

RE: How to use input-move-boxes?

Regular Member Postagens: 159 Data de Entrada: 06/11/09 Postagens Recentes
Hi,

Try this out in your jsp file. I am displaying the list of users on the left input box. and onsubmit the the right hand values are added to hidden variable "tolist" so that the values can be got in the action file....



<script type="text/javascript">
function onSubmit(){
	document.<portlet:namespace />fm1.<portlet:namespace />toList.value = Liferay.Util.listSelect(document.<portlet:namespace />fm1.<portlet:namespace />toList1);
	}
</script>

&lt;% int count = UserLocalServiceUtil.getUsersCount(); List<user> userList = UserLocalServiceUtil.getUsers(0,count); List leftList = new ArrayList(); List rightList = new ArrayList(); for (int k = 0; k &lt; userList.size(); k++) { User user = (User)userList.get(k); leftList.add(new KeyValuePair(String.valueOf(user.getUserId()), user.getScreenName())); } %&gt; <liferay-ui:input-move-boxes formName="fm1" leftTitle="User List" rightTitle="To List" leftBoxName="usersList" rightBoxName="toList1" leftList="<%= leftList %>" rightList="<%= rightList %>" /> <input type="hidden" name="<portlet:namespace />toList" value=""> <input type="submit" value="<liferay-ui:message key=" add-users">" onClick="onSubmit();" /&gt; </user>


Please do the necessary imports......


Hope this give you an understanding of the input-box
Laila Ir, modificado 12 Anos atrás.

RE: How to use input-move-boxes?

New Member Mensagem: 1 Data de Entrada: 07/07/11 Postagens Recentes
Hi Mohamed,
I try to get the values in my Action Class,

long[ ] toList = StringUtil.split(ParamUtil.getString(actionRequest, "toList"), 0L);
System.out.println("List length : "+toList.length);

but I got 0 emoticon
note: I'm bad in javaScript language.

Thanks and regards,
thumbnail
Andrej Litowka, modificado 12 Anos atrás.

RE: How to use input-move-boxes?

Junior Member Postagens: 79 Data de Entrada: 30/06/10 Postagens Recentes
Hi Laila,

what is toList? You should post the complete code.
thumbnail
Mohammed Azam, modificado 12 Anos atrás.

RE: How to use input-move-boxes?

Regular Member Postagens: 159 Data de Entrada: 06/11/09 Postagens Recentes
Laila Ir:
Hi Mohamed,
I try to get the values in my Action Class,

long[ ] toList = StringUtil.split(ParamUtil.getString(actionRequest, "toList"), 0L);
System.out.println("List length : "+toList.length);

but I got 0 emoticon
note: I'm bad in javaScript language.

Thanks and regards,



use it in this way and let me know.

String param = req.getParameter("toList");

    if (param != null &amp;&amp; param != "") {
                                        String[] temp = param.split(",");
}


The toList is a hidden variable
Sanket Gosavi, modificado 12 Anos atrás.

RE: How to use input-move-boxes?

Junior Member Postagens: 35 Data de Entrada: 24/12/11 Postagens Recentes
this does not work......
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: How to use input-move-boxes?

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Not too much documentation on liferay-ui, but may be worth to check the pages below:

http://docs.liferay.com/portal/6.1/taglibs/liferay-ui/input-move-boxes.html

http://code.google.com/p/liferaysamples/source/browse/trunk/sample-ui-taglibs-portlet/view.jsp?r=2