[JBoss Seam] - @DataModel problems
by smithbstl
I keep getting this returned via the debug page under my datamodel component. Why is the row unavailable? The wrapped data is some of the data returned via my query but the data model is not being displayed on the page. No exception is thrown.
class class org.jboss.seam.jsf.ListDataModel
| dataModelListeners []
| rowAvailable false
| rowCount 1
| rowData java.lang.IllegalArgumentException[row is unavailable]
| rowIndex -1
| wrappedData [com.stlouiscity.csb.ejb.domain.Address[structureAddressPK=com.stlouiscity.csb.ejb.domain.AddressPK[sadrNlc=720, sadrHseNoSfx= , sadrHseNoLegl=6047]]]
| toString() org.jboss.seam.jsf.ListDataModel@1eca460
Here is my SFSB
@Stateful
| @Name("addressListing")
| @Scope(ScopeType.SESSION)
| public class AddressListing implements mypackage.AddressListingLocal {
|
| //@EJB private AddressLocatorLocal locator;
| @PersistenceContext(unitName="CSB_Oracle", type=EXTENDED)
| private EntityManager em;
|
| @In(create=true)
| FacesMessages facesMessages;
|
| @In
| private Address address;
|
| private Integer addressLookupPK;
|
| @DataModel
| private List<StructureAddress> addresses;
|
| @Out(required=false)
| private List<String> streetDirections;
|
| public AddressListing() {
| }
|
| public String findAddresses() {
|
| if (address.getStreetName() != null) {
| //Find StructureAddress
| Query q = em.createQuery("Select a From StructureAddress a Where" +
| " (a.structureAddressPK.houseNumber = :houseNumber OR :houseNumber IS NULL) AND" +
| " (a.structureAddressPK.houseSuffix = :suffix OR :suffix IS NULL) AND" +
| " (a.nlc.streetDirection = :streetDirection OR :streetDirection IS NULL) AND" +
| " (lower(a.nlc.streetName) LIKE :street OR :street IS NULL)");
| q.setParameter("houseNumber",address.getHouseNumber());
| q.setParameter("suffix",address.getHouseSuffix());
| q.setParameter("streetDirection",address.getStreetDirection());
| q.setParameter("street",address.getStreetName().toLowerCase() + "%");
| addresses = q.getResultList();
| }
|
| return null;
| }
|
| @Factory("streetDirections")
| public void fillStreetDirections() {
| Query query = em.createQuery("SELECT DISTINCT n.streetDirection FROM Nlc n WHERE n.streetDirection IS NOT NULL");
| streetDirections = query.getResultList();
| }
|
| @Remove @Destroy
| public void destroy() {
|
| }
| }
|
Here is the page
<tr:outputText value="No Addresses Found" rendered="#{empty addresses and addresses!=null}"/>
| <tr:table
| id="addresses"
| var="addressRow"
| value="#{addresses}"
| rowBandingInterval="1"
| rendered="#{addresses!=null}"
| rowSelection="single"
| partialTriggers="addressForm:search">
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.addressNumber']}"/>
| </f:facet>
| <s:link id="viewRequests" value="Requests" action="#{addressListing.findRequests}"/>
| </tr:column>
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.addressNumber']}"/>
| </f:facet>
| <tr:outputText value="#{addressRow.structureAddressPK.houseNumber}"/>
| </tr:column>
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.addressSuffix']}"/>
| </f:facet>
| <tr:outputText value="#{addressRow.structureAddressPK.houseSuffix}"/>
| </tr:column>
|
|
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.streetDirection']}"/>
| </f:facet>
| <tr:outputText value="#{addressRow.nlc.streetDirection}"/>
| </tr:column>
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.street']}"/>
| </f:facet>
| <tr:outputText value="#{addressRow.nlc.streetName}"/>
| </tr:column>
| <tr:column>
| <f:facet name="header">
| <tr:outputText value="#{msgs['AddressList.streetType']}"/>
| </f:facet>
| <tr:outputText value="#{addressRow.nlc.streetType}"/>
| </tr:column>
| </tr:table>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033288#4033288
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033288
17Â years, 9Â months
[JBoss Seam] - Hot deployment of JSF file at development time?
by kingcu
Here is what I am trying to achieve: at development time, you often need to change a page multiple times to get a satisfied result; but redeploying the whole EAR every time a small change is made is tedious and time consuming. So, I like to find a way to allow me make changes to the JSF files and then immediately switch to the browser and see that change taking effects. I am using JBoss AS 4.0.5.GA, JBoss Eclipse IDE 2.0.0 Beta 2 and Seam 1.2.1 GA.
I feel there is a general lack of docs/tutorials on setting things up. Anyway, here is what I found to be the most relevant: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103503.
And here is what I have:
1. My development files are organized in the same way as the booking example: src, view, resources, etc.
2. Create a deploy folder under the project and all the .ear, .war, .jar folders accordingly under it, so I end up with the following structure:
[Code]
project
-deploy
-was.ear
-META-INF
-was.jar
-was.war
[/Code]
3. In Project Properties --> Java Build Path --> Source tab, check the box for "Allow output folders for source folders". And then add each src/resource folder to its appropriate output folder.
The problem I have here is that JBoss Eclipse doesn't allow you to nest one output folder inside another. So, if I set my "view" folder to output to "was.war", I cannot output "resource/WEB-INF" to "war.war/WEB-INF", because the latter output dir is inside the former. So I ended up moving files around to match the ear/war structure, it's really messy.
4. In jboss-4.0.5.GA\server\default\conf\jboss-service.xml, add "/C:/workspace/seam-was/was/deploy/" to the URLs to be scanned. I found that I need to add a slash / in front of C:, otherwise, it's taken as a relative path to the jboss home dir.
5. Start JBoss server and the EAR folder deployed correctly.
6. Now, I made some change to one xhtml file; but nothing happened, refreshing the browser still gives me the old page. I tried to touch the web.xml (edit it, add a space and remove it), still nothing happened.
So, my questions are:
1. Why the changes are not redeployed?
2. Is there a better way to do exploded type deployment in JBoss Eclipse?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033286#4033286
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033286
17Â years, 9Â months