Ignore:
Timestamp:
Mar 3, 2010, 3:50:21 PM (15 years ago)
Author:
gav
Message:

Handle InventoryItem reverse alternateItems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r423 r425  
    238238        def result = inventoryItemService.edit(params)
    239239
    240         if(!result.error)
    241             return [ inventoryItemInstance : result.inventoryItemInstance ]
     240        if(!result.error) {
     241            def possibleAlternateItems = inventoryItemService.getPossibleAlternateItems(result.inventoryItemInstance)
     242            return [ inventoryItemInstance : result.inventoryItemInstance, possibleAlternateItems: possibleAlternateItems]
     243        }
    242244
    243245        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
     
    260262        }
    261263
    262         render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance.attach()])
     264        def possibleAlternateItems = inventoryItemService.getPossibleAlternateItems(result.inventoryItemInstance)
     265        render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance.attach(), possibleAlternateItems: possibleAlternateItems])
    263266    }
    264267
Note: See TracChangeset for help on using the changeset viewer.