Expand my Community achievements bar.

Urgent Need Help regarding subforms

Avatar

Level 3

Hi ,

I have a drop down with values new,change,close. And they are three sub forms also.Based selection of drop down the respective drop down needs to be  visible and others need to be hidden .Initially all the sub forms are hidden from lay out .and i wrote the following script on change event of drop down but this is not working as expected.

if(this.rawValue!= null)

{

  1. app.alert("value is selected");

if (BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="New")

{

  1. app.alert("NEW");
  2. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="visible";
  3. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="hidden";
  4. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="hidden";

}

else if (BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="Change")

{

  1. app.alert("Change");
  2. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="visible";
  3. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="hidden";
  4. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="hidden";

}

else if(BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="Close")

{

  1. app.alert("Close");
  2. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="visible";
  3. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="hidden";
  4. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="hidden";

}

}

else

{

  1. app.alert("You have to select any one of the request Type");

}


Please help me where i am going wrong!!


Thanks,

Bharathi.

2 Replies

Avatar

Former Community Member

Hi,

Bharathi.

I also write the code in Change event of Drop Down List.But there is some error in Change Event.

So, I write the code in Validate event.It could solve that some error.

Please check my code, I think it can help you.

if(this.rawValue != null)

{

  1. app.alert("value is selected");

if (this.rawValue == "New"){

  1. app.alert("NEW");
  2. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence = "visible";
  3. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence = "hidden";
  4. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence = "hidden";

}else if (this.rawValue == "Change"){

  1. app.alert("Change");
  2. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence = "visible";
  3. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence = "hidden";
  4. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence = "hidden";

}else if(this.rawValue == "Close"){

  1. app.alert("Close");
  2. BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence = "visible";
  3. BankAccount.Page1.WorkArea.RequestType.NewRequest.presence = "hidden";
  4. BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence = "hidden";

}}else{

  1. app.alert("You have to select any one of the request Type");

}


Hope this Helps,

S,Candy.

Avatar

Former Community Member

hello

        Please write like following.

if  (this.rawValue <> null)

  then

     app.alert("value is selected")

              if  (BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="New")

              then   

          app.alert("NEW");

          BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="visible";

          BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="hidden";

          BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="hidden";

       endif

       if(BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="Change")

              then

          app.alert("Change");

          BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="visible";

          BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="hidden";

          BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="hidden";

       endif

       if(BankAccount.Page1.WorkArea.RequestType.ddRequestType.rawValue="Close")

       then

          app.alert("Close");

          BankAccount.Page1.WorkArea.RequestType.CloseRequest.presence="visible";

          BankAccount.Page1.WorkArea.RequestType.NewRequest.presence="hidden";

          BankAccount.Page1.WorkArea.RequestType.ChangeRequest.presence="hidden";

       endif

        else

      app.alert("You have to select any one of the request Type");

endif