11 Replies Latest reply on Mar 4, 2011 12:11 PM by snaker

    popup onload

    snaker

      I want open a popup on load the page, but i use template, and my pages start with <ui:composition>, and not for <html>, so i can't use <body onload="">

       

      There is something similar to open popup onload?

        • 1. popup onload
          boy18nj

          Use jquery-

           

          Example

           

          <script type="text/javascript">

          jQuery(document).ready(function() {

          jQuery('#sequences').find('input[type=button]').each(function(i) {

          jQuery(this).click(function() {

          });

          • 2. popup onload
            snaker

            I put that code in my page but it do nothing...

            there is somo ajax method in richfacer for it?

            • 3. Re: popup onload
              ilya40umov

              Look at http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_jQuery.html

              It has what indeed you wanted(if you wanted to show popup by JS command):

              onload — applying a query when a document is loaded;

               

               

              In RF 3.3.3 modalPanel has an attribute "showWhenRendered":

               

              showWhenRenderedfalsefalsejavax.el.ValueExpression
              (must evaluate to boolean)
              If "true" value for this attribute makes a modal panel opened as default. Default value is "false"
              1 of 1 people found this helpful
              • 4. popup onload
                ilya40umov

                In RF 4.0 popupPanel has the following list of attributes(I guess you should try set "show" to true):

                 

                  <tag>

                        <tag-name>popupPanel</tag-name>

                        <component>

                            <description>JSF component class</description>

                            <component-type>org.richfaces.PopupPanel</component-type>

                            <renderer-type>org.richfaces.PopupPanelRenderer</renderer-type>

                        </component>

                        <attribute>

                            <name>autosized</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>

                            <icon />

                            <name>binding</name>

                            <type>javax.faces.component.UIComponent</type>

                        </attribute>

                        <attribute>

                            <name>controlsClass</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>domElementAttachment</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>followByScroll</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>header</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>headerClass</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>height</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>

                            <display-name>Component Identifier</display-name>

                            <icon />

                            <name>id</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>keepVisualState</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>left</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>maxHeight</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <name>maxWidth</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <name>minHeight</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <name>minWidth</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <name>modal</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>moveable</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>onbeforehide</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onbeforeshow</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onhide</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskclick</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskcontextmenu</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskdblclick</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskmousedown</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskmousemove</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskmouseout</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskmouseover</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmaskmouseup</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onmove</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onresize</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>onshow</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>overlapEmbedObjects</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>

                            <display-name>Rendered Flag</display-name>

                            <icon />

                            <name>rendered</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>resizeable</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>shadowDepth</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>shadowOpacity</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>show</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>style</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>styleClass</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>top</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>trimOverlayedElements</name>

                            <type>boolean</type>

                        </attribute>

                        <attribute>

                            <name>visualOptions</name>

                            <type>java.lang.String</type>

                        </attribute>

                        <attribute>

                            <name>width</name>

                            <type>int</type>

                        </attribute>

                        <attribute>

                            <name>zindex</name>

                            <type>int</type>

                        </attribute>

                    </tag>

                • 5. popup onload
                  snaker

                  I have seen...

                   

                  <script type="text/javascript">

                  jQuery(document).ready(function() {

                       alert('hello');

                  });

                  </script>

                   

                  it works and:

                   

                  <h:popupPanel show="true"> works very good, and noe my next step is call my bean before open popup on load and on close the popup, is that posible?

                  • 6. popup onload
                    ilya40umov

                    1) You can use a4j:jsFunction to call whatever you want on the server after some JS events. You can also use a4j:commandButton for closing your popup in this case an action will be performed via ajax call but you can close popup before it's completed.

                    2) I also think that you maybe need to call your server method before page is rendered and then just simply show popup. But it's for you to decide how to implement your requirements.

                    • 7. popup onload
                      snaker

                      but a4j:jsFunction only call to js function i think...or Can i call a one method of my bean with jsFunction?

                      • 8. popup onload
                        ilya40umov
                        1 of 1 people found this helpful
                        • 9. popup onload
                          snaker

                          ok, i understand this:

                          <span onmouseover="updateName('Kate')"  onmouseout="updateName('')">Kate</span>

                          <h:outputText id="showname" value="#{userBean.name}" />

                          <a4j:jsFunction name="updateName" reRender="showname">
                                <a4j:actionparam name="param1" assignTo="#{userBean.name}"  />                 
                          </a4j:jsFunction>

                           

                          but,

                           

                          <a4j:jsFunction name="callScript" data="#{bean.someProperty1}" reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">

                                  <a4j:actionParam name="param_name" assignTo="#{bean.someProperty2}"/>

                          </a4j:jsFunction>

                           

                          i dont understand the funcionally of "data", and

                          oncomplete="myScript(data.subProperty1, data.subProperty2)

                          myScript is another script???

                          data.subProperty1, what is "data."

                           

                          • 11. popup onload
                            snaker

                            thanks, i start to know the funcionally