Announcement Announcement Module
Collapse
No announcement yet.
how to prevent on-render call on a first popup display Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to prevent on-render call on a first popup display

    Hi there,

    I've got the following scenario. User opens a window with a search filed and with a list of images below it. Since this is a "popup" i need to call <render fragments> in <on-entry> action in order to display it. However this action triggers service.getImagesByName method which doesn't make sense because the requestParameters.imageName parameter will not be present at this time. It make sense to call this method only from the findImage (service.getImagesByName) and deleteImage transitions.
    Is it possible to prevent this call while accessing this view state without requestParameters.imageName or do I need completely rebuild my view-state definition? Here it is:

    Code:
    <view-state id="insertImage" popup="true">
    		<on-entry>
    			<render fragments="insertImageForm" />
    		</on-entry>
    		<on-render>
    			<evaluate expression="service.getImagesByName(requestParameters.imageName)" result="viewScope.images" result-type="dataModel"/>
    		</on-render>
    		<transition on="loadImage" to="composeEmail">
            	<set name="flowScope.image" value="images.selectedRow" />
        	</transition>
    		<transition on="findImage">
    			<render fragments="insertImageForm" />
    		</transition>
    		<transition on="deleteImage">
    			<set name="flowScope.image" value="images.selectedRow" />
    			<evaluate expression="service.deleteImage(flowScope.image.id)" />
    			<render fragments="insertImageForm" />
    		</transition>
    		<transition on="cancel" to="composeEmail" bind="false" validate="false" />
    	</view-state>
    Thanks in advance.

    Regards,
    Krzysztof
Working...
X