Title on the next line shows "NULL" when title not yet filled in.
Hi, We are using a piece of custom code to show on the next line under the change number:
Yesterday we did the upgrade to Cireson Version 7.4
Now, when we create a new change request, we see NULL in the subtitle. After filling in the title an save the request, subtitle is showing the right stuff. But users are complaining about the NULL when creating a reqeust.:
I am sure this is a verry little change in the code (if not tilte, dont show) but I am no Java Dev.
So can somebody help me out?
Used code:
// Change Request, Add Title on the next Line
app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {
formObj.boundReady(function () {
$("#statusname").after("<div style='color:black;font-size:0.7em;'>" + pageForm.viewModel.Title + "</div>");
});
});
Kind Regards,
Roelof
Best Answer
-
Konstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭You could test whether
pageForm.viewModel.Title
is empty or not, and add the div, if it's not empty like so:// Change Request, Add Title on the next Line<br>app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) { <br> formObj.boundReady(function () {<br> titleDiv = pageForm.viewModel.Title ? "<div style='color:black;font-size:0.7em;'>" + pageForm.viewModel.Title + "</div>" : ""<br> $("#statusname").after(titleDiv);<br> });<br>});
5
Answers
pageForm.viewModel.Title
is empty or not, and add the div, if it's not empty like so: