extending a seam-gen CRUD application set
waltc Feb 4, 2009 3:20 PMHi, I am having the following issues when extending a CRUD application generated by seam-gen. This should be idiot-simple but I am having issues. Seam-gen generates an xxxHome and an xxxList for all the tables in the DB. I added an action which is only rendered if the value of a column in the table displayed is a certain value. This works fine. Here is that code in the xhtml file.
#{' '}
<s:link action="#{Resubmitter.resubmit}"
value="Resubmit"
propagation="none"
id="upddocumentResubmit"
rendered="#{_upddocument.updDocumentDocState==400}">
<f:param name="upddocumentUpdDocumentDocId"
value="#{_upddocument.updDocumentDocId}"/>
</s:link>
This works fine. My understanding is, correct me if I am wrong, the variable upddocumentUpdDocumentDocId is created, if it doesn't already exist, and populated with the docId of the selected row. The _upddocument variable is used to iterate over the resultSet of the updDocumentList object created by seam-gen. My understand, correct me if I am wrong, is that upon reaching this declaration:
<rich:dataTable id="upddocumentList"
var="_upddocument"
value="#{upddocumentList.resultList}"
rendered="#{not empty upddocumentList.resultList}">
an instance of upddocumentList is created, if it doesn't exist, and the _upddocument variable is assigned the resultList of the object that sweeps the table w or w/o the criteria.
In my new action, I coded:
@In UpddocumentHome upddocumentHome;
@In UpddocumentupdatelogList uupddocumentupdatelogList;
@In UpddocumentupdatelogHome upddocumentupdatelogHome;
In order to pick up the home object for that table and a related table as well as a list object for the second table. My assumption was that the selected row would be current in the home object. This may have been flawed logic but I received a RequiredException that upddocumentHome needed to be not null. My understanding was if it was not in existence it would have been created, either way that variable would not have come in as null. Why? Isn't it known to Seam by virtue of it scanning the jar files and recognizing the @Name in the UpddocumentHome class? So I do not understand that and I am sure the reason for it would apply to the other two objects there as well.
I next decided that on the action the variable upddocumentUpdDocumentDocId was set in the slink and I should import it via:
@In int upddocumentUpdDocumentDocId; This is defined as an int.
This too failed for the same reason. So I am at a loss to understand what is happening here.
I have written seam apps where I create the factory generating the @DataModel and that seems to work fine. In this current case I am trying to access the data from an external source.
Thanks,
Walt Corey
#{' '}
<s:link action="#{Resubmitter.resubmit}"
value="Resubmit"
propagation="none"
id="upddocumentResubmit"
rendered="#{_upddocument.updDocumentDocState==400}">
<f:param name="upddocumentUpdDocumentDocId"
value="#{_upddocument.updDocumentDocId}"/>
</s:link>
This works fine. My understanding is, correct me if I am wrong, the variable upddocumentUpdDocumentDocId is created, if it doesn't already exist, and populated with the docId of the selected row. The _upddocument variable is used to iterate over the resultSet of the updDocumentList object created by seam-gen. My understand, correct me if I am wrong, is that upon reaching this declaration:
<rich:dataTable id="upddocumentList"
var="_upddocument"
value="#{upddocumentList.resultList}"
rendered="#{not empty upddocumentList.resultList}">
an instance of upddocumentList is created, if it doesn't exist, and the _upddocument variable is assigned the resultList of the object that sweeps the table w or w/o the criteria.
In my new action, I coded:
@In UpddocumentHome upddocumentHome;
@In UpddocumentupdatelogList uupddocumentupdatelogList;
@In UpddocumentupdatelogHome upddocumentupdatelogHome;
In order to pick up the home object for that table and a related table as well as a list object for the second table. My assumption was that the selected row would be current in the home object. This may have been flawed logic but I received a RequiredException that upddocumentHome needed to be not null. My understanding was if it was not in existence it would have been created, either way that variable would not have come in as null. Why? Isn't it known to Seam by virtue of it scanning the jar files and recognizing the @Name in the UpddocumentHome class? So I do not understand that and I am sure the reason for it would apply to the other two objects there as well.
I next decided that on the action the variable upddocumentUpdDocumentDocId was set in the slink and I should import it via:
@In int upddocumentUpdDocumentDocId; This is defined as an int.
This too failed for the same reason. So I am at a loss to understand what is happening here.
I have written seam apps where I create the factory generating the @DataModel and that seems to work fine. In this current case I am trying to access the data from an external source.
Thanks,
Walt Corey