Nobody has done a search screen? I am still struggling!
I tried to do the same as in this post
http://forums.nubuilder.cloud/viewtopic.p ... wse+filter.
So I created a form with text fields for search parameters. I call the form with a button record -1 and removed all action buttons. It is based on the same table where I want to search.
The text objects should provide the hash variables for my sql query. I created a button which opens the same form as browse form. On both the sql of the form and the BeforeBrowse I have this (just one search criteria for a start).
Code: Select all
$sql="
Select p.*,chr.*, gp.*
from primer p
Left join gene g ON g.gene_id = p.pri_gene_idFK
Left join genomic_position gp ON gp.genpos_id = p.pri_genpos_idFK
Left join chromnr chr ON chr.chromnr_id = gp.genpos_chrnr_idFK
WHERE p.prim_name = '#FindName#'";
nuDebug($sql)
nuRunquery($sql)
I can see in the debug, that the hash variable does not get replaced. Is this because the value gets lost when I reopen the same form?
I tried rewriting the sql in BeforeBrowse with
Code: Select all
$this->form->sfo_sql="SELECT * FROM xxx"
as described here
http://forums.nubuilder.cloud/viewtopic.p ... wse#p10953 resulting in an error.
I also tried with a browse object on my form instead of reopening the same form, and after setting (just) one field, clicking on the integrated Search button (Nubuilder search filter) in the browse object, but it only accepts inputs from its associated search field.
This solution was suggested in another post (which I cant find again).
I also tried to build a temporary browse table with my filtered results, and discovered that you have to use #Table_id# instead of #BrowseTable#, this works and creates a temporary table.
I know I need to define a filter with the hash variables and then use it for a browse or temporary table, should I use OpenBrowse()?
Also, maybe, one could use the built-in search filter, like here:
http://forums.nubuilder.cloud/viewtopic.p ... rch#p12540
Can some one help? Max? Steven? Fike?
BR, Tinka