Tags:
create new tag
view all tags

SID-01764: Searching database and returning results to table

Status: Answered Answered TWiki version: 5.1.3 Perl version:
Category: CategoryPlugins Server OS: Last update: 10 years ago

Hi,

We have a form with a field that requires a specific ID. The user would not know what that ID is so I want to provide some sort of lookup functionality where they can search the database for some string, return the results that match to some table, then allow them to select the ID they want and populate the form field.

I was thinking I could do some sort of form submit that would take the search value and use that to build the database search sql (DatabasePlugin), with the results populating a Twiki table (though not sure where that table could go- a popup?). The results format could build a URL for each table item; clicking a link would call javascript to populate the original ID field with that selected item.

I feel like Twiki plugins provide most of the elements; i just can't figure out how to put them together. Is the flow mentioned above possible solely within the Twiki framework?

Any thoughts?

Thanks, Justin

-- Justin Martin - 2013-07-10

Discussion and Answer

You do not need to install a plugin, TWiki has database capabilities built into the engine. See blog How to Create a TWiki Application. Details in TWikiForms, VarSEARCH, FormattedSearch, QuerySearch. FYI, this support application is built using TWiki forms and formatted searches.

-- Peter Thoeny - 2013-07-11

Thanks, there is a lot I can use from that post. When you say Twiki has database capabilities, do you mean interacting with an external db, or using Twiki for the db itself? Our data is in DB2. That particular example stores the contact info within Twiki, so let me ask a more specific question. How would I go about querying a db based on a search string and returning the results? Could those functions you mention be used for db searches or oly Twiki searches?

-- Justin Martin - 2013-07-11

Look into the DatabasePlugin and DBIQueryPlugin. Both allow you to embed SQL in TWiki pages to query a TWiki-external database.

-- Peter Thoeny - 2013-07-11

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- Peter Thoeny - 2015-12-03

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Searching database and returning results to table
SupportCategory CategoryPlugins
TWiki version 5.1.3
Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2015-12-03 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.