This is a migrated thread and some comments may be shown as answers.

Backbutton goes to "first" page instead of previous page

6 Answers 561 Views
Button (Mobile)
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 17 Oct 2012, 04:28 AM
I have a layout with a back button:
<div data-role="layout" data-id="infoPageLayout">
 <header data-role="header">
  <div data-role="navbar">
   <a class="nav-button" data-align="left" data-role="backbutton">Back</a>
    <span data-role="view-title"></span>
  </div>
 </header>
</div>

I get to that view from a 'click' event with app.navigate('#infoPage');
When I click the Back button, it goes to the view at the top of my html file (the default view) instead of the previous view.

Is there anything that might be causing this?

6 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 19 Oct 2012, 03:31 PM
Hello,

I tested a similar scenario and got everything to work as expected. Could you please check my demo page and let me know what I am missing? Can you reproduce the problem in my example and send me a back a link with the updated version?
Please provide such example and I will check it right away.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
M
Top achievements
Rank 1
answered on 19 Oct 2012, 07:26 PM
Thanks for taking a look Alexander.

I've edited it to reflect a shell of my app.

With this version the back button on the View "thirdPage" doesn't work at all, and as soon as that View loads, my debugger is showing an "Uncaught Error: Syntax error, unrecognized expression: #" error.
The back button on "barPage" does work, however.

http://jsbin.com/amuwal/6/edit

0
Alexander Valchev
Telerik team
answered on 24 Oct 2012, 02:15 PM
Hi,

The page throws an error because #bazButton has a href="#" attribute. If you want to link the view via button you should set a valid View id as a href attribute. For more information please check this help topic. Of course you can use the click function and navigate through the navigate method, but in that case please omit the href attribute of the link element.

Also it is recommended to use the click event of the widget instead of jQuery click event.
For convenience I updated your example: http://jsbin.com/amuwal/11/edit 

Note that I added data-title attributes to the Views in order to fix the broken layout.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Percy
Top achievements
Rank 1
answered on 29 Nov 2017, 10:52 AM
i am having the same problem. in some pages, the back button doesn't work at all and in some it works but goes to the parent view instead of the previous view .
0
Neli
Telerik team
answered on 04 Dec 2017, 09:03 AM
Hello Percy,

Note, that if needed, the href attribute could be used to explicitly set the view to which the BackButton will navigate to.
Enclosed you may find a Dojo example with three views and BackButtons on two of them. Could you please modify the provided example in order to replicate the issue as it is at your end. This will help us to investigate it locally and assist you further.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Percy
Top achievements
Rank 1
answered on 04 Dec 2017, 12:31 PM

Hi Neli

thanks for the reply, the provided example worked fined. thanks for your help :)

 

 

Tags
Button (Mobile)
Asked by
M
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
M
Top achievements
Rank 1
Percy
Top achievements
Rank 1
Neli
Telerik team
Share this question
or