| Author |
Message |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 13/10/2009 19:55:07
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
Hi,
I have a problem with RowSelector. I want to get what element has been selected from a DataTable by the user.
This is the View part I wrote:
Code:
<ice:panelGroup>
<ice:dataTable var="_sperimentazione" value="#{sperimentazioneList.resultList}">
<ice:column>
<ice:rowSelector selectionListener="#{testTableSelection.selectionListener}"/>
<f:facet name="header"><ice:outputText value="id"/></f:facet>
<ice:outputText value="#{_sperimentazione.id}"/>
</ice:column>
<ice:column>
<f:facet name="header"><ice:outputText value="idAmministrativo"/></f:facet>
<ice:outputText value="#{_sperimentazione.idAmministrativo}"/>
</ice:column>
<ice:column>
<f:facet name="header"><ice:outputText value="Tipo di sperimentazione"/></f:facet>
<ice:outputText value="#{_sperimentazione.clsSperimentazione.tipo}"/>
</ice:column>
<ice:column>
<f:facet name="header"><ice:outputText value="Descrizione"/></f:facet>
<ice:outputText value="#{_sperimentazione.descrizione}"/>
</ice:column>
</ice:dataTable>
</ice:panelGroup>
And this is the controller hosting the selectionListener:
Code:
@Name("testTableSelection")
public class TestTableSelectionAct {
public void selectionListener(RowSelectorEvent rsevt) {
System.out.println("Listener select activated");
}
}
I'm using Seam 2.2.0GA with ICEFaces 1.8.1
The problem is that the selectionListener is never fired.
Could someone help me?
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 08:14:23
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
The simplest thing is probably to review the seam-comp-showcase application that is available from our downloads page.
I do note that you have no value property set for the rowSelector though. You will also want to check the configuration and packaging (are you using an ear or war deployment? If ear, then put all the ICEfaces jars into the ear/lib location).
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 08:42:42
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
judy.guglielmin wrote:
The simplest thing is probably to review the seam-comp-showcase application that is available from our downloads page.
I do note that you have no value property set for the rowSelector though. You will also want to check the configuration and packaging (are you using an ear or war deployment? If ear, then put all the ICEfaces jars into the ear/lib location).
Thank you for your answer.
I don't know why but I was sure that the value property was optional. Evidently I was wrong.
Is there a way to add a boolean attribute to the elements of a DataModel (obtained from the .resultList() method of the EntityQuery action) without altering the entity class?
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 10:11:16
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
just make it @Transient and it won't be persisted. (the selected attribute for the boolean, that is).
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 10:39:30
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
judy.guglielmin wrote:
just make it @Transient and it won't be persisted. (the selected attribute for the boolean, that is).
It doesn't work. If I alter the Entity class adding a Transient boolean for storing the selected "flag", I get errors (null value association).
Could you provide me a working example, given a list (or DataModel) of instances of an entity (that does not have a boolean field), to implement a DataTable with RowSelector?
Thank you.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 10:51:55
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
just make it false in the constructor when you originally create the entity. (it's not the transient property that is the problem). I believe the open18ice example has this as well as seam-comp-showcase. Did you already check them?
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 11:20:32
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
First of all, thank you for your replies.
judy.guglielmin wrote:
just make it false in the constructor when you originally create the entity. (it's not the transient property that is the problem). I believe the open18ice example has this as well as seam-comp-showcase. Did you already check them?
Yes, I mimicked the Employee class found inside seam-comp-showcase. The error went away, the selectionListener is not fired still.
View (excerpt):
Code:
<ice:panelGroup>
<ice:dataTable var="_sperimentazione" value="#{sperimentazioneList.resultList}">
<ice:column>
<ice:rowSelector value="#{_sperimentazione.selected}"
selectionListener="#{testTableSelection.selectionListener}"/>
<f:facet name="header"><ice:outputText value="id"/></f:facet>
<ice:outputText value="#{_sperimentazione.id}"/>
Changes in the entity class:
Code:
@Entity
@Table(name = "Sperimentazione", catalog = "ASSC")
public class Sperimentazione implements java.io.Serializable {
.....
private transient boolean selected = false;
@Transient
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
Any ideas? Thanks again.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 11:25:56
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
Did you check your configuration and packaging to make sure they were similar to seam-comp-showcase? (you see that it works properly in that application, correct?).
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 11:35:04
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
judy.guglielmin wrote:
Did you check your configuration and packaging to make sure they were similar to seam-comp-showcase? (you see that it works properly in that application, correct?).
I don't know how to start the seam-comp-showcase example. So I don't know if that works. I'm modyfing a seam project that was automatically created by seam-gen with ICEFaces support.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 11:43:25
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
Please go to the downloads page, http://www.icefaces.org/main/downloads/os-downloads.iface
and under Projects->Jboss Seam, you will find seam-comp-showcase. You can use the current distribution of Seam and ICEfaces and read the directions to build/deploy.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 12:08:00
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
judy.guglielmin wrote:
Please go to the downloads page, http://www.icefaces.org/main/downloads/os-downloads.iface
and under Projects->Jboss Seam, you will find seam-comp-showcase. You can use the current distribution of Seam and ICEfaces and read the directions to build/deploy.
I received news that this is an ICEFaces bug. Thanks anyway.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 12:13:24
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
What bug is this? It works perfectly with seam-comp-showcase (as well as other sample applications). Not sure where you are getting that information.....
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/10/2009 13:58:09
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
judy.guglielmin wrote:
What bug is this? It works perfectly with seam-comp-showcase (as well as other sample applications). Not sure where you are getting that information.....
You are right, I have to correct myself. I received false information from a colleague. Actually seam-comp-showcase works... but still I can't understand why my code doesn't.
My SEAM installation uses ICEFaces 1.8.1. Seam Showcase runs with ICEFaces 1.8.2. I think it's very unlikely, but could that be the problem?
Just in case, do you know how could I update the ICEFaces libraries that SEAM uses? I remember that they were automatically downloaded the first time I ran seam setup.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 15/10/2009 05:56:29
|
applefan
Joined: 03/10/2009 00:00:00
Messages: 24
Offline
|
I've noticed that none of the classes in seam-showcase are SEAM managed components (i.e., they are missing the @Name annotation). Could it be an ICEFaces - SEAM interaction problem? I can't figure out the reason why my code still doesn't work.
Thank you.
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 15/10/2009 09:11:20
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
If you look closer, you will notice other packages (com.icesoft....) that are the Seam backing beans which extend the other classes (copied over from regular component showcase). Here are the @Named Seam components. All but a few just extend the base classes for regular component showcase. There are also a few other beans that are created in components.xml. (you might want to read up on the Seam docs to figure those ones out).
|
|
|
 |
|
|