Can anyone offer an elegant solution to this (i.e. some JSF functionality that solves this problem)

 

I have various command components in a tile. I need to put this tile at the top and bottom of a data table. I had it working by having the form defined within the command component tile, but I also need my datatable in the form so I moved the form out of the command component tile and up to the layout. It now looks like this

 

 

<h:form>

     

<f:subview id="page-header">

      <tiles:insert attribute="page-header"/>

</f:subview>

<f:subview id="body">

      <tiles:insert attribute="body">

      </tiles:insert>

</f:subview>

<f:subview id="page-footer">

      <tiles:insert attribute="page-footer"/>

</f:subview>

 

</h:form>

 

Where page header and footer are the same command component tile. This fixed being able to have inputs in the dataTable, but broke the inputs in the command tile because now the input gets submitted twice because it is included twice.

 

 

Tiles Config:

 

      <definition name="/admin/events/event_viewer.tiles" extends="layout.basic">

            <put name="body" value="/admin/events/event_viewer.jsp"/>

            <put name="page-header" value="/admin/events/event_btns.jsp"/>

            <put name="page-footer" value="/admin/events/event_btns.jsp"/>

      </definition>

 

 

I can always write some fancy js to disable the other input onchnge so only one gets submitted, but I was hoping for a more elegant solution that either JSF provides OR even a basic web solution seeing as how this isn’t really a JSF issue,

 

 

Command Component Tile that is included top and bottom of a dataTable (This used to work when it had its own form):

 

<h:panelGrid columns="3">

<h:commandButton value="Show Closed Events" actionListener="#{eventDataList.togleShowClosed}"/>

<h:commandButton value="Mark Open Events to Working" actionListener="#{eventDataList.setOpenToWorking}"/>

      <h:commandButton value="Update Event Status" onclick="submit('eventTableForm')" />

      <h:inputText onchange="submit()" value="#{eventDataList.recordsPerPage}"  />

</h:panelGrid>

 

<h:panelGrid columns="2">

      <h:selectBooleanCheckbox value="#{eventDataList.filterByDate}" onchange="submit()"/>

      <h:panelGroup>

    <t:inputDate

                  value="#{eventDataList.from}"

                  type="both"

                popupCalendar="false"/>

    <t:inputDate

                  value="#{eventDataList.to}"

                  type="both"

                popupCalendar="false"/>

</h:panelGroup>



NOTICE: This message, including all attachments transmitted with it, is for the use of the addressee only. It may contain proprietary, confidential and/or legally privileged information belonging to Litle & Co. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message. If you believe you have received this message in error, please delete it and all copies of it from your system and notify the sender immediately by reply e-mail. Thank you.

Reply via email to