updates to allow the property name to be included in autocomplete data property form- NIHVIVO-3386
This commit is contained in:
parent
a38848b5b6
commit
0bc09b07a6
2 changed files with 10 additions and 6 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
<#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter />
|
||||
<#assign editMode = editConfiguration.pageData.editMode />
|
||||
|
||||
<#assign propertyPublicName = editConfiguration.propertyPublicName/>
|
||||
<h2>${editConfiguration.formTitle}</h2>
|
||||
|
||||
<#--Display error messages if any-->
|
||||
|
@ -66,10 +66,9 @@ Also multiple types parameter set to true only if more than one type returned-->
|
|||
property: '${editConfiguration.predicateUri}',
|
||||
submitButtonTextType: 'simple',
|
||||
editMode: '${editMode}', //Change this to check whether adding or editing
|
||||
supportEdit: 'true',
|
||||
sparqlForAcFilter: '${sparqlForAcFilter}',
|
||||
sparqlQueryUrl: '${sparqlQueryUrl}',
|
||||
defaultTypeName: 'string'
|
||||
defaultTypeName: '${propertyPublicName}'
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ var customForm = {
|
|||
// Set field labels based on type selection. Although these won't change in edit
|
||||
// mode, it's easier to specify the text here than in the jsp.
|
||||
setLabels: function() {
|
||||
var typeName = "string";
|
||||
var typeName = this.defaultTypeName;
|
||||
|
||||
this.labelsWithPlaceholders.each(function() {
|
||||
var newLabel = $(this).data('baseText').replace(customForm.placeholderText, typeName);
|
||||
|
@ -375,7 +375,11 @@ var customForm = {
|
|||
// Set button text based on both type selection and whether it's an autocomplete selection
|
||||
// or a new related individual. Called when setting up full view of form, and after
|
||||
// an autocomplete selection.
|
||||
//Commenting out for now because keeping in synch with regular data property form and
|
||||
//not changing the button text at all
|
||||
setButtonText: function(newOrExisting) {
|
||||
|
||||
/*
|
||||
var typeText,
|
||||
buttonText,
|
||||
baseButtonText = this.button.data('baseText');
|
||||
|
@ -385,7 +389,7 @@ var customForm = {
|
|||
return;
|
||||
}
|
||||
|
||||
typeText = "string";
|
||||
typeText = this.defaultTypeName;
|
||||
|
||||
// Creating new related individual
|
||||
if (newOrExisting === 'new') {
|
||||
|
@ -405,12 +409,13 @@ var customForm = {
|
|||
}
|
||||
|
||||
this.button.val(buttonText);
|
||||
*/
|
||||
},
|
||||
|
||||
|
||||
// Set the initial help text that appears in the autocomplete field and change the class name
|
||||
addAcHelpText: function() {
|
||||
var typeText = "string";
|
||||
var typeText = this.defaultTypeName;
|
||||
|
||||
// First case applies on page load; second case applies when the type gets changed.
|
||||
if (!this.acSelector.val() || this.acSelector.hasClass(this.acHelpTextClass)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue