You want to declare three variable... i did not get your question what you are actually trying to say.
| B.E IT | SCJP 6.0 98 % |
S D Lalitha Velamuri
Joined: May 17, 2012
Thanks for your response. Suppose if 3 Variables are there Courses(Enumeration Values: C Lang, JAVA), Fee of Java, Fee of C. If I select Courses as "Java", then Fee of Java field only display and Fee of C should hide. If I select Courses as "C Lang", then Fee of C field only display and Fee of Java should hide. I need this by using Groovy script.
I just explained the requirement by giving a sample example. My requirement is on selecting one enumeration value, the related fields should only display and other fields should hide. I need it in groovy script.
I don't really understand your requirement, and it's a while since I did any Groovy anyway (unfortunately!), so I apologise if this isn't any help, but here goes.
Your data seems to consist of just two variables, Course and Fee, because each course has a fee. And because the course and fee are linked, you can model them e.g. as a map, which would then allow you to select the fee for the chosen course and display it however you want. Here's a really simple example:
Of course, if your Course needs extra attributes and behaviour, then you'd probably need to think about modelling it as a separate class instead.