6 Replies Latest reply on May 22, 2007 8:40 PM by bytor99999

    DataScroller ">>" and ">>>" changing to text with Facet

      OK, So I have

      <rich:datascroller for="dataTable" maxPages="20"
       >
       <f:facet name="first">
       <h:outputText value="First"/>
       </f:facet>
       <f:facet name="last">
       <h:outputText value="Last"/>
       </f:facet>
       <f:facet name="next">
       <h:outputText value="Next"/>
       </f:facet>
       <f:facet name="previous">
       <h:outputText value="Previous"/>
       </f:facet>
       </rich:datascroller>
      


      Which will display the text when those buttons are enabled/active. However, when they are disabled, they go back to the default of "<<" and ">>" I do not want the "<<" to ever be displayed, I want the text to always be there whether those buttons are enabled or disable. It looks awkward when it changes back and forth as you go through pages.

      Also which class/style do you use in css to get those buttons to look different than with the grey background?

      Thanks

      Mark

        • 1. Re: DataScroller
          ilya_shaikovsky
          • 2. Re: DataScroller
            ilya_shaikovsky

            Thanks!

            • 3. Re: DataScroller

              Thanks Ilya.

              In those facets, is that where you can put the CSS class to use to change the look of the button?

              • 4. Re: DataScroller

                One other thing with that Jira, can those buttons also allow the text you put in the Facet, to not wrap? So if I put say "Next 5" for "fastforward" it appears on the same line and the "5" is not wrapped under it. Also the space between the buttons are a little close.

                Thanks. Sorry for being a little nit-picky on those. :)

                • 5. Re: DataScroller

                  I noticed lines of code in UIDataScroller.java in the setControls method

                  if ((rowCount - 1)<=(getFirstRow(dataTable)+getRows(dataTable))){

                  Maybe the rowCount -1 and <= is the reason why you don't get the "forward" moving buttons when a new page gets created and it only has one row. so (rowCount-1) would equal 0.

                  • 6. Re: DataScroller

                    OK, I also found through the code that I can use

                    <f:facet name="first_disabled">
                    <h:outputText value="First"/>
                    </f:facet>

                    And it will display the text "First" in the disabled button.

                    But I also noticed that the code has

                    public UIComponent getFirst()

                    for the enabled buttons, but no getters for the disabled, so you might or might not want to add that to the code.

                    But I definitely think the docs need to show those disabled facets too.