Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6243813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:12:38+00:00 2026-05-24T12:12:38+00:00

I’m using jQuery autocomplete control to perform search on three entities: Owner, Manager and

  • 0

I’m using jQuery autocomplete control to perform search on three entities: Owner, Manager and a Tenant. Every entity is saved to its own table in the database.

Under the autocomplete control, a grid (hidden div) will be shown and populated based on the user’s selection. The grid uses textfields controls so the user can edit and save again.

Now, I’m having these problems:

  1. When submitting back to the server, how to know which entity the
    user worked on? is it Owner, Manager or Tenant? I need to figure
    this out in order to know where to save the data in the database.
  2. Server side validation is a must as you know. What to do if the user submitted invalid data? The common pattern is to redisplay the page again with error messages.
    But in my case the grid/div is shown based own autocomplete search, showing the page again is simply going to hide the div.

Could I employ a much easier approach any way?

Technologies used are jQuery and Grails framework.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:12:40+00:00Added an answer on May 24, 2026 at 12:12 pm

    There’s a lot going on here, but it’s not overwhelming. Tackle it bit by bit.

    Obviously the initial query could use joins to get all results from the three tables that match the specified query values. However,I’d begin by questioning your rationale behind the three separate database tables, as it breaks the basic tenet of a relational database–repeating fields and possibly repeating data if one person fills two different roles (a classic: “not likely, but in theory possible situation”) Each is a person, and each will have similar data requirements such as first name, last name, address, city, etc. So, why not store “person” information in a table and then either have a separate table that defines a person by id for the relationship or alternately has a field in the “person” database that defines their role? Ultimately, for this to work you have to have some sort of common identifier that the system can look at to tell it what role the person holds.

    If you are to stay with the existing structure, I’d imagine you’d have to do a complex join that aliases the ID’s from each table as a fieldname like Owner_id that you could then use to base your decision on what table they belong in….not efficient!

    I’d personally query the information into jQuery Datatables, which is currently the most feature-rich grid out there. It does have editable regions available and working well. The trick to this on the UI side is to initialize the datatable with an empty resultset coming from the ajax source initially and then “refreshing” it with with the command oTable.fnDraw(false);

    Finally, for the save I’d take the ID of the saved value and jQuery Ajax save it to a script. I’d run a lookup via the DB on that ID to see what relationship it has, and this is where better normalization would allow you to simply query based on their relationship status (owner, manager, or tenant) to get that value. From there, run a DB update based on the calculated ID and tablename and cycle the view to both indicate success and return to a “main screen”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.