Welcome to the nuBuilder Forums!

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

nuSetTitle() limited to Edit Forms? Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

nuSetTitle() limited to Edit Forms?

Unread post by toms »

HI,

Is there a reason nuSetTitle() is limited to Edit Forms only? I tried removing the row that is checking the Form Type and run the function while having a Browse Form open.
Result: The title/breadcrumb has been set.

Code: Select all

function nuSetTitle(t){
	
	if(nuFormType() == 'browse'){return;}

	nuFORM.setProperty('title', t);
	
	var b 	= $('.nuBreadcrumb').length;
	
	$('#nuBreadcrumb' + b).html(t);
	
}
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuSetTitle() limited to Edit Forms?

Unread post by admin »

toms,

nuSetTitle() is to allow a unique title on an Edit Form.

A Browse Form doesn't need a unique title.

Having said that, if you have a reason to change the title on a Browse, just do it with Javascript eg.

Code: Select all

$('#nuBreadcrumb1').html('unique title');

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuSetTitle() limited to Edit Forms?

Unread post by toms »

Steven,

Apart from changing a breadcrumb title, what's the purpose of this nuSetTitle() function?
I mean what is the purpose of setting a form's title?

Code: Select all

nuFORM.setProperty('title', t);
At least I don't see any visual change when running just this piece of code.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuSetTitle() limited to Edit Forms?

Unread post by admin »

toms,

It sets a Hash Cookie that can be used back on the Server.

I guess its a sort of undocumented feature.

I'm not sure if anyone would ever use it.


Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuSetTitle() limited to Edit Forms?

Unread post by toms »

Steven,

In this case I think nuSetTitle() can be slightly amended so It can be used for both an Edit and Browse Form.

Code: Select all

function nuSetTitle(t){
   
   if(nuFormType() == 'edit'){
      nuFORM.setProperty('title', t);
   }
   
   var b    = $('.nuBreadcrumb').length;
   
   $('#nuBreadcrumb' + b).html(t);
   
}
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuSetTitle() limited to Edit Forms?

Unread post by admin »

toms,

Mate, don't get bogged down on stuff that is working.

You are doing a great job finding the things that don't work so that I can fix them - keep doing that.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuSetTitle() limited to Edit Forms?

Unread post by toms »

Steven,

I was just looking for a function that works both on an Edit and Browse form. As there was no such function, I created my own one and I'm happy with it.
Of course, you're not at all obligated to do anything with it. I'm just posting ideas/improvments and maybe if someone finds it useful, it can be used...
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuSetTitle() limited to Edit Forms?

Unread post by admin »

.
Post Reply