PDA

View Full Version : Button Action not working from second time.



Prasad_Guduri
17 Feb 2014, 7:44 AM
Hi Experts,

I have a window having two panels.

There is a button( dispute) on first panel, when i click on it, it should disable the Acknowledge button (same panel)and enable the Comment Area, Save Button in second panel.

The above thing are working fine when i open the window first time. If i close the window and reopen, when i click the dispute button again, the click event is fired and executing the same block of code but not enabling & disabling the components.

Window Creation:



onClickCertificationButton: function ()
{
this._win2 = new RP.Rwfm.Ess.MyTimecard.view.CerificationWindow({});

this._forms = [];


var form = new RP.Rwfm.Ess.MyTimecard.view.MyTimecardCertificationForm({ comment: comment, state: state });

this._forms.push(form);


this._win2.add(this._forms);


this._win2.show();
},



Button Events:




'rpessmytimecardactiontoolbar #certifyBtn': {
click: this.onClickCertificationButton
},


'rpessmytimecardcertificationform #cancelBtn': {
click: this.onClickCancelButton
},


'rpessmytimecardcertificationform #disputeBtn': {
click: this.onClickDisputeButton
},


'rpessmytimecardcertificationform #acknowledgeBtn': {
click: this.onClickAcknowledgeButton
},


'rpessmytimecardcertificationform #submitBtn': {
click: this.onSaveButtonClicked
}




Button Refs:




{ //Certtification button
ref: 'certificationButton',
selector: 'rpessmytimecard #certifyBtn'
},

{ // Acknowledge Button
ref: 'acknowledgeButton',
selector: 'rpessmytimecardcertificationform rpessmytimecardcertificationtoppanel #acknowledgeBtn'
},

{ // Comment Area
ref: 'commentArea',
selector: 'rpessmytimecardcertificationbottompanel rpesscommentwithmaxcharacters #commentField'
},
{ // Save Button
ref: 'saveButton',
selector: 'rpessmytimecardcertificationbottompanel rpesscommentwithmaxcharacters #submitBtn'
},






Button operations:



onClickDisputeButton: function ()
{
// This block of code executing on each click of dispute button, Doing the below things first time but from second time on-words not doing enable and disable.
this.getAcknowledgeButton().setDisabled(true);

this.getCommentArea().setDisabled(false);


this.getSaveButton().setDisabled(false);
},


Kindly help me.

Thanks & Regards,
Prasad

Prasad_Guduri
17 Feb 2014, 11:31 AM
Hi All,

The below changes made it to work as expected.

closeAction: 'destroy',


onClickCancelButton: function ()
{
this._win2.destroy(); // earlier it was this._win2.close();
},


Thanks,
Prasad