Announcement Announcement Module
No announcement yet.
Problem getting view to render in one particular case Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem getting view to render in one particular case

    Hello, I have an issue with getting Spring Webflow and would be grateful for any help. The problem is with displaying a view state when called from a certain page. It works elsewhere.

    I have a flow that exports data to Excel. It is called as a subflow from other flows, and works fine in all but one case. The export subflow first displays a popup where the user can select which columns to export, and upon submit spits out the file. In the case where it doesn't work it does the preliminary preparations, including entering the view state in question but never shows the popup.

    This is the flow, with some added traces:

    "caller" is a string naming the caller so that the correct modelCreator can be selected
    "dataSource" is used by the modelCreator to normalize the raw data into a common form the exporter can use, and in some cases (but not this one) to figure out what columns are available for export.

    <?xml version="1.0" encoding="UTF-8"?>
    <flow xmlns=""
        <input name="caller" required="true"/>
        <input name="dataSource" required="true"/>
        <action-state id="selectModelCreator">
            <evaluate expression="modelCreatorSelector.get(caller)" result="flowScope.modelCreator"/>
            <transition to="availableColumns"/>
        <action-state id="availableColumns">
            <evaluate expression="modelCreator.findAvailableHeaders(dataSource)" result="flowScope.kolumner"/>
            <transition to="selectColumns">
                <evaluate expression="modelCreator.trace('transition availableColumns -> selectColumns')"/>
        <view-state id="selectColumns" view="smb/export/excel" model="flowScope.kolumner">
                <evaluate expression="modelCreator.trace('entering selectColumns')"/>
                <evaluate expression="modelCreator.trace('kolumner = ' + kolumner)"/> 
                <evaluate expression="modelCreator.trace('rendering selectColumns')"/> <!-- IT COMES HERE BUT NO FURTHER -->
            <transition on="submit" to="prepareData">
                <evaluate expression="modelCreator.trace('transition selectColumns -> submit')"/>
                <evaluate expression="modelCreator.trace('exiting selectColumns')"/>
        <action-state id="prepareData">
            <evaluate expression="modelCreator.prepareModel(dataSource, requestParameters.sortorder, flowScope.kolumner.kolumner)" result="flowScope.exportData"/>
            <transition to="xlsDownload"/>
        <view-state id="xlsDownload" view="excelExportView"/>
        <bean-import resource="exportExcel-flow-beans.xml"/>

    Here is how it is called:

    <view-state id="overview" view="#{flowScope.view}">
    			<evaluate expression="formAction.setupForm"/>
            <transition on="downloadExcel" to="exportFrOverview"/>        
        <subflow-state id="exportFrOverview" subflow="exportExcel-flow">
           <input name="caller" value="'overview'"/>
           <input name="dataSource" value="items"/>
    Here is another example that works:

    	<view-state id="edit" view="#{flowScope.view}">
    			<evaluate expression="formAction.setupForm"/>
            <transition on="downloadExcel" to="exportFrEdit"/>
        <subflow-state id="exportFrEdit" subflow="exportExcel-flow">
           <input name="caller" value="'edit'"/>
           <input name="dataSource" value="details"/>
    The flow is called from a link:
    <a href="javascript:newWindowNoCache('flow?_flowId=va rious-flow&_flowExecutionKey=e5s1&_eventId=downloadExcel ', 'auto' + 150)">

    where noWindowNoCache is an ajax call, displaying the result in a dialog:

    function newWindowNoCache(myPage, w)
    		url: myPage,
    		cache: false,
    			$("#dialog").dialog('option', 'width', w);
    			$("#dialog").dialog('option', 'height', 'auto');
    There are no clues in the log (except the ones I temporarily added in the flow as above) and it's set at the lowest logging level. Error handler in the ajax call above give nothing.

    Since it works everywhere else it seems to rule out spelling mistakes or structural errors in the export flow itself. It must also get called correctly since it does the first steps, including selecting the appropriate modelCreator and transferring to the view I want. It just doesn't show it. WHY!? I previously tried using in view-state the popup="true" but didn't get it to work, therefore the current solution. Googling on the problem I have now I found something about rendering fragments for popup to work, but it didn't help anyway.

    Thanks for any suggestions, I'm quite clueless

    Ok, update:
    It executes stuff I put in $(document).ready in the jsp it's supposed to render. If I print the innerHTML it's all there. I can use js/jquery to manipulate it. I tried setting visibility, display and z-index, and log says it changed but it's still nowhere to be seen visually.
    Last edited by zahali; Sep 5th, 2012, 04:15 AM. Reason: did some more testing

  • #2
    Apparently it was a jquery problem rather than anything with the flow. On that particular page the dialog never got initialized. Thanks for having a look anyway.


    • #3

      Can I mark the thread as solved somehow? Didn't find anything..