留言板
select is not shown correctly.
veronica medeiros,修改在10 年前。
select is not shown correctly.
Regular Member 帖子: 112 加入日期: 14-2-18 最近的帖子
I have an array of strings and I would like each of the values of the string were an option select.
How to do it.
JAVA:
JSP:
Informed: unknown tag c:forEach
Thank you
How to do it.
JAVA:
String aaaa3 = "Ankit;Bohra;Xyz";
String aaaa4 [] = aaaa3.split(";");
for (String aaaa5 : aaaa4){
teste= aaaa5;
renderRequest.setAttribute("teste", teste);
}
JSP:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
<portlet:defineobjects />
<aui:select label="Teste" name="selectionStyle" id="selaaaa">
<c:foreach items="${teste}" var="teste">
<aui:option value="${teste}" label="${teste}" selected="${selaaaa == teste}" />
</c:foreach>
</aui:select>
Informed: unknown tag c:forEach
Thank you
Pankaj Kathiriya,修改在10 年前。
RE: select is not shown correctly.
Liferay Master 帖子: 722 加入日期: 10-8-5 最近的帖子
Provide jstl related jar dependency entries in liferay-plugin-package.properties of your plugin. It should resolve your issue.
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar,\
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar,\
veronica medeiros,修改在10 年前。
RE: select is not shown correctly.
Regular Member 帖子: 112 加入日期: 14-2-18 最近的帖子
I downloaded the dependencies on the site http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.2.0%20GA1/liferay-portal-dependencies-6.2.0-ce-ga1-20131101192857659.zip/download
But Eclipse does not accept my add these 3 jars: hsql.jar - portal-service.jar - portlet.jar
What did I do wrong?
Thank you
But Eclipse does not accept my add these 3 jars: hsql.jar - portal-service.jar - portlet.jar
What did I do wrong?
Thank you
veronica medeiros,修改在10 年前。
RE: select is not shown correctly.
Regular Member 帖子: 112 加入日期: 14-2-18 最近的帖子
Pankaj ... Within the JSP I need not tell something like:
<% @ Taglib uri = "http://liferay.com/tld/aui" prefix = "c"%>
Informing the prefix C forEach??
Thank you,
<% @ Taglib uri = "http://liferay.com/tld/aui" prefix = "c"%>
Informing the prefix C forEach??
Thank you,
Pankaj Kathiriya,修改在10 年前。
RE: select is not shown correctly.
Liferay Master 帖子: 722 加入日期: 10-8-5 最近的帖子
c:forEach is JSTL core tag, not AUI tag, so taglib declaration should be as below:
Regards
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
Regards
veronica medeiros,修改在10 年前。
RE: select is not shown correctly.
Regular Member 帖子: 112 加入日期: 14-2-18 最近的帖子
and the jars????
Hi Veronica,
You don't need to add any jars explicitly as required jars are already available in default bundle.(tomcat-7.0.40\webapps\ROOT\WEB-INF\lib\jstl-api.jar and tomcat-7.0.40\webapps\ROOT\WEB-INF\lib\jstl-impl.jar).
You just need to define dependency in your application and for this you can add below line in your liferay-plugin-package.properties.
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar
and in your jsp you just need to provide taglib declaration syntax like <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Hope this will help you to solve your problem.
Thanks,
Jatin Panchal
You don't need to add any jars explicitly as required jars are already available in default bundle.(tomcat-7.0.40\webapps\ROOT\WEB-INF\lib\jstl-api.jar and tomcat-7.0.40\webapps\ROOT\WEB-INF\lib\jstl-impl.jar).
You just need to define dependency in your application and for this you can add below line in your liferay-plugin-package.properties.
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar
and in your jsp you just need to provide taglib declaration syntax like <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Hope this will help you to solve your problem.
Thanks,
Jatin Panchal