Re: How to get Parameter with prettyfaces?

Splash Forums PrettyFaces Users How to get Parameter with prettyfaces? Re: How to get Parameter with prettyfaces?

#20288

kency
Participant

Thank you Lincohn and chkal, i do following your suggest but get error, i post my code in first page followed

=========================================

<h:form>
<ui:repeat value="#{catController.allCate}" var="category">
<p:panel header="#{category.cateName}" style="font-size: 13px;border:0">

<h:panelGroup>

<ui:repeat value="#{category.subCatList}" var="subCat" >

<div id="css_vertical_menu">
<li>

<p:commandButton style="margin-top: 0px;margin-bottom: 5px;margin-left: 5px;background: #f2f5f7;border: #f2f5f7" value="#{subCat.subcatName}" action="#{catItemsListController.showDetailsSub(subCat)}" ajax="false">

<f:setPropertyActionListener value="#{item}" target="#{catItemsListController.sub}" />

</p:commandButton>

</li>
</div>

</ui:repeat>

</h:panelGroup>
</p:panel>
</ui:repeat>
</h:form>

========================================

in my code first page as you an see, i use command button pass parameter to method in action of commandButton.

and in my second page follow:

==================================

<p:panel style="margin-top: 45px;font-size: 12px" header="Danh mục #{catItemsListController.subDetails.subcatName}">
<!-- Form Register -->
<h:form id="formlist">
<p:growl id="displayMessage"/>
<p:dataGrid var="item" value="#{catItemsListController.subDetails.itemList}" columns="3" rows="7" id="dataListItems">
<p:column>
<p:panel style="text-align:center" >

<h:panelGrid columns="1" style="width: 100%">

<p:graphicImage value="/item/#{item.img}" />
<h:outputLabel value="#{item.itemName}" style="font-size:small ;font-weight: bold" />

</h:panelGrid>

<p:commandButton value="Chi tiết" style="font-size: x-small" action="#{catItemsListController.showItemSub(item)}">
<f:setPropertyActionListener value="#{item}" target="#{catItemsListController.items}" />
</p:commandButton>
<h:outputLabel value=" "/>
<p:commandButton value="Thêm vào giỏ" update="formlist:dataListItems,formlist:displayMessage,formlist:addtoCart,formlist:outstock" style="font-size: x-small" action="#{catItemsListController.addtoCart(item)}" rendered="#{item.instock gt 0}" id="addtoCart" />
<h:outputText value="Hết hàng" rendered="${item.instock eq 0}" style="color: red; border: 1px;font-weight: bold" id="outstock"/>

</p:panel>

</p:column>
</p:dataGrid>

</h:form>
</p:panel>

===========================================

in this page it display details of Sub-Category but it just display sub-category name and display on datagrid is list of item, it have relational many to one with sub-category.

i don’t know how to pass parameter with your suggest

Thank you!