Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
web grid with buttons on each row
posted

Hi,

I have the following table:

<body>
  <f:view>
    <h:form id="assetOverviewForm"> 
        <h:outputText value="#{gui['assets.overview']}" styleClass="heading2"/>
         
      <ig:gridView
           dataSource="#{assetOverviewController.allAssets}"
           pageSize="10">
        <f:facet name="header">
          <h:outputText value="#{gui['assets.listHeading']}" />
        </f:facet>
        <ig:column sortBy="publicId">
            <f:facet name="header">
              <h:outputText value="#{gui['asset.id']}" />
          </f:facet>
          <h:outputText value="#{DATA_ROW.publicId}" />
        </ig:column>
          <ig:column>
            <h:commandLink action="#{assetDetailController.showAssetDetail}">
              <h:graphicImage value="images/buttonDetail.gif" style="border: 0px" />           
              <f:param name="id" value="#{DATA_ROW.id}"/>                               
            </h:commandLink>
         
            <h:commandButton image="images/icon_remove.gif" 
                action="#{assetOverviewController.deleteAsset}" value="#{gui['delete']}"
                onclick="if (!confirm('#{gui['asset.removeConfQuestion']}')) return false; else setIdForRemoving('#{DATA_ROW.id}');">                               
            </h:commandButton>                                                    
          </ig:column>
      </ig:gridView>
       
      <h:inputHidden id="assetRemoveId" value="-1"></h:inputHidden>
     
      <h:commandLink action="#{assetController.showAssetAdding}">           
          <h:outputText value="#{gui['asset.addNew']}" />                               
      </h:commandLink>                   
    </h:form>
  </f:view>
</body>

 

Functionality should be as follows: each row contains two commands for detail and for deletion. Confirmation dialog must be opened before deletion-operation.

When there is only button for deletion then everything works fine - user clicks, confirmation dialog is opened. But when I add commandLink then it doesn't work - no confirmation dialog is opened and form is submitted. Also table sorting doesn't work with two commands.

I found out that this is because JS error - "curForm is undefined". It seems that JSF engine createdwrong page ?!?

Please I would very appreciate any help.

Thank you in advance,

ANECT