0

I am using Primefaces 3.5 and I need to use the sticky tag. I got the code from the showcase. So here is my code:

<p:toolbar id="myToolbar">  
    <p:toolbarGroup align="left">  
        <p:commandButton type="button" value="Some Button" />  
    </p:toolbarGroup>
</p:toolbar>
<p:sticky target="myToolbar" />

I get the error:

/index.xhtml @26,36 Tag Library supports namespace: http://primefaces.org/ui, but no tag was defined for name: sticky

If I remove the sticky part everything works fine. What could this error be?

Stefanos Kargas
  • 10,547
  • 22
  • 76
  • 101
  • 1
    Yeah. As @Kuba mentioned in the answer , It's not a part of `3.5` component suite.Here is the change log for that http://code.google.com/p/primefaces/issues/detail?id=5976&can=1&q=label%3DTargetVersion-4.0%20status%3AFixed&colspec=ID%20Type%20Status%20Priority%20TargetVersion%20Reporter%20Owner%20Summary&num=500 – SRy Nov 27 '13 at 14:56

1 Answers1

2

I'm afraid it's not supported in 3.5. Try using Primefaces 4.0 - User Guides. Use css

.myComponent(
    position: fixed;
)

and some jQuery to simulate similar behaviour. Here's some JS code snippet that I wrote a while ago to do just that.

$(document).on("scroll", function(){
   if($(document).scrollTop() >= 180){
       $('.header').css({'position': 'fixed'});
       $('#mainBody').css('margin-top', '182px');
   } else {
       $('.header').css({'position': 'relative'});
       $('#mainBody').css('margin-top', '110px');
   }
}    
Kuba
  • 2,069
  • 23
  • 30