You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Bertrand, Shawn R" <sh...@tycoelectronics.com> on 2008/07/01 16:52:49 UTC

Table variable not available via VariableResolver during stamping

(Trinidad 1.0.8, JSF 1.1_01)

 

We have a situation where we need to access the object of each table row
during stamping in order to render the "detailStamp" facet.  Our table
tag looks like this:

 

      <tr:table id="pickTable"
binding="#{SnmpSsMacHelper.servicesTable}"

                value="#{SnmpSsMacHelper.serviceList}" var="row"
rows="5"

                rowBandingInterval="1" rowSelection="multiple">

        <f:facet name="actions">

          <tr:panelHorizontalLayout>

                      <tr:commandButton id="delRow"
text="#{msg.buttonDelete}"

                                        partialSubmit="true"

 
disabled="#{SnmpSsMacHelper.disableSubmit}"

 
actionListener="#{SnmpSsMacHelper.processSvcDelete}"/>

                      <tr:commandButton id="associateRow"
text="#{msg.buttonAssociate_Selected}"

                                        partialSubmit="true"

 
disabled="#{SnmpSsMacHelper.disableSubmit}"

 
actionListener="#{SnmpSsMacHelper.processSvcAssociate}"/>

                      <tr:commandButton id="disassociateRow"
text="#{msg.buttonDisassociate_Selected}"

                                        partialSubmit="true"

 
disabled="#{SnmpSsMacHelper.disableSubmit}"

 
actionListener="#{SnmpSsMacHelper.processSvcDisassociate}"/>

                    </tr:panelHorizontalLayout>

        </f:facet>

        <f:facet name="detailStamp">

          <tr:panelGroupLayout id="svcDetails"
binding="#{SnmpSsMacHelper.serviceBean.detailStampComponent}"/>

        </f:facet>

        <tr:column>

          <f:facet name="header">

            <tr:outputText value="#{msg.textName2}"
styleClass="#{row.operationStyleSheet}"/>

          </f:facet>

          <tr:outputText value="#{row.name}"
styleClass="#{row.operationStyleSheet}"/>

        </tr:column>

        <tr:column>

          <f:facet name="header">

            <tr:outputText value="#{msg.textDescription}"
styleClass="#{row.operationStyleSheet}"/>

          </f:facet>

          <tr:outputText value="#{row.description}"
styleClass="#{row.operationStyleSheet}"/>

        </tr:column>

        <f:facet name="footer" >

          <tr:commandButton id="addService" partialSubmit="true"
useWindow="true"

                            rendered="#{SnmpSsMacHelper.disableSubmit ==
false}"

                            action="dialog:addService"
text="#{msg.buttonAdd_Service}"

 
launchListener="#{SnmpSsMacHelper.processAddServiceLaunch}"

 
returnListener="#{SnmpSsMacHelper.returnFromServiceAdd}" />

        </f:facet>

      </tr:table>

 

And the code behind the
"SnmpSsMacHelper.serviceBean.detailStampComponent" method binding is:

 

    public CorePanelGroupLayout getDetailStampComponent()

    {

        Class[] launchType = new Class[]{LaunchEvent.class};

 

        // Create wrapper layout

        detailComp =
UIComponentFactory.createPanelGroup(CorePanelGroupLayout.LAYOUT_VERTICAL
, Boolean.TRUE);    

    

        FacesContext context = FacesContext.getCurrentInstance();

        SnmpSsServiceTO service = (SnmpSsServiceTO)

 
context.getApplication().getVariableResolver().resolveVariable(context,
"row");

                .

                .

                .

                .

    }

 

The service variable above always ends up being null.  Is it because the
variable cannot be resolved until all the rows have been stamped?  If
so, how can we conditionally render each row without accessing the
object for that row?

 

Thanks in advance,

 

Shawn Bertrand

Tyco Electronics Corporation