Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rerender losing attributes of a tag

 
Dj Gilcrease
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently wrote my first tag library and everything is working great except when I attempt to rerender a panel that contains tags from my tag library.

What happens is any tag attribute that is not supplied by a backing bean reverts to the default value instead of what I have supplied in the code.

eg

where the default of attr1 is 10, so when I use a command link to rerender the panel attr1 reverts to 10 and attr2 contains what it should based on the state of the backing bean

Also on a related note, my new tag library only outputs a script tag with a bunch of custom js in it (No one where I work understands javascript so I need to write jsf tags they can understand, so they can use it), and when I rerender the test panel it does not replace the script tag but generates a new second one, is there a way I can get it to replace the script tag?
 
Dj Gilcrease
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I figured out why it was losing the attribute state between rerenders. I had not overridden the saveState and restoreState methods

Still have the issues of the script not being replaced but just appended to the panel
 
Dj Gilcrease
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok fixed my issues
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic