Menu

Problem with a page included in a library

2006-11-23
2013-03-22
  • Nobody/Anonymous

    Hi, I included the menu in a page that is within a library, and the menu thrown javascript errors. I've taken a look at the resulting javascript code, and the problem appears to be the unique id generated by the menu, because it includes a ':' character between the library id and the page id. I'm going to import the source code and modify it, but I'd like to see the problem fixed in an official release.

     
    • perseios

      perseios - 2006-11-24

      Of course as soon as you send me a patch I will make it a release, because it is a pretty disturbing bug.
      Recently I learned that there is actually some (kind of well-hidden) little API in Tapestry of how to create unique ids and how to put them on the request cycle.
      Tapestry learning curve never ends.

      thank you very much for active helping

       
    • Nobody/Anonymous

      Hi, I'm posting the change I've made (they are marked in bold)

          protected void renderComponent(IMarkupWriter wr, IRequestCycle cyc) {       
              if(trace){
                startTime = System.currentTimeMillis();       
              }
             
              String prefix = getPrefix();
              String uniqueID = TapestryUtils.convertTapestryIdToNMToken(getExtendedId() + "/divId").replaceAll("[/\\.]", "_");
              <b>uniqueID = uniqueID.replace(':', '_');</b>
              String nodePropertiesUniqueID = "NP" + uniqueID;

       
    • Nobody/Anonymous

      I'm afraid it was not marked as bold at all, but its only the line with the following code:

      uniqueID = uniqueID.replace(':', '_');

      That's the solution, because the '_' character can be part of a valid javascript identifier and ':' couldn't.

       
    • perseios

      perseios - 2006-12-06

      I made a formal bug report, made the changes in the code and I am going to release it now.
      However I didn't test the changes you suggested.
      Thanks again.

       

Log in to post a comment.