1

I have a challenging requirement. The requirement is as follows.

  1. We are designing a UI today with 10 UI elements.
  2. Users are creating few records.
  3. After a month, a new release comes and it has 12 UI elements on screen.
  4. When the user creates new records, he should see 12 UI elements, when he opens an old record he should see 10 elements.

In order to achieve this, I thought, we could store the version with which the record was created and render the HTML belonging to that version. But, this will unnecessarily keep increasing the project size, as if the code gets 100 revisions, that much of HTML duplicates will be present.

I thought of using "switch-case" or "if-else" statements in front end, but it will slow the UI as too much heavy lifting is done by JS.

Please suggest a way to do this requirement with JS or jQuery or Angular. Any one framework is also fine, until it will work.

Thanks a lot for your responses in advance,

RandomWanderer
  • 701
  • 2
  • 12
  • 23
  • Can you not provide any code about how your UI is being drawn or information about how these records are being stored? – jimcavoli Jul 09 '15 at 03:41
  • Hi @jimcavoli currently my UI is static. But i need to make it dynamic. UI is a ordinary one. It has 10 - 15 text boxes and one table. A simple UI. It has only 4 pages in total – RandomWanderer Jul 09 '15 at 03:47
  • With your question being about how to generate a UI, it is impossible to answer your question without editing to reflect the way in which it is currently being done (with code examples), and it is further difficult to suggest a means of storage/management of the number of elements needed without knowledge of the backing data store. – jimcavoli Jul 09 '15 at 04:01
  • Current Version:- `` `` The current version has 2 fields, the new version is going to have 3 fields. When a user who created record last week must see only 4 fields, while new users must see 3 fields. New Version:- `` `` `` DB:- MySQL Value Stored in One table with name :- Users – RandomWanderer Jul 13 '15 at 20:32

1 Answers1

1

Look at a framework called angular-schema-forms. You write no HTML with this framework. Instead you pass it a JSON object that has the fields you want to display and their corresponding display as attributes. It comes preloaded with its own templates for all common controls and also allows you to write your own.

tuckerjt07
  • 902
  • 1
  • 12
  • 31
  • Thanks a lot @tuckerjt07 , I will check this framework and respond back in couple of days on how it worked. Thanks a lot for your reply – RandomWanderer Jul 09 '15 at 16:28
  • Hi @tuckerjt07 , is there a way to do the complete HTML object manipulation in the Java Server side and render the object on the DOM with less weight on the JS side, as with "angular-schema-forms", the processing on JS side looks heavier – RandomWanderer Jul 13 '15 at 19:18
  • There is always a way to do that however I would question that approach. I would like it to be rendered by the client so that some of the load is taken off my servers and is distributed across multiple clients. – tuckerjt07 Jul 13 '15 at 19:34
  • Hi @tuckerjt07 , thanks for the reply, can you please provide some example rendering engines that would help to do the complete HTML object manipulation in the Java Server side and render the object on the DOM – RandomWanderer Jul 13 '15 at 20:24
  • I'm sorry I can't, I'm a .NET guy. – tuckerjt07 Jul 13 '15 at 21:20