Fórumok

How to use input-move-boxes?

thumbnail
Andrej Litowka, módosítva 13 év-val korábban

How to use input-move-boxes?

Junior Member Bejegyzések: 79 Csatlakozás dátuma: 2010.06.30. Legújabb bejegyzések
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, módosítva 13 év-val korábban

RE: How to use input-move-boxes?

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2009.11.06. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: How to use input-move-boxes?

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.07.07. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: How to use input-move-boxes?

Junior Member Bejegyzések: 79 Csatlakozás dátuma: 2010.06.30. Legújabb bejegyzések
Hi Laila,

what is toList? You should post the complete code.
thumbnail
Mohammed Azam, módosítva 12 év-val korábban

RE: How to use input-move-boxes?

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2009.11.06. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: How to use input-move-boxes?

Junior Member Bejegyzések: 35 Csatlakozás dátuma: 2011.12.24. Legújabb bejegyzések
this does not work......
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: How to use input-move-boxes?

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
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