How to realize frames in my own jspwiki

View: New views
3 Messages — Rating Filter:   Alert me  

How to realize frames in my own jspwiki

by acilo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I programmed my own folder tree for my JSPWiki and want to place it on the left side. I tried it with <div> Tags like this:
<div style="width:20%; white-space:nowrap; float:left;">
     <wiki:Include page="tree.jsp"/>
</div>
<div style="width:80%; white-space:nowrap; float:right;">
     <wiki:Include page="ViewTemplate.jsp"/>
</div>   in Wiki.jsp.
This works fine but when I click a link in the tree to open a page in the right content , left and right content reload instead of right content alone.

I also tried it with Frames like this:
 <frameset cols="250,*">
  <frame name="Navigation" target="Dates" src="tree.jsp">
  <frame name="Dates" src="ViewTemplate.jsp">
  <noframes>
    <body>
      <p> no Frames possible </p>
    </body>
  </noframes>
</frameset>
But this doesn't work. There is nothing on screen.

How can I fix this? Thank You!

Re: How to realize frames in my own jspwiki

by Janne Jalkanen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I also tried it with Frames like this:
> <frameset cols="250,*">
>  <frame name="Navigation" target="Dates" src="tree.jsp">
>  <frame name="Dates" src="ViewTemplate.jsp">
>  <noframes>
>    <body>
>      <p> no Frames possible </p>
>    </body>
>  </noframes>
> </frameset>
> But this doesn't work. There is nothing on screen.

You can't reference ViewTemplate.jsp directly; you need to reference  
one of the top-level files like Wiki.jsp.

The best is to use your first approach, and define a way to store the  
state in a cookie so that your tree.jsp knows how to open in the right  
bits of the tree opened.  You will need to do that anyway in order to  
store the state between different visits, so it's not that big of a  
problem.

You could also use AJAX, but then you end up with a problem that the  
location shown in the address bar will be different than the actual  
address of the page you're viewing, and then you're breaking things  
like bookmarking and back button, and that's not very nice either.

/Janne

Re: How to realize frames in my own jspwiki

by acilo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank You! I realized it with Frames now, but I will think about to do it with <div> Tags and store the tree with cookies.