다음 Primefaces 페이지와 컨트롤러가 있습니다.요소 유형 "p : dataList"와 연관된 속성 "pt : data-inset"의 접두사 "pt"가 바인드되지 않았습니다.
@ManagedBean(name = LikedItemsView.NAME)
@SessionScoped
public class LikedItemsView {
public static final String NAME = "likeditems";
public List<LikedItem> getLikedItems()
{
final LikedItem item1 = new LikedItem();
item1.setTitle("Product 1");
item1.setPrice(Money.of(CurrencyUnit.USD, 20));
item1.setUrl("http://google.com");
final LikedItem item2 = new LikedItem();
item2.setTitle("Product 2");
item2.setPrice(Money.of(CurrencyUnit.USD, 30));
item2.setUrl("http://yandex.ru");
final List<LikedItem> items = new LinkedList<LikedItem>();
items.add(item1);
items.add(item2);
return items;
}
}
내가 페이지에 액세스 할 때, 나는 오류 다음 얻을
페이지
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pm="http://primefaces.org/mobile">
<f:view renderKitId="PRIMEFACES_MOBILE"/>
<h:head>
</h:head>
<h:body id="body">
<pm:page id="page">
<pm:header title="MyProduct">
</pm:header>
<pm:content id="content">
<p:dataList value="#{likeditems.likedItems}" var="item" pt:data-inset="true" paginator="true" rows="5">
<f:facet name="header">
List of Cars
</f:facet>
<h:outputLink value="#{item.url}">
<h2>#{item.title}</h2>
<p>#{item.price}</p>
<p class="ui-li-aside"><strong>XXXX</strong></p>
</h:outputLink>
<f:facet name="footer">
List of Cars
</f:facet>
</p:dataList>
<p:outputLabel
id="priceHint"
value="..."
cache="false"/>
</pm:content>
<pm:footer title="m.MyProduct.info"></pm:footer>
</pm:page>
</h:body>
</html>
컨트롤러 :
servlet.ServletException: Error Parsing /likeditems.xhtml: Error Traced[line: 31] The prefix "pt" for attribute "pt:data-inset" associated with an element type "p:dataList" is not bound.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
라인 (31)은 이것이다 :
<p:dataList value="#{likeditems.likedItems}" var="item" pt:data-inset="true" paginator="true" rows="5">
어떻게이 오류를 해결할 수 있습니까?
pt : data-inset 대신 데이터 인셋이되어야합니다. –
@PradyumnaSwain 도움이되었습니다. 귀하의 의견을 답변으로 제출해 주시면 동의하겠습니다. 감사! –
welcome buddy. 제 대답을 받아주세요. –