Page 1 of 1

nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 12:22 pm
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);
   
}

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 1:23 pm
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

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 4:25 pm
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.

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 7:50 pm
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

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 7:57 pm
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);
   
}

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 10:06 pm
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

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Wed Feb 07, 2018 11:50 pm
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...

Re: nuSetTitle() limited to Edit Forms?

PostPosted: Thu Feb 08, 2018 4:49 am
by admin
.