Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Questions related to using nuBuilder Forte.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Wed Feb 07, 2018 3:52 am
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
Unread post
by admin » Wed Feb 07, 2018 4:53 am
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
Unread post
by toms » Wed Feb 07, 2018 7:55 am
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?
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
Unread post
by admin » Wed Feb 07, 2018 11:20 am
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
Unread post
by toms » Wed Feb 07, 2018 11:27 am
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
Unread post
by admin » Wed Feb 07, 2018 1:36 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
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Wed Feb 07, 2018 3:20 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...