[jboss-user] [JBoss Seam] - request parameter gets ignored sometimes

codelion do-not-reply at jboss.com
Sat Feb 3 14:30:36 EST 2007

Starting out from seam-gen.  Let's say we have three kinds of entities, Car, Boat and Plane.  We only need Car to illustrate.

There is a page each like CarList.xhtml, Car.xhtml, CarEdit.xhtml and their CarList.page.xml, Car.page.xml, CarEdit.page.xml.

It all works fine with the generated code.  Then my colleague introduces a different menu, and in that menu he doesn't use s:link with propagation="none".  I'll explain what breaks and why it shouldn't break, it should work.

What breaks is this:  Go to list of cars, go to view a car (select it), go on to edit the car, and then while on the car edit page, change your mind and go to somewhere else in the menu.  Important:  Do that with a link that isn't an s:link with propagation="none".  Could happen, e.g. a help page, sidebar, top level menu, anything.  You can't make the whole world (even in your company) use s:link.  Then ... come back (e.g. through "the usual" link in the menu) to the list of cars, go to view another car, and voila, you're back at the car you selected first time, not the one you selected this time!

Just now to reproduce it I tried it a couple of times.  First time I couldn't, probably not right sequence, but second or third time I got it again.  When I demoed yesterday I got it all the time.

What seems to be broken is this:  While in the list of cars the s:link to select (i.e. the one to view the car) does contain an f:param with a carId, and it does show up in the URL with the new carId, it seems "the model" (EntityHome?) keeps using the Car.id from last time. (Or CarHome's id. You know better. I'm just imitating seam-gen.

It is very clear and striking, up there in the Address field of the browser in the URL I see the correct carId for the newly chosen car, but in the display of contents below there is the wrong car id from before.

That shouldn't be that way, ever, should it?  I mean that parameter is a clear indication of what should happen.

Now, in case that matters, there is an increase in cid (conversation id) from Car.xhtml to the CarEdit.xhtml through a propagation="begin", per seam-gen.  While the use and non-use of propagation might be worth discussing anyway, the point is though that a request parameter shouldn't be ignored either way, right?

I'm not going to go into details about what I think about methods in Param.java, so as not to soil the team's thoughts with my possibly wrong ideas.  I don't have a complete answer anyway, just some methods I tried following where they are used.  Like getValueFromRequest in Param.java, versus getValueFromModel.

Running off CVS, building here.

PS:  In Car.page.xml I have

<param name="carId" value="#{carHome.id}" />

Then as in CarHome I define

  | public Car initCar() {
  |   return getInstance();
  | }

I use in Car.xhtml fields like

<h:outputText id="description" value="#{car.description}" />

I don't use like seam-gen

<h:outputText id="description" value="#{carHome.instance.description}" />

Could that be related, or can someone make a statement that car and carHome.instance are identical objects, all the time, for the records?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010487#4010487

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010487

More information about the jboss-user mailing list