instant row Selection and dialog problem

UI Components for JSF
Post Reply
ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

20 Sep 2010, 09:57

Hi everybody,

im new to primefaces and i have a very strange problem:

im using JSF Mojarra 2.0.2 and primefaces 2.2.M1

The following example from the Showcase does not work for me:

Whenever I select a row, although the dialog appears,
but no current data will be displayed! (always: no record found...)

After refreshing/reloading the Page clicking on any row shows the data of the before the reload selected row...

From debbuging i know "tableBean.selectedCar" is called and current data is transmitted but the dialog always show: no record found :-(
Please Help me, i need this Work for my next Project...


Sorry for my bad Englisch :-)

View

Code: Select all

<p:dataTable var="car" value="#{tableBean.cars}"
           selection="#{tableBean.selectedCar}" selectionMode="single"  
           onRowSelectUpdate="display" onRowSelectComplete="carDialog.show()">  
   ...
</p:dataTable> 

Code: Select all

<p:dialog header="Car Detail" widgetVar="carDialog" resizable="false"  
              width="200" showEffect="explode" hideEffect="explode">  
        ...
        </h:panelGrid>  
    </p:dialog>

Bean

Code: Select all

public Car getSelectedCar() {  
        return selectedCar;  
}  
public void setSelectedCar(Car selectedCar) {  
        this.selectedCar = selectedCar;  
}  

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

20 Sep 2010, 13:11

Ok, i've found that <p:dialog> is only filled when the page loads/reloads!
If I select a row, <p:dialog> is not loaded again, so it shows the data witch is filled at pageloading...

Maybe this is an Mojarra 2.0.2 Problem?
Is there any way to force <p:dialog> to reload/update?

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

20 Sep 2010, 13:19

you update the content of component with id "display" with onRowSelectUpdate="display",
so all you have to do is to make sure it is the content of the <p:dialog>, like:

Code: Select all

<p:dialog header="Car Detail" widgetVar="carDialog" resizable="false" width="200" showEffect="explode" hideEffect="explode">
    <p:outputPanel id="display">
        <h:panelGrid>
            ...
        </h:panelGrid> 
    </p:outputPanel>
</p:dialog>
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

20 Sep 2010, 13:27

Wow, that was easy, i love u dude :-)
I really was sittin on this, for 2 days :-(

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

20 Sep 2010, 13:38

glad to help ;)
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests