ZendX Jquery Form Autocomplete - zend-framework

Hi i'm using zendx_jquery_form_autocomplete.
I have a mysql database with a table user. User has a ID and a Name.
My problem is that i don't know I can do my research in the Name column and have the id of the right row.
In the tutorial that i saw there is a research in a array and that work fine but now i shoul pass the id of my research...

Use mysql like operator for your search in rows.
$param = $this->_getParam('param'); //send from autocomplete
$result = Zend_Db_Table::getDefaultAdapter()->select()->from('users','user_id')->where('name like =?',"%$param")->query()->fetchAll();

Related

How to send multiple fields in the "word_similarity" PostgreSQL function

[See image here]
I have two fields in the table respectively name and note. Now I want to search words using the name and note both simultaneously. Here I have called the CriteriaBuilder function using the "word_similarity" key (I guess this 'word_similarity' is one internal function that works). Here you can see I passed the name field and got the result successfully.
But I want to search both fields simultaneously.
So how do I pass both fields (name and note) and get a search result? I am a new learner.
I would greatly appreciate all your suggestions.
I have tried to send multiple words like
cb.function("word_similarity", Double::class.java, root.get("name"), root.get("note"), cb.literal(s))
But not working.

Access/Get SQL Developer Table 'Details'

I have a list of tables in an Oracle Schema. I use SQL Developer to build my queries. I can click on each table within the schema in SQL Developer and get access to a number of tabs, one of which is 'Details':
Within the 'Details' window, I have a property called 'Comments' which contains a description of what the table is for.
Now, I have quite a few tables and I want to somehow grab the table name and description in that comments property for each table and put it into a spreadsheet. Is there any way to do that in SQL Developer? Maybe a query? Or some built in function that iterates over each table and provides that information? I thought about using python, but I'm not sure I can access the 'Details' of the table.
Every once in a while, I find a solution before i have some of you awesome people answer for me, so i thought I'd post up what I found. This is the query I found that works:
select * from all_tab_comments where owner = 'your_schema_name_here'
This provides a list of all the tables in the schema (owner) I want and provides the comments I was looking for. From there, I can just export to an excel spreadsheet.

Getting current item ID in SharePoint Infopath form

Can we get the current item ID value while submitting the data in InfoPath form.
I need to use this and concatenate the ID with other field value. Tired "Max(#ID) + 1" function but it wouldn't solve the problem.
I know it can be done using calculated column or workflow.
It needs to be done using InfoPath form ? Is it possible ?
You already figured it out yourself. Im assuming you are trying to use the ID in naming it.
Create a blank field.
Then add that field to your submission naming concat.
Create a receive data connection (assuming you havent) to that library.
On the Submit rule add the query action to that library and a set field action to set that new blank field with max(ID) + 1. Make sure Submit action is last.
That should do it unless Im missing something as I have used this many times!

Using LIKE with parameter expression in query

I was trying to using the like function in iReport 4.0.1. Checked online but none seem to work.
Currently trying to use:
where name LIKE'%$P!{px_name}%'
also tried
'%$P{px_name}%'
but when running the report it comes up saying 'No document'.
But when using where name =$P{px_name} it works perfectly fine.
Where clause will be same as you have used in first step which is :-
where name LIKE '%$P!{px_name}%'
But as you said report says 'The document has no pages' means the query is returning 0 row so just use the same string in LIKE and run the same query in database. Simplest solution is first run the query in database with LIKE operator , if it returns the rows in database then that should also work in iReport.

How to make a field "autocomplete"?

I can't figure out how to make a field autocomplete in ATK.
I guess it has something to do with the type "reference" but still not sure.
Suppose I'm looking for a client name in a "line" type field, then the autocomplete should list me all/topXX matching names.
Scenario 1:
Once I hit [Enter] I'd need all that row from DB loaded in a form fields so I can edit the record.
I guess this requires getting the client ID first then posting to an "edit" page then calling "loadData()" method for that ID and populate fields.
Scenario 2:
I'm assignig a job request to a client. First I find the client then I could store its ID in a hidden field to be posted then.
Any advice?
TIA
I would suggest you to go with 2 forms. First form with a single field, and when field is changed it automatically reloads second form including the parameter.
You will also need an autocomplete field. Autocomplete is somewhat buggy in 4.0, but it have been polished up in 4.1 by using a technique in http://jqueryui.com/demos/autocomplete/#combobox
For use with models and controllers and also dropdown, example is here:
http://codepad.agiletoolkit.org/reloadform
Alternative example:
http://demo.atk4.com/demo.html?t=22
Since 4.1, you can also use autocomplete fields instead of reference:
$form1->addField('autocomplete','user');