2 Replies Latest reply on May 7, 2007 10:12 AM by Konstantin Kauz

    Javascript rerender

    Konstantin Kauz Novice

       

      <div id="suchen" style="float:left;margin-left:50px;">
       <a4j:region renderRegionOnly="true">
       <a4j:include viewId="inc/wsuch.xhtml" />
       </a4j:region>
      
       </div>



      function hallo(selector){
       if ( selector == 1) {
       $(such).show();
       $(gen).hide();
       }


      I do show divs with javascript and and rerender div(s:div) contain jsf + a4j pages, there are a way to rerender a div(s:div) with javascript in the same time while showing a div?


        • 1. Re: Javascript rerender
          Ilya Shaikovsky Master

          Describe please your case more presizelly. I mean step by step what you need perform on the page.

          • 2. Re: Javascript rerender
            Konstantin Kauz Novice

            Sorry! At first the View:

            <ui:define name="body">
             <script type="text/javascript" src="js/jquery.js" />
             <script type="text/javascript" src="js/jquery.treeview.js" />
             <script type="text/javascript">
             var $jq = jQuery.noConflict(); // Avoid conflicts with the RichFaces/Prototype library
             </script>
             <script type="text/javascript" src="js/control.js" />
             <script type="text/javascript">
             $jq(document).ready(function(){
             $jq("#browser").Treeview();
             hideAll();
             });
             </script>
            
             <div style="float:left;">
             <ul id="browser" >
             <li class="closed" ><img src="img/tree/folder.gif" /> WETTEN
             <ul>
             <li><img src="img/tree/file.gif" /><a href="javascript:show(1);" >Suchen</a></li>
             <li><img src="img/tree/file.gif" /><a href="javascript:show(2);" >Generelle Einstellungen</a></li>
             </ul>
             </li>
            
             </ul>
             </div>
             <div id="suchen" style="float:left;margin-left:50px;">
             <a4j:region renderRegionOnly="true">
             <a4j:include viewId="inc/wsuch.xhtml" />
             </a4j:region>
            
             </div>
             <div id="generell" style="float:left;margin-left:50px;">
             <a4j:region renderRegionOnly="true">
             <a4j:include viewId="inc/generel.xhtml" />
             </a4j:region>
            
             </div>
             </ui:define>


            Ul is a tree ul id="browser" if i cklick on the leaf a div like <div id="generell" will be shown,
            per javascript

            content of generel.xhtml:
            <div xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich"
             xmlns:s="http://jboss.com/products/seam/taglib">
            
            
             <a4j:form>
             <rich:panel style="width:800px;">
             <s:validateAll>
             <h:panelGrid id="pf" columns="3">
            
             <h:outputLabel for="minein" value="#{messages.minein}" /><h:inputText id="minein" value="#{setupgenerel.gs.minEinstatz}" required="true"/>
             <h:message for="minein"></h:message>
             <h:outputLabel for="mlive" value="#{messages.maxlive}" /><h:inputText id="mlive" value="#{setupgenerel.gs.maxLive}" required="true"/>
             <h:message for="mlive"></h:message>
             <h:outputLabel for="mgewinn" value="#{messages.maxgewinn}" /><h:inputText id="mgewinn" value="#{setupgenerel.gs.maxGewinn}" required="true"/>
             <h:message for="mgewinn"></h:message>
             <h:outputLabel for="qsrechts" value="#{messages.qspannerechts}" /><h:inputText id="qsrechts" value="#{setupgenerel.gs.qspanneRechts}" required="true"/>
             <h:message for="qsrechts"></h:message>
             <h:outputLabel for="qslinks" value="#{messages.qspannelinks}" /><h:inputText id="qslinks" value="#{setupgenerel.gs.qspanneLinks}" required="true" />
             <h:message for="qslinks"></h:message>
             <h:outputLabel for="mgewinnq" value="#{messages.maxgewinnq}" /><h:inputText id="mgewinnq" value="#{setupgenerel.gs.gquotte}" required="true"/>
             <h:message for="mgewinnq"></h:message>
             <h:outputLabel for="startg" value="#{messages.startg}" /><h:inputText id="startg" value="#{setupgenerel.gs.startg}" required="true"/>
             <h:message for="startg"></h:message>
             <h:outputLabel for="mineinzahlung" value="#{messages.mineinzahlung}" /><h:inputText id="mineinzahlung" value="#{setupgenerel.gs.minEin}" required="true"/>
             <h:message for="mineinzahlung"></h:message>
             <h:outputLabel for="maxauszahlung" value="#{messages.maxauszahlung}" /><h:inputText id="maxauszahlung" value="#{setupgenerel.gs.maxAus}" required="true"/>
             <h:message for="maxauszahlung"></h:message>
             <h:outputLabel for="maxwettenimw" value="#{messages.maxwettenimw}" /><h:inputText id="maxwettenimw" value="#{setupgenerel.gs.maxwetimW}" required="true"/>
             <h:message for="maxwettenimw"></h:message>
             <h:outputLabel for="rlimit" value="#{messages.rlimit}" /><h:inputText id="rlimit" value="#{setupgenerel.gs.rlimit}" required="true"/>
             <h:message for="rlimit"></h:message>
             </h:panelGrid>
             </s:validateAll>
             </rich:panel>
             <a4j:commandButton value="#{messages.aktualb}" action="#{setupgenerel.saveSetup}" reRender="pf"/>
             <a4j:outputPanel ajaxRendered="true">
             <h:messages globalOnly="true" />
             </a4j:outputPanel>
             </a4j:form>
            
            </div>


            The form in generel.xhtml has to be rerender, per javascript event on client site