Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wanted to hide and show the fields at runtime

 
Ankit Khandelwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

I have a requirement in my project in which i need to choose the fields to display on my page conditionally . e.g May be for one customer i have to show 10 fields in my one page and for other cutomer i have to show 12 fields for the same screen. Becuase of less awareness about the technologies , i am not able to understand how could i achive this requirement.

Moreover i need to select field type ( Input Box, Drop Down and radio button ) and whether it is mandatory or non mandatory check at runtime.

Please suggest me , if you have proper idea regarding this query.


Thanks
 
Saurabh Pillai
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your question, I am guessing you are new to web applications. It would be helpful, if you let us know what have you done so far and if you are stuck anywhere.

I have a requirement in my project in which i need to choose the fields to display on my page conditionally . e.g May be for one customer i have to show 10 fields in my one page and for other cutomer i have to show 12 fields for the same screen. Becuase of less awareness about the technologies , i am not able to understand how could i achive this requirement.


http://docs.oracle.com/javaee/1.4/tutorial/doc/JSTL4.html Here, you should find Conditional JSTL tag <c:if/>. It can be used.

Moreover i need to select field type ( Input Box, Drop Down and radio button ) and whether it is mandatory or non mandatory check at runtime.


Javascript/Ajax can be used here.

 
Ankit Khandelwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Saurabh for your quick reply.

I have gone through with various technologies like spring/jsp/servlet/Java Script but i am getting the exact idea , how to achieve this kind of req. But yes i am new to this forum.

I am trying to explain my problem statement again here.

I have to render fields in my page after reading some configurations from DB like I need 'First Name' , 'last name' and address for customer one and I need only First Name and Last Name for another customer. Its a kind of ERP solution.

Let me know if you feel any problem to understand my problem.

 
Saurabh Pillai
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Khandelwal wrote:
I have to render fields in my page after reading some configurations from DB like I need 'First Name' , 'last name' and address for customer one and I need only First Name and Last Name for another customer. Its a kind of ERP solution


How do you identify that for one customer you need X number of fields and for another customer you need Y number of fields? I am sure there some decisive attribute.
 
Ankit Khandelwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We will have an organization id associated with user id... then we will have screen ids with org id in another table than w.r.t each screen id we will have columns id..like that
 
Saurabh Pillai
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would follow following steps,

1) Now, it really depends on you where you want to apply orgId/screenId filter
1) At database level i.e. fetch only what you need
2) At presentation level i.e. JSP or whatever you are using

2) After you have data, you prepare beans/list of objects and pass it to presentation layer
3) Here, you have to iterate over data, use <c:forEach/> tag.
- Using that access screenId propperty, and use it <c:if/> i.e. if screen id is X do this, else do that etc.

Let me know if any of steps are unclear.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic