4 Replies Latest reply on Feb 10, 2009 2:47 PM by nimo stephan

    contextMenu and param

    nimo stephan Master

      I have this:

      <h:form>
       <a4j:region>
       <rich:dataTable id="mdb" value="#{users}" var="u" rows="9">
      
      <rich:componentControl event="onRowClick" for="menuView" operation="show">
      <f:param name="login" value="#{u.login}" />
       </rich:componentControl>
      
      
      <rich:column filterBy="#{u.login}" filterEvent="onkeyup">
      <f:facet name="header">
      <h:outputLabel value="login"/>
      </f:facet>
       <h:outputText value ="#{u.login}"/>
      </rich:column>
      
      ...
      
      </rich:dataTable>
      
      <rich:contextMenu attached="false" id="menuView" submitMode="ajax" hideDelay="0" showDelay="0">
      <rich:menuItem>
      hallo #{login}
      <a4j:actionparam ../>
      </rich:menuItem>
      </rich:contextMenu>
      </a4j:region>
      </h:form>
      


      When clicking a row, then the param login is not shown (transferred).

      This text occurs in my menu: "Hello, " instead of "Hello, Tim". You see the login is missing.

      I have tried it also with <ui:param and with params-attribute. Nothing works. (I use rf 3.3.0)

        • 2. Re: contextMenu and param
          nimo stephan Master

          thanks, now it works!!

          My mistake was:

          I have used this:

          <ui:param name="ref" value="#{i.name}"/>


          instead of

          <f:param name="ref" value="#{i.name}"/>


          So you see, we cannot use ui:param (for strange reason..)

          By the way, you cannot pass Objects within f:param!?

          Something like:

          <f:param name="ref" value="#{i}"/>

          does not work:

          javax.faces.FacesException: java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils
           at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1553)
           at org.ajax4jsf.renderkit.RendererUtils.encodeAttribute(RendererUtils.java:446)
           at org.richfaces.renderkit.AbstractExtendedRowsRenderer.encodeRowEvents(AbstractExtendedRowsRenderer.java:233)
           at org.richfaces.renderkit.AbstractExtendedTableRenderer.encodeRowStart(AbstractExtendedTableRenderer.java:725)
           at org.richfaces.renderkit.AbstractExtendedTableRenderer.encodeOneRow(AbstractExtendedTableRenderer.java:625)
           at org.richfaces.renderkit.AbstractExtendedRowsRenderer.process(AbstractExtendedRowsRenderer.java:136)
           at org.richfaces.model.ModifiableModel.walk(ModifiableModel.java:149)
           at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:1151)
           at org.richfaces.renderkit.AbstractExtendedRowsRenderer.encodeRows(AbstractExtendedRowsRenderer.java:159)
           at org.richfaces.renderkit.AbstractExtendedRowsRenderer.encodeRows(AbstractExtendedRowsRenderer.java:142)
           at org.richfaces.renderkit.AbstractExtendedRowsRenderer.encodeChildren(AbstractExtendedRowsRenderer.java:191)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:57)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:299)
          



          • 3. Re: contextMenu and param
            Nick Belaevski Master

            Hi,

            Looks like commons-beanutils .jar is missing in application classpath.

            • 4. Re: contextMenu and param
              nimo stephan Master

              yes, you are right:

              commons-beanutils.jar is only in my WAR, but not in my EAR.

              But in my view, I use ui:param very often without the need to put the jar in my EAR. Only richfaces needs it? So I guess, I use f:param in rich:menuItem instead of putting the jar in my EAR only for this special case. Okay?

              Hmm..by the way, does Richfaces needs this jar for other components as well? Should I put this jar in general both in WAR and EAR?
              (Maybe this can be the reason for http://www.jboss.org/index.html?module=bb&op=viewtopic&t=149795&start=10, which I have not solved yet.)