aspose file tools*
The moose likes JSF and the fly likes rerender losing attributes of a tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "rerender losing attributes of a tag" Watch "rerender losing attributes of a tag" New topic
Author

rerender losing attributes of a tag

Dj Gilcrease
Greenhorn

Joined: Jul 20, 2009
Posts: 4
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

Joined: Jul 20, 2009
Posts: 4
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

Joined: Jul 20, 2009
Posts: 4
Ok fixed my issues
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rerender losing attributes of a tag