• Post Reply Bookmark Topic Watch Topic
  • New Topic

Controls getting messed/switched up between pages - outputText and inputText  RSS feed

 
John Tannel
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit: It seems to be working fine, I'm thinking because of the change to the data binding. I'll report back if it breaks again.

For some reason, my controls on two different pages seem to be getting mixed up by JSF. On one page, it's an input text, and on the next page it's an outputText (for my confirmation page).

Sometimes on the second page it shows up as an inputText instead an outputText and vice versa. They should hold the same value but as one is the input page, and one is the confirmation page it's somewhat important that the control types don't get mixed up.

I've never seen this and have done multiple sets of pages like this before. It's really strange. Both the form and the controls on each page have ids. The form id is unique, and the control ids are shared, since they are basically the same value in a different type of control.

Does anyone have any ideas?

edit, here is the code


<cart.jsp>


<confirm.jsp>

I changed the id here to see if that will help as well.




I noticed I had the dataTable's data for the confirmation page bound as well, and wonder if that might have something to do with it. I deleted it, and will play around for a while and see what happens. As the problem only happens intermittently it's hard to say for sure when a solution works.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Believe me, JSF doesn't work like that. There is a very distinct separation between the Model and the View, so what controls you bind to a backing bean property in one View have zero influence on what controls you bind to a backing bean property in another View. And note that I said "controls". In true MVC style, you can bind multiple controls to a single model if you need to.

Most likely you have stale Views. The best way to work that out is to fixup all your source code, create a deployable module, stop the server, remove all server work/tempfiles, then restart the server with the new deployable.

If you're using the Tomcat server, that means deleting the TOMCAT_HOME/temp and TOMCAT_HOME/work directory contents (but NOT the Tomcat directories!). Plus delete the WAR file (if any) and exploded WAR directory (if any) in TOMCAT_HOME/webapps. Deleting the exploded WAR is critical, because if you update the WAR file, it won't help. The exploded WAR takes precedence, even when it's older than the non-exploded WAR file.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!