Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7162293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:42:39+00:00 2026-05-28T13:42:39+00:00

I’m trying to get this to work, in a Wicket renderHead-method the parameter IHeaderResponse

  • 0

I’m trying to get this to work, in a Wicket renderHead-method the parameter IHeaderResponse response is passing a javascript, to show respectively hide links in the calling parent page.
This is a part of a mobile web app served via an Apache Tomcat server.

StartPage.html, (the calling parent page, where the links to be hidden/shown is)

<li class="ui-block-e">
    <a wicket:id="logoutlink" id="logout" href="#" data-theme="a" class="ui-btn-corner-   all ui-btn ui-btn-up-a ui-btn-icon-top">
        <span class="ui-btn-inner ui-btn-corner-all">
        <span class="ui-btn-text">Logga ut</span>
        <span class="ui-icon ui-icon-custom"></span>
           </span>
<a wicket:id="loginlink" id="login" href="/domain/mobile/login" data-theme="a"    class="ui-btn-corner-all ui-btn ui-btn-up-a ui-btn-icon-top">
    <span class="ui-btn-inner ui-btn-corner-all">
    <span class="ui-btn-text">Logga in</span>
        <span class="ui-icon ui-icon-custom"></span>
    </span>
     </a>
</li>

LoginRedirectPage.java, (the page containing the redirecting js)

@Override
public void renderHead(IHeaderResponse response) {
log.info("Redirecting to " + redirectUrl);//to check via log

// if the parent is the mobile app..
response.renderOnDomReadyJavascript(
"if(parent && parent.$ && parent.$.mobile){" +
"parent.$('#logout').show();" +
"parent.$('#login').hide();" +
"parent.history.go(-2);" +                  
"console.log('redirecting with jqm "+redirectUrl+"');" +//logging
"}");

However, (saw this coming huh !?),

the lines “parent.$(‘#logout’).show();” and “parent.$(‘#login’).hide();”

does what they are supposed to in a browser (via a PC), the logout link is enabled and the login link is hidden ( if the user is logged in).

But while doing this via an Android phone the links is not shown/hidden as they are supposed to, the login link is still sitting there. As if i wasn’t logged in, although the logs shows that i’m logged in.

The constant “redirectUrl” point in this case back to the StartPage.html.

By the way, i also tried to use some old-style js, ex. “parent.document.getElementById(‘logout’).style.display=’block’;”, to no avail.

Thanks in advance.

//Kalle

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:42:40+00:00Added an answer on May 28, 2026 at 1:42 pm

    Ok, it’s been a while, but here is what i finally did to get it to work out for me, at this point i want to thank jbrookover for his quick answer.
    The solution however turned out to be a more “oldfasioned” one.

    In the case of using JQueryMobile, pages are stored in a cache, in order to reduce the cost of loading pages.
    This meant that the page from where one start also is stored in the cache, thus storing the way the different links are rendered in the Android phone, and the solution was taking advantage of oldfasioned HTML.
    By incorporating the following in the head section of the startpage,

     <meta http-equiv="Pragma" content="no-cache" />
     <meta http-equiv="Cache-control" content="no-cache" />
     <meta http-equiv="Expires" content="0" />
    

    this page was never stored in the JQueryMobile’s cache, and the javscript code,

    @Override
    public void renderHead(IHeaderResponse response) {
    log.info("Redirecting to " + redirectUrl);//to check via log
    
    // if the parent is the mobile app..
    response.renderOnDomReadyJavascript(
    "if(parent && parent.$ && parent.$.mobile){" +
    "parent.$('#logout').show();" +
    "parent.$('#login').hide();" +
    "parent.history.go(-2);" +                  
    "console.log('redirecting with jqm "+redirectUrl+"');" +//logging
    "}");
    

    was actually taking effect.

    Hopefully this may come to use for someone else having an issue with the JQueryMobile caching at some point.

    Sinc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.