Wednesday 18 December 2013

Visible/invisible Fields using Checkbox

If you face requirement of Visible/invisible Fields using Checkbox this post will help you. It is very simple process that i am showing in briefly step by step.

First we have to create a table that contain some fields according to figure 1 and have to keep in mind  that one field should be Enum Type and set its property “EnumType NoYesCombo”.

Figure 1 - Create a table with “Enum Type” field

Next, create a form according to figure 2 and set following property:
1. “Student_checkBox”
AutoDeclaration - “Yes”
DataSource – “Student”
DataField - “Fee”
2. Student_StudentId
AutoDeclaration - “Yes”
3. Student_Name
      AutoDeclaration - “Yes”

Figure 2 – Create form and override modified()

Finally, override “modified()” method on Student_CheckBox with following code:

public boolean modified()
{
    boolean ret;

    ret = super();
    if(Student_CheckBox.checked())
    {
        Student_StudentId.visible(false);
        Student_Name.visible(false);
     }
    else
    {
        Student_StudentId.visible(true);
        Student_Name.visible(true);
    }
    return ret;
}

Figure 3 - Result

No comments:

Post a Comment

SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.

Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...