Sample DataTable - Basic Row Selection don't play

UI Components for JSF
Post Reply
luis
Posts: 1
Joined: 15 Mar 2011, 11:28

15 Mar 2011, 12:07

Hi guys,

I'm newbie in PrimeFaces, and I'm very impressed with your work, my sincere congratulations. ;)

I'm having problems with some examples. In particular, I don't get to run the Sample DataTable - Basic Row Selection.
The problem is that when I select a row, it triggers the event and updates the property, it's ok, but then the property does not show the new value.

It is my code:

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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.prime.com.tr/ui"
      >
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <h:form>
            <p:dataTable var="row" value="#{hoteles.listado}"
                paginator="true" paginatorPosition="bottom" rows="10"
                selection="#{hoteles.selectedHotel}" selectionMode="single"
                rowSelectListener="#{hoteles.onRowSelect}"
                onRowSelectComplete="hotelDialog.show()" 
                >
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Hotel" />
                    </f:facet>
                    <h:outputText value="#{row.hotel}" />
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Email" />
                    </f:facet>
                    <h:outputText value="#{row.email}" />
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Codigo" />
                    </f:facet>
                    <h:outputText value="#{row.cod_hotel}" />
                </p:column>
            </p:dataTable>

            <p:dialog header="Detalle hotel" widgetVar="hotelDialog" resizable="false"
                      width="200" showEffect="explode" hideEffect="explode">
                <h:panelGrid id="display" columns="2" cellpadding="4">
                    <h:outputText value="Hotel:" />
                    <h:outputText value="#{hoteles.selectedHotel.hotel}" />
                </h:panelGrid>
            </p:dialog>
        </h:form>
    </h:body>
</html>
However, if the p: dataTable property will add update = "display" then it works properly.

Code: Select all

            
<p:dataTable var="row" value="#{hoteles.listado}"
                paginator="true" paginatorPosition="bottom" rows="10"
                selection="#{hoteles.selectedHotel}" selectionMode="single"
                rowSelectListener="#{hoteles.onRowSelect}"
                onRowSelectComplete="hotelDialog.show()" update="display"
                >
I have not found update property information in the manual. Why this problem occurs?.
This property is not used in the examples, particularly in "dataTableRowSelection.xhtml." http://www.primefaces.org/showcase/ui/d ... Column.jsf

But if I do not use it not make them work. What could be happening?

Thanks in advance.
Primefaces version: 2.2.1
JSF implementation: Mojarra 2.0.2
Server: Apache-tomcat-6.0.26
JDK: jdk1.6.0_24

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests