3

This is regarding a JavaEE web application which uses JSF, JPA and Primefaces.

In a large JSF page, a table needs to be populated by a list of items. The first column display the name of the items as an output label. The second column has an input text to record user input. The third column displays a value which is calculated considering several factors and take a relatively long time.

I want to display the page with data for the first two columns, but the third Colum data need to be filled after the complete page is displayed to the user. This is to minimize the user waiting a long time before starting the data entry. As the user starts seeing the page, the third column needs to be populated as the data is made available.

Is this possible to be achieved in JSF? If needed I can use OminiPages, but not technologies like Spring and Struts.

    <table>
        <ui:repeat id="rptItems" 
                   value="#{clientEncounterComponentItemController.items}" 
                   var="ii" >
            <tr>
                <td>
                    <p:outputLabel for="itStC" value="#{ii.name}" ></p:outputLabel>
                </td>
                <td>
                    <p:inputText id="itStC" value="#{ii.shortTextValue}" >
                    </p:inputText>
                </td>
                 <td>
                    <h:panelGroup rendered="#{ii.displayLastResult}" >
                        <p:outputLabel  id="lblResult"  value="#{clientEncounterComponentItemController.findFormsetValue(ii)}" ></p:outputLabel>
                    </h:panelGroup>
                </td>
            </tr>
        </ui:repeat>
    </table>
Buddhika Ariyaratne
  • 2,339
  • 6
  • 51
  • 88
  • 3
    You can have an ajax response to update the "lblResult" label on the focus event of "itStc" inputText. – Sunila SS Nov 30 '19 at 05:45
  • 3
    The user may benefit to see the values in most of "lblResult" labels before actually start entering data. For example, the user may not start to enter data to the 3rd row without seeing the results of the fifth row as the data in table are inter-related. – Buddhika Ariyaratne Nov 30 '19 at 05:49
  • 2
    You can find all the values needed for the page with the request and display together. – Niluka Gunasekara Nov 30 '19 at 07:21
  • As there is a large number of elements and as the algorithm that generates the value takes time, the display of the page is delayed by about 15 seconds. The users do not like that. – Buddhika Ariyaratne Nov 30 '19 at 07:23
  • 2
    Did you try p:outputPanel with deferred loading? (Will result in 1 AJAX request per cell ..) – Selaron Dec 02 '19 at 07:52
  • That worked for me. I can accept it as the answer if you convert this to an answer. Thank you. – Buddhika Ariyaratne Dec 03 '19 at 04:55

0 Answers0