Problem with # at the end of address

12 posts, 1 answers
  1. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 28 Jun 2013 Link to this post

    When I'm using kendo mobile - each url ends with #
    e.g:

    http://demos.kendoui.com/mobile/m/index.html#/

    Even if it is working in most time sometimes it causes issues because e.g clik on list will generate:

    http://demos.kendoui.com/mobile/m/index.html#/mobile/m/overview/index.html

    So there is part of address duplicated. - so when I built custom link I have issues with some dynamic parameters. Can I avoid that?

    So when I have something custom link like :
    href="#item?id=1"

    after click it renders link at the root not current subpage.
  2. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 28 Jun 2013 Link to this post

    Hi,

    The behaviour you observe is by design - this is how Kendo UI Mobile navigates to remote views. I am not sure that I understand your case, though. Do you expect the item request to be relative to the current address?  

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 29 Jun 2013 Link to this post

    Hello,
    the problem I have is quite strange. For navigation in links I'm using site root based addresses.
    1. /mysite/subpage/page1
    2. /mysite/subpage/page2
    3...

    so when if my original URL is
    http://mydomain/mysite

    after enter from mobile it goes to be:
    http://mydomain/mysite/#/

    After pressing link it goes to be:
    http://mydomain/mysite/#/mysite/subpage/page1 instead of  http://mydomain/mysite/subpage/page1

    this is not so bad because it still working, however if on new site I have only page relative links like: #interalview?id=1
    it behaves wrongly because it cuts whole address and I have:
    http://mydomain/mysite/#internalview?id=1 instead of http://mydomain/mysite/subpage/page1/#internalview?id=1

    so it is problematic for me to create proper navigation.
  4. Answer
    Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 02 Jul 2013 Link to this post

    Hello Marcin,

    Thank you for the clarification. I think that this should be considered a bug in Kendo UI - the behavior you expect (relative URLs) should be supported, in fact. I will file this in our issue tracker, and try to address it in our internal builds, and in the upcoming Q2 release. I am updating your telerik points for this finding. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 02 Jul 2013 Link to this post

    Hi Marcin,

    It looks like I need some more help with reproducing and addressing the problem.

    As far as I understand, the internalview?id=1 is a remote view URL. I tried to reproduce the case in the sample attached (running it in a subdirectory on my local machine); clicking the button successfully requested the relative URL of the foo.html remote view. 

    Can you please let me know what am I missing? 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 02 Jul 2013 Link to this post

    Hi
    I've added simple tab strip with local links - it is how I'm using it and it behaves as I described (during switching tabs)

    See updated files.
  7. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 02 Jul 2013 Link to this post

    Hi,

    I did not manage to reproduce the problem with your sample - clicking the tabs did not result in a wrong ajax request to the root url. Can you please let me know the steps which I need to follow?  

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 02 Jul 2013 Link to this post

    Hi
    I'm opening index file in browser:
    file:///D:/Temp/test1/index.html#/

    Press button and now:
    file:///D:/Temp/test1/index.html#foo.html?bar=baz

    Switch tab and now:
    file:///D:/Temp/test1/index.html#chartView?id=1

    so when I e.g. refresh page
    I'm again on index.html but I should stay on foo.html

  9. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 04 Jul 2013 Link to this post

    Hello Marcin,

    The chartView id is an id of a local view, which resides in a remote view - there is no way for the mobile application in index.html to determine its location and load it on reload. 

    You can avoid that by targeting the same view by its remote url - like this:

    <div data-role="footer">
            <div data-role="tabstrip">
                <a id="choose0" href="foo.html?id=0">Today</a>
                <a id="choose1" href="foo.html?id=1">This Week</a>
                <a id="choose2" href="foo.html?id=2">Last Week</a>
            </div>
        </div>
    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 04 Jul 2013 Link to this post

    Hi
    Thank you for explanation, but the problem is that foo.html is not remote view in my scenario. It is external page with full redirection to page. Not simple view. I cannot make it as remote view because of some business logic and permissions. So I redirect to foo.html (not like in attached example) and then I'm on totally new page. And becuase I'm using mvc I cannot use id as part of main request, because it will cause issue with mvc routing and will cause issue with normal (not mobile) views. I already found workaround but I don't like it. Instead of href when going from first page (index.html) in this case I'm using onclick="window.location.href =foo.html" which is doing what I want - process external request properly.

    Regards
    Marcin
  11. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 05 Jul 2013 Link to this post

    Hello Marcin,

    If your project relies server side processing and business logic implementation, you may consider enabling serverNavigation, which effectively performs regular redirects (like you do in your snippet) instead of ajax loading for remote views. This concept is is also showcased in our Q2 beta release, featuring ASP.NET MVC wrappers for Kendo UI Mobile. 

    Hope this helps,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  12. Marcin
    Marcin avatar
    186 posts
    Member since:
    Jan 2011

    Posted 05 Jul 2013 Link to this post

    Hello
    Thank you for your answer. However this option (serverNavigation) is not what I'm looking for. This affects whole app. So not exactly what I need.

    That you for your help. My solution is working so far so I can use it for now.

    Regards
    Marcin
Back to Top