True. You've got something weird going on with your commandLink approach - that doesn't inject the datamodelselection using @In either.
I don't use the h:commandLink in conjunction with the @DataModel or @DataModelSelection. I just use a regular @In annotation in my session bean:
@In(required=false,value = "lineItem") @Out(required = false, value = "lineItem") private ClientTransmittalLineItemVO clientTransmittalLineItemx;
I also wrap my data table inside of a form. Is this a valid approach?
Do you mean
A. "No", this should not work there is still something weird going on
B. "No", I should not be doing it this way even if it does work.
If "A" I would like to figure out way it still works. Unfortunately, we hired an overpriced and under-qualified consultant and he showed us to do it this way. I only came across the @DataModel recently and am still experimenting with it.
If "B" should I assume that I should always use @DataModel or RESTful for clickable lists?
Thanks for your input.
I was answering your question
Is this a valid approach?
So A & B. I have no idea why it works, I suspect some magic glue code somewhere somewhere else.
I would recommend to always use the restful approach.
Ok. Thanks again for your input. One more clarification: Are you saying that I should always use a RESTful approach no matter what, or do you still recommend using @DataModel for some situations.
BTW, By RESTful I assume you mean to inject only the object's id and look it up again on the server side. If I misunderstand the term let me know.
Restful = page parameters. This would always be my approach assuming you don't mind passing the object's identifier to the client.
Ok. It is little more work to do it this way, but I think it is much simpler to understand and diagnose if something goes wrong. I notice that the seam-gen always generates the code this way. If I do go with the RESTful approach then there isn't any need for the @DataModel, right?
I'm in search for a best practice as well.
My problem is the following.
Assume you have a datatable like jfrankman.
I already implemented the delete operation with this extended-EL feature by passing the row-variables...in this case lineItem.
But now I'm stuck with the update. The variable passed to the action-method only holds the old value, at least the Clob (the only editable field) is still null.
Then I tried the Injection...still holding the old value.
What is the seam-way to do it?
I don't want to code a lot of actionListeners for all column-fields...
The issue was the clob.
A string field was being passed as extended EL-parameter.