1

I have a "ui:define" in my jsf like this :

<ui:define name="javaScript">

<script type="text/javascript"> #{PendingTree.buildHistoryForTree} </script>
<script type="text/javascript"> #{PendingTree.buildDescriptionForTree} </script>

<script type="text/javascript">
  .
  .
  .
</script>
</ui:define>

I want to refresh the ui:define if some event have been done; how can I do this job ?

omid haghighatgoo
  • 322
  • 1
  • 3
  • 16

1 Answers1

1

You can only ajax-update JSF components.

Wrap it in a JSF component (provided that you placed this inside (bottom of) <h:body>).

<h:panelGroup id="scripts" layout="block">
    <ui:define name="scripts">
        <h:outputScript>
            #{bean.script1}
            #{bean.script2}
            .
            .
            .
        </h:outputScript>
    </ui:define>
</h:panelGroup>

Then you can reference it like below:

<f:ajax ... render=":scripts" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555