nuSetTitle() limited to Edit Forms?

Questions related to using nuBuilder Forte.

nuSetTitle() limited to Edit Forms?

Postby toms » Wed Feb 07, 2018 12:22 pm

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);
   
}
toms
 

Re: nuSetTitle() limited to Edit Forms?

Postby admin » Wed Feb 07, 2018 1:23 pm

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
admin
Site Admin
 
Posts: 3292
Joined: Mon Jun 15, 2009 9:53 am

Re: nuSetTitle() limited to Edit Forms?

Postby toms » Wed Feb 07, 2018 4:25 pm

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.
toms
 

Re: nuSetTitle() limited to Edit Forms?

Postby admin » Wed Feb 07, 2018 7:50 pm

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
admin
Site Admin
 
Posts: 3292
Joined: Mon Jun 15, 2009 9:53 am

Re: nuSetTitle() limited to Edit Forms?

Postby toms » Wed Feb 07, 2018 7:57 pm

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);
   
}
toms
 

Re: nuSetTitle() limited to Edit Forms?

Postby admin » Wed Feb 07, 2018 10:06 pm

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
admin
Site Admin
 
Posts: 3292
Joined: Mon Jun 15, 2009 9:53 am

Re: nuSetTitle() limited to Edit Forms?

Postby toms » Wed Feb 07, 2018 11:50 pm

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...
toms
 

Re: nuSetTitle() limited to Edit Forms?

Postby admin » Thu Feb 08, 2018 4:49 am

.
admin
Site Admin
 
Posts: 3292
Joined: Mon Jun 15, 2009 9:53 am


Return to General



cron