Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
123
rated 0 times [  125] [ 2]  / answers: 1 / hits: 6735  / 10 Years ago, wed, november 5, 2014, 12:00:00

Primefaces 5



I have following example:



<script>

function init () {
$(#myspan).doSomething;
}
</script>

<h:form rendered=some condition>
<span id=myspan />

</h:form>


How to automaticaly call init() every time form will be updated ?


More From » jsf

 Answers
4

To rerun a script, simply re-render the tag that calls it. Assuming the form is re-rendered whenever it is updated, this will do:



<script>

function init () {
$(#myspan).doSomething;
}
</script>

<h:form rendered=some condition>
<script type=text/javascript>init()</script>
<span id=myspan />

</h:form>

[#41462] Tuesday, November 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stephonkeandrer

Total Points: 392
Total Questions: 94
Total Answers: 100

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;