- Timestamp:
- Sep 28, 2009, 10:01:43 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemDetailedController.groovy
r116 r139 3 3 class InventoryItemDetailedController extends BaseController { 4 4 5 def index = { redirect(action: list,params:params) }5 def index = { redirect(action:search, params:params) } 6 6 7 7 // the delete, save and update actions only accept POST requests … … 13 13 } 14 14 15 def search = { 16 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 17 [ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count() ] 18 } 19 15 20 def show = { 21 22 // In the case of an actionSubmit button, rewrite action name from 'index'. 23 if(params._action_Show) 24 { params.action='show' } 25 16 26 def inventoryItemInstance = InventoryItem.get( params.id ) 17 27 18 28 if(!inventoryItemInstance) { 19 29 flash.message = "InventoryItem not found with id ${params.id}" 20 redirect(action: list)30 redirect(action:search) 21 31 } 22 32 else { return [ inventoryItemInstance : inventoryItemInstance ] } … … 29 39 inventoryItemInstance.delete() 30 40 flash.message = "InventoryItem ${params.id} deleted" 31 redirect(action: list)41 redirect(action:search) 32 42 } 33 43 catch(org.springframework.dao.DataIntegrityViolationException e) { … … 38 48 else { 39 49 flash.message = "InventoryItem not found with id ${params.id}" 40 redirect(action: list)50 redirect(action:search) 41 51 } 42 52 } 43 53 44 54 def edit = { 55 56 // In the case of an actionSubmit button, rewrite action name from 'index'. 57 if(params._action_Edit) 58 { params.action='edit' } 59 45 60 def inventoryItemInstance = InventoryItem.get( params.id ) 46 61 47 62 if(!inventoryItemInstance) { 48 63 flash.message = "InventoryItem not found with id ${params.id}" 49 redirect(action: list)64 redirect(action:search) 50 65 } 51 66 else {
Note: See TracChangeset
for help on using the changeset viewer.