Not able to save extjs combo using grails controller

I am a newbie to grails/extjs I am developing a web based config tool for my team .My issue is with comboboxes of extjs I have three remote comboxes(many to one hibernate mappng).I am using hiddenName to submit its value field(which is id primay key of database) instead of its display field which is name which i get by rendering it as json.some how I see that if I select diff index other than which is loaded from db and try updating it.it definitely sends it as params but in save method of grails its not updated.

I want to understand Why? I have pasted snippetof both combobox and grails method?

{
           xtype : 'combo',
           id:'cpsServerid',
           fieldLabel : 'CpsServer',
           name : 'cpsServer',
            //hiddenId:'cpsID',
            hiddenName:'cpsID',
               store: cpsServerStore,
            displayField:'NAME',
            valueField:'ID',
            editable:true,
            typeAhead:true,
            mode:'remote',
            triggerAction:'all',
                  width:300,
            autoScroll:true,
            selected:name,
            selectOnFocus:true},

GRAILS SAVE

 def saveApplicationSubscription = {
         println "saveApplicationSubscription, params = $params"
         ApplicationSubscription subscription 

  if (params.id) {
           subscription  =  ApplicationSubscription.get(params.id as int)
           subscription.cpsServer = CpsServer.get(params.cpsID as int)
           subscription.topic =  params.topic
              subscription.description = params.description
              subscription.subscriberApplication = SubscriberApplication.get(params.subAppID as int)
              subscription.outputQueue = OutputQueue.get(params.outputID as int)
              bindData(subscription , params)
        }
   else {
           params.id = 0
           subscription = new ApplicationSubscription(params)
           subscription.id = params.id as int 
           subscription.cpsServer = CpsServer.get(params.cpsID as int )
           subscription.topic =  params.topic
           subscription.description = params.description
           subscription.subscriberApplication = SubscriberApplication.get(params.subAppID as int)
           subscription.outputQueue = OutputQueue.get(params.outputID as int)
         //  subscription.messageFormat = params.messageFormat


       }
if (subscription.save()) {

         log.info("Saved ApplicationSubscription $subscription")
         render([success: true] as JSON)

     }
     else {
         log.info("Failed to save ApplicationSubscription $subscription, errors = ${subscription.errors}")
         render([success: false, errors: subscription.errors] as JSON)
     }
 }

I would really apperciate any help

Answers


Have you verified in the Firebug console tab that your POST looks like what you expect? That would confirm whether or not your issue is on the client or server.


Need Your Help

Which Facebook application security Settings shall I disable / enable

android facebook facebook-graph-api

I'm using Facebook SDK in my Android application, I count on the FB SDK to get user logged into my application and grant my application needed permissions, and I know that FB SDK offers the user a ...

Get Custom Attributes Generic

c# generics reflection attributes

I am creating a custom attribute. And I will use it in multiple classes: