8 Replies Latest reply on Sep 6, 2007 1:43 AM by Tomislav Jakopec

    form has no properties

    Tomislav Jakopec Novice

      when I use t:commandLink in modalpanel I get following javascript error, form doesn't submit


      Error: form has no properties
      Source File: http://localhost:8080/kadrovska/a4j_3_1_0-SNAPSHOTorg.ajax4jsf.javascript.AjaxScript
      Line: 46



      But when I use t:commandButton everything is fine

      This is my code (working)

      <t:commandButton id="odabirJedne" action="traziRadj"
       styleClass="traziOdaberiJedan" value="#{v.naziv.naziv}"
       title="#{messages['zajednicke.odaberi']}"
       onclick="odaberiJedan(this,#{rb});"
       onmouseover="this.style.background= 'white'"
       onmouseout="this.style.background= '';"
       rendered="#{traziRadj.traziJedan}" />
      


      code (not working)
      <t:commandLink id="odabirJedne" action="traziRadj"
       styleClass="traziOdaberiJedan" value="#{v.naziv.naziv}"
       title="#{messages['zajednicke.odaberi']}"
       onclick="odaberiJedan(this,#{rb});"
       rendered="#{traziRadj.traziJedan}" />
      


      javacsript function
      function odaberiJedan(e,i){
       var s = e.id.substring(0,e.id.lastIndexOf(":"));
       var prviDioNaziva =s.substring(0,s.lastIndexOf(":"));
       var ie = document.getElementById(prviDioNaziva + ":" + i + ":oznacen");
       ie.checked = true;
      }
      


      Working environment:
      SEAM 2.0.5 BETA
      RichFaces 3.1.0. SNAPSHOT (build this morning)

        • 2. Re: form has no properties
          Ilya Shaikovsky Master

          are you sure you have form element around your control?

          • 3. Re: form has no properties
            Tomislav Jakopec Novice

            yes

            <r:modalPanel id="traziRadj" height="450" width="320" moveable="false"
             resizeable="false">
             <f:facet name="header">
             <t:outputText value="#{messages['zajednicke.traziRadj']}" />
             </f:facet>
            
             <f:facet name="controls">
             <h:graphicImage value="/slike/ikone/close.png" style="cursor:pointer"
             styleClass="gradualshine" onmouseover="slowhigh(this)"
             onmouseout="slowlow(this)"
             onclick="Richfaces.hideModalPanel('traziRadj')" />
             </f:facet>
            
             <h:form id="formaTraziRadj">
            
             <r:dataTable id="tablicaRadj" width="100%"
             onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
             onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
             cellpadding="0" cellspacing="0" var="v" rowKeyVar="rb"
             value="#{traziRadj.rezultati}">
            
             <r:column>
             <t:commandLink id="odabirJedne" action="traziRadj"
             styleClass="traziOdaberiJedan" value="#{v.naziv.naziv}"
             title="#{messages['zajednicke.odaberi']}"
             onclick="odaberiJedan(this,#{rb});" />
             </r:column>
             </r:dataTable>
            
             </h:form>
            </r:modalPanel>
            


            • 4. Re: form has no properties
              Ilya Shaikovsky Master

              You sure that you doesn't include your modal to some external form? (nested forms arent allowed)

              • 5. Re: form has no properties
                Tomislav Jakopec Novice

                 


                You sure that you doesn't include your modal to some external form? (nested forms arent allowed)


                yes I am sure.

                Everything is working fine if I use t:commandButton

                this is code of page

                <%@ page contentType="text/html; charset=UTF-8"%>
                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
                <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
                <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>
                <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
                <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="r"%>
                <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a"%>
                
                <f:view>
                 <html>
                 <%@ include file="/core/predlozak/Glava.jsp"%>
                 <body>
                 <%@ include file="/core/predlozak/Navigator.jsp"%>
                
                 <h:form id="forma">
                
                 ...
                
                 <t:graphicImage value="/slike/ikone/novaGrana.png"
                 title="#{messages['zajednicke.traziRadj']}" style="cursor:pointer">
                 <a:support event="onclick" reRender="traziRadj"
                 oncomplete="Richfaces.showModalPanel('traziRadj');document.getElementById('formaTraziRadj:naziv').focus();">
                 <a:actionparam value="true" assignTo="#{traziRadj.traziJedan}" />
                 </a:support>
                 </t:graphicImage>
                
                 ...
                
                 </h:form>
                 <%@ include file="/core/maticni/radne/TraziRadj.jsp"%>
                 <%@ include file="/opci/maticni/sifarnici/mjesto/TraziMjesto.jsp"%>
                 <%@ include file="/core/predlozak/Podnozje.jsp"%>
                 </body>
                 </html>
                </f:view>
                


                modal panel is in /core/maticni/radne/TraziRadj.jsp

                • 6. Re: form has no properties
                  Tomislav Jakopec Novice

                  still a problem!

                  • 7. Re: form has no properties
                    Ilya Shaikovsky Master

                    sorry for the delay. If your links depends on rendered attribute and updated via ajax - then you should use a4j:form and a4j:htmlCommandLinks instead standard ones to get it working.

                    • 8. Re: form has no properties
                      Tomislav Jakopec Novice

                      It's working, tnx!