1 Reply Latest reply on Jul 13, 2007 12:34 PM by roykachouh

    Ajax4JSF General Usage Question

    roykachouh

      Hey Sergei and crew,

      I need some general help with a problem I am facing.

      I have an application that can render multiple data tables with the same column definitions. So as a result, I created a 'widget' that abstracts the column definitions into a single file. Whenever I need to use that widget, I make use of the <ui:include> tag.

      Now, I have some ajax requests bound to an action performed on one of the columns, but I would like to have different actions performed based on the actual data set in the data table.

      For example, i would like to do something like this:

      <rich:dataTable rows="10" cellpadding="0" cellspacing="0" width="460" border="0" onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      var="action" value="" id="resultTable">
      <ui:include src="includes/actionTableDefinition.xhtml"/>
      </rich:dataTable>
      


      The includes/actionTableDefinition.xhtml makes a call to an AJAX listener, i want the AjaxListener to be aware of who is the orginating calling component, in this case the rich data table that iterates over #{API.dashboard.newActions}, but if it were another rich data table i would want it to do something else

      I would like to have the ability of one single ajax listener to check a property that tells it the calling component, and react accordingly. So when the data table contains
      #{API.dashboard.newActions}
      , but if it contained something else it will do another.

        • 1. Re: Ajax4JSF General Usage Question
          roykachouh

          Nevermind...

          I got it...

          It was easy as wrapping an <aj4:region> around an <f:param>, as you can tell, I am still kinda new to JSF :)

          <a4j:region>
          <f:param id="componentIdNewAction name="componentIdNewActions" value="NEW_ACTIONS_TABLE" binding="#{SEND_OPEN_REQUEST_AJAX.callingComponent}"/>
          </a4j:region>