Created
June 10, 2013 09:06
-
-
Save EmmanuelDemey/5747419 to your computer and use it in GitHub Desktop.
How to execute the reveal widget in an element contained by an updated Tapestry zone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Import(library = {"${assets.path}/mixins/reveal/jquery.reveal.js",}, | |
stylesheet={"${assets.path}/mixins/reveal/reveal.css"}) | |
public class Reveal { | |
@InjectComponent | |
private org.apache.tapestry5.corelib.components.Zone zzzone; | |
@Inject | |
private AjaxResponseRenderer ajaxResponseRenderer; | |
@Property @Persist | |
private Integer i; | |
void setupRender(){i = 0;} | |
void onActionFromUpdateZone() { | |
i++; | |
ajaxResponseRenderer.addRender(zzzone); | |
ajaxResponseRenderer.addCallback(new JavaScriptCallback() { | |
public void run(JavaScriptSupport javascriptSupport) { | |
javascriptSupport.addScript("jQuery('%s').addClass('reveal-modal'); jQuery('%s').reveal({});", ".reveal_box_inside_zone",".reveal_box_inside_zone"); | |
} | |
}); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<t:actionLink t:zone="zzzone" t:id="updateZone">update</t:actionLink> | |
<t:zone t:id="zzzone" id="zzzone"> | |
<div t:type="jquery/revealElement" t:id="revealThis" class="reveal_box_inside_zone"> | |
<p id="test2">I want to be revealed, dude. ${i}</p> | |
</div> | |
</t:zone> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment