Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    NavigationBar LeftButton

    Hellow SmartGWT Mobile team

    Im using your last Version lib.

    I am having a little issue, maybe it has a easy solution but I ve been crashing my head for hours and nothing.
    The thing is, I need that when a user tab over the Left "back" button on the Navigationbar validate some data and if the data is correct then I will let them go otherwise I will pop up a message, I found not way to grab this onBack event, when I try to use the function setLeftButton is giving me a error, the only way I ve found is clear the NavsTack and then it let me use the setLeftButton function for another navigationButton but if I do that I lose the slide animation of the NavsTack.

    What I want is somehow control this event without lose the slide animation.

    Thanks in advance

    #2
    Can you show the code that leads to an error on setLeftButton(), as well as what error you're receiving?

    This kind of basic information is always required, so please be sure to post it in the future.

    Comment


      #3
      NavigationBar LeftButton

      I don't have a full code to strip from my application, but here is the main code items:

      I'm in screen1 and make

      navStack.push(screen2)

      and on screen2 I got:

      boolean isChanged = changed();

      NavigationBar backButton = new NavigationBar("");
      backButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
      if(!changed){
      navStack.pop()
      }else{
      SC.say("Please save values first");
      }

      }
      });

      navStack.getNavigationBar().setLeftButton(backButton);

      when I try this code we do not move from screen1 to screen2

      but now if I have on screen2

      boolean isChanged = changed();

      navStack.clear(); // added this line!!!

      NavigationBar backButton = new NavigationBar("");
      backButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
      if(!changed){
      navStack.popTo(screen1)
      }else{
      SC.say("Please save values first");
      }

      }
      });

      navStack.getNavigationBar().setLeftButton(backButton);

      this code is working good but I'm losing the slide effect, it's just jumping from screen2 to screen1 and that's happening because
      of the following code:

      navStack.clear();

      I found no way to control the left button. I have tried a lot of ways, this is just one of them. Seems like when the navStack is not empty, we run into the issue.

      Can you suggest a way to control the leftButton without losing the slide effect?

      Thank you.
      Last edited by ESBT; 4 Nov 2013, 18:20. Reason: impruvments

      Comment


        #4
        Hello guys.

        This issue not happening any more, I can't remember in what library version was fixed but it's working.

        Thanks

        Comment

        Working...
        X