1 Reply Latest reply on Feb 6, 2008 9:21 AM by Wendy Bossons

    How to disable ajax commandLink?

    Khilesh Prasad Newbie

       

      HtmlAjaxCommandLink firstRecord =new HtmlAjaxCommandLink ();
      

      any one help how to disable this link for next,previous,first, last link..........

        • 1. Re: How to disable ajax commandLink?
          Wendy Bossons Newbie

          You should create a condition where you can track whether there are records to traverse previous or next. Then, check for the condition and create HtmlOutputText in the condition where there is no movement previous or next.

          HtmlPanelGrid panel = ...
          if (morePrevious) {
          HtmlAjaxCommandLink ...
          ...

          } else {
          HtmlOutputText ...
          outputtext.setStyleClass("disabled");//set up a style class disabled to indicate to the user this is disabled.

          render output by adding each to the panel while in the condition and then add the panel to the parent and call its render methods.

          ..\Wendy