How to implement Full-Text Search in Google App Maker? - google-app-maker

I'm making a Full-Text Search box to find any records that have the data entered in that box. I tried binding the value of the Search box to #datasource.query.parameters.SearchText, then assigned
query.keywords = query.parameters.SearchText;
return query.run();
I made a button Search to reload the datasource with search value from the Search box but it continues to show all records, not the records that have the value I want:
Actual Search Result
Am I missing something? What is the right way to implement this function?

There is a Google template called "Partner Management" that has this functionality. It looks like the difference is with the onValueEdit field of the widget. Add this to that field:
widget.datasource.query.pageIndex = 1;
widget.datasource.unload();
widget.datasource.load();
updateUrlForContactSearch();
Hope that helps.

Related

GSuite Appmaker - how to set default value in table using button

I am trying to put together a mock up for a data collection app for a local nonprofit using GSuite's AppMaker. So far I really like the tool.
One thing I need to be able to do is streamline the data entry for the site representatives. In my app, I display a list of students in a table, where one of the columns is a boolean value which represents attendance. The desired result is for the teachers to be able to input the date field one time using the date input button at the bottom of the page. Then they can quickly point and click down the Present column to log attendance.
My question is: how would I link the date selector dropdown so that the date field pre-populates with the selected date from the input field? I don't want them to have to enter the field over an over again since its the same for each row and I don't want the user experience to feel clunky.
Screenshot of the App for reference:
Using client script, you can add the following to the onValueEdit event handler of the date widget at the bottom.
var items = widget.root.descendants.<YourTable>.datasource.items;
items.forEach(function(item){
item.<DateField> = newValue;
});
The only thing to take into account is that when using client scripting, you will only update the records loaded in the table at the moment; i.e, if your table has paging, it will only update the current page. If you are using paging, then you will need to add the following code to the onPreviousClick and the onNextClick event handlers of the pager widget:
var selectedDate = widget.root.descendants.<YourDatePicker>.value;
var items = widget.root.descendants.<YourTable>.datasource.items;
items.forEach(function(item){
item.<DateField> = selectedDate;
});

Populate data based on the response given in Google Form

I have created two sections
First Section I have Order ID after entering the order ID and I click Next - In second section I want to populate order id's related data like (Name, Address, list of orders) All these data are available in an excel sheet, Once it is populated I would like the user to confirm their orders are correct and then hit submit.
Is this possible using google form or any add-ons for Google forms?
Thanks!
i read your question
As far i know about google form, google form don't give option to recheck your pre-filled options. So, what we can do is to give a confirm button at the end which is must required to fill.
You can see it through this example.
https://docs.google.com/forms/d/e/1FAIpQLSchhhCjcyQe-ZTdl8pFF-ETLPGFTXPcuqQGDGQ1nMbtcwOnGQ/viewform?usp=sf_link
If you want to create a more user defined form you can make it from simple html and php.
hope this will help you.
thanks!

Table input for view

I would like to have the user enter order items on my order form as a table where they input the Qty and Prod #. I've not programmed with that type of field so a blank line would initially display for a new order. They would type a Qty and an item number in the fields and hit enter. When they hit enter from either field, what do I program to check the validity of the two fields. Plus I need the item number to be a drop down/type ahead field. Does anyone have an example of this type of thing they could send me? It would be looking at a view in the product catalog db. Also, after they enter an item to order, that "doc" should get stored/saved and a new blank line should open up.
What type of control do I need to use and should these items be stored in their own form or on the main order document? Could use some guidance here. Thanks.
The question you have is a little broad but I will make a couple suggestions if I can.
You have the main order doc. Then a repeat control with each item. Filter each item by a uniqueID that allows you to join the main doc to the child docs. Each item should be a separate document. You then need to make the items in the repeat control editable.
There is a lot of things going on here and I think you need to get started somewhere. I think the first step is to do a repeat control with response documents.Xpages, Inherited documents in view panel by using #Unique

Populate a value in combobox dynamicly

I have a form where user picks a Item# and gets info for the selected Item. This form got enhanced by adding another filter, using a combobox control, to select a 'warehouse'.
I could use a lookup for the warehouse(the list is huge) to chosse a 'warehouse' but what am trying to do to query warehouse on Item# value and populate into combobox.
Tried to attached a screen shot, unfotunately, the system doesn't let me do it. If I need to put more details, please let me know.
Is it doable?
I would suggest you to do this with a temporary table. Create one in AOT, and declare it as global variable in your form.
When Item (datasource field or design control, choose what's more accurate for you) is modified, just delete table content, and fill it at your needs.
In the control lookup method, call temporary table lookup method, i.e. "static void lookup(TMPTable _tmpTable)". Do a SysTableLookup, with a standard query over TMPtable, but it's important to use QueryBuildDataSource.setCursor(_tmpTable) (I don't remember now where was method setCursor() in Query or QueryRun, search for it a bit).

What is the best approach for this CRUD search page in ASP.NET

I'm building a heavily CRUD based ASP.NET website and I've got to the phase of the project where I'm trying to build a search webpage that shows the user different subsets of a certain important table based on parameters they enter such as dates and different text fields.
I can't use a fixed SQL statement, because depending on whether they search by date or by something else, the SQL would be different, so instead I have been generating a results list using a table web control that starts out invisible and then is filled and set to visible once the user identifies a search they want to make. I used a table control because its easy to create and modify in the code behind, and I was able to make the needed calls to the database and populate that table as required.
However, the second thing I need with this search page, is the ability to allow the user to select a record from the results and then go edit it using the rest of the CRUD based pages on the site. To do that, I created asp:buttons in the table and gave them all different ids and the same event handler. But since I created the buttons dynamically, it seems the event disappears on callback and my scheme fails, so I'm taking a second look at how to do this.
My current code for the events looks like:
tempcell = new TableCell();
Button tempbutton = new Button();
tempbutton.Text = "Go";
tempbutton.ID = "gobutton" + rowN;
tempbutton.Visible = true;
tempbutton.Click += new EventHandler(tempbutton_Click);
tempcell.Controls.Add(tempbutton);
temprow.Cells.Add(tempcell);
My results table is declared like this:
<asp:Table ID="ResultTable" visible="false" runat="server"
GridLines="Both" CellSpacing="8">
</asp:Table>
I'd like to be able to identify which record the user selected, so I can send that info on to another page. And of course, I still need to be able to generate results for several different search criteria. Currently I have date, template and code based searches that lead to different stored procedures and different parameters based on what the user has entered.
Any suggestions on this? It seems like the data grids and repeaters require SQL statements in advance to work properly, so I'm not sure how to use them, but if I could then the item command approach would work with the buttons.
Your event will hook up successfully if the button is recreated in the page load event.
Otherwise, use a GridView. It is the perfect solution for simple CRUD, and you can control it as much as you need.

Resources