Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Open Browse Form in iframe popup

Post Reply
Tinka
Posts: 73
Joined: Mon Feb 24, 2014 2:58 pm

Open Browse Form in iframe popup

Unread post 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
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Open Browse Form in iframe popup

Unread post by admin »

Tinka,

Use the Browse Object.
Capture.PNG
Steven
You do not have the required permissions to view the files attached to this post.
Tinka
Posts: 73
Joined: Mon Feb 24, 2014 2:58 pm

Re: Open Browse Form in iframe popup

Unread post 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
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Open Browse Form in iframe popup

Unread post by admin »

Tinka,

I sorry I misunderstood your question.

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

Steven
Post Reply