Page 1 of 1

Open Browse Form in iframe popup

Posted: Thu Dec 18, 2014 10:41 am
by Tinka
Hi

I have made a browse form (called by button click) that uses fields on the edit form in the sql on Before Browse, a kind of advanced filter (the filter fields can be left blank). That part works.

Code: Select all

$sql = "
Create table #TABLE_ID#
Select p.*,chr.*, gp.*, g.*, d.* ,f.*, tr.*
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
Left join direction d ON d.direction_id = p.dir_idFK
Left join freezer f ON f.freezer_id = p.pri_freezidFK
Left join transcript tr ON tr.transcript_id = p.pri_transidFK

WHERE IF('#pri_gene_idFK#' != '',g.gene_id = '#pri_gene_idFK#',1) AND
IF('#pri_exon#' != '',p.pri_exon = '#pri_exon#', 1) AND
IF('#pri_transidFK#' != '',p.pri_transidFK = '#pri_transidFK#',1) 
";

nuDebug($sql);
$q = nuRunQuery($sql);

I updated Nubuilder and saw a new JavaScript function "NuOpenFormInFrame" in the nucommon.js. I tried to modulate the function to make it work for a browse form, and it pops up in the iframe, but the filter works unstable, it becomes active AFTER I change the filter fields again and can't be erased afterwards.
Code on button onClick Event:

Code: Select all

nuOpenBrowseFormInFrame('548eaefbd7755ab');

Code: Select all

function nuOpenBrowseFormInFrame(formID){

	var parent           = '';
	var w                = new nuWindow();
	w.call_type          = 'getbrowseform';
	w.form_id            = formID;
	w.breadcrumb         = '0';
	
	w.tip				 = 'Browse';
	w.type				 = 'Browse';

	nuSession.nuWindows.push(w);
	nuIframeWindow(w);
How can I make a filtered browse form show in an iframe popup?

BR, Tinka

Re: Open Browse Form in iframe popup

Posted: Fri Jan 16, 2015 5:21 am
by admin
Tinka,

Use the Browse Object.
Capture.PNG
Steven

Re: Open Browse Form in iframe popup

Posted: Tue Jan 20, 2015 2:18 pm
by Tinka
I solved it by using a Lookup object with code field width = 0, which opens the filtered browse form described below.
I could not make the filter work on a browse object.
Tinka

Re: Open Browse Form in iframe popup

Posted: Tue Jan 27, 2015 11:03 pm
by admin
Tinka,

I sorry I misunderstood your question.

The way you have done it is the way I would have.

Steven