ontopia / ontopia

The open source tools for building, maintaining and deploying Topic Maps-based applications.
https://ontopia.net
Apache License 2.0
54 stars 12 forks source link

problem with using <tolog:set> in <tolog:if> and then use the variable elsewhere #443

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

I have that easy code in my JSP file:

  <tolog:if var="PROMENA_HRY6">
     <tolog:set var="PROMENA_HRY9" reqparam="idv1"/>
    <tolog:out var="PROMENA_HRY9"/>
  </tolog:if> 

I want to use variable "PROMENA_HRY9" in code after the <tolog:if> ends, but 
when i want to use that variable PROMENA_HRY9 it reports an error and looks 
like that variable dont even exist, please help me what should i do, thank you

Jan Hruska

Original issue reported on code.google.com by JanHrusk...@gmail.com on 15 Apr 2012 at 1:10

GoogleCodeExporter commented 9 years ago
The tolog tags that act as blocks use lexical scope, as specified in the 
documentation [1]. This means that variables defined within a tolog:if tag, are 
only available within that if block. If you want to use the variable outside 
the if block, you will need to declare it outside of the if block.

 [1] http://www.ontopia.net/doc/current/navigator/tolog-taglib.html#N1004B

Original comment by qsieb...@gmail.com on 16 Apr 2012 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by qsieb...@gmail.com on 17 Apr 2012 at 9:19