Commit e69f0a65 authored by Adrien PARROT's avatar Adrien PARROT
Browse files

Add filter language, add pages in searchPage

parent cae8003f
......@@ -107,8 +107,167 @@ sap.ui.controller("conceptmapper.searchPage", {
}
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
if (!isNaN(oRowsNumber) && Number.isInteger(oRowsNumber)) {
var oTable_ref = sap.ui.getCore().byId('oTable');
oData.limit = oRowsNumber;
}
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
// Valid => null, Deleted => 'D', Updated => 'U'
oData.invalid_reason = oValidMCB_list;
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
oData.m_language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
//debugger;
parseInt(sap.ui.getCore().byId('oSearchFielGoToPage').resetProperty('value'));
getConceptsAjax(oData, oTable_ref, oRowsNumber);
var oModel = sap.ui.getCore().getModel('conceptsModel');
var aPageFound = oModel.getProperty("/page_found");
var aPageShown = oModel.getProperty("/page_shown");
debugger;
if (aPageFound === 0 || aPageFound === 1) {
sap.ui.getCore().byId('oButtonPrev').setEnabled(false);
sap.ui.getCore().byId('oButtonNext').setEnabled(false);
} else {
sap.ui.getCore().byId('oButtonPrev').setEnabled(false);
sap.ui.getCore().byId('oButtonNext').setEnabled(true);
}
buttonTextShown = 'Current page : ' + ++aPageShown;
buttonTextFound = 'Total page(s) : ' + aPageFound;
sap.ui.getCore().byId('oButtonCurrentPage').setText(buttonTextShown);
sap.ui.getCore().byId('oButtonTotalPages').setText(buttonTextFound);
// GET AJAX call on conceptSSSSS
},
prevPage : function (oEvt) {
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
for (var i in oStandardMCB_ref) {
oStandardMCB_list.push(oStandardMCB_ref[i].getProperty('text'));
}
var oValidMCB_ref = sap.ui.getCore().byId('oValidMCB').getSelectedItems();
var oValidMCB_list = [];
for (var i in oValidMCB_ref) {
oValidMCB_list.push(oValidMCB_ref[i].getProperty('text'));
}
var oDomainMCB_ref = sap.ui.getCore().byId('oDomainMCB').getSelectedItems();
var oDomainMCB_list = [];
for (var i in oDomainMCB_ref) {
oDomainMCB_list.push(oDomainMCB_ref[i].getProperty('text'));
}
var oVocMCB_ref = sap.ui.getCore().byId('oVocMCB').getSelectedItems();
var oVocMCB_list = [];
for (var i in oVocMCB_ref) {
oVocMCB_list.push(oVocMCB_ref[i].getProperty('text'));
}
var oLangMCB_ref = sap.ui.getCore().byId('oLangMCB').getSelectedItems();
var oLangMCB_list = [];
for (var i in oLangMCB_ref) {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
if (!isNaN(oRowsNumber) && Number.isInteger(oRowsNumber)) {
var oTable_ref = sap.ui.getCore().byId('oTable');
oData.limit = oRowsNumber;
}
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
// Valid => null, Deleted => 'D', Updated => 'U'
oData.invalid_reason = oValidMCB_list;
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
oData.m_language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
var oModel = sap.ui.getCore().getModel('conceptsModel');
var aPageShown = oModel.getProperty("/page_shown");
oData.page = aPageShown;
if (oData.page <= 1) {
sap.ui.getCore().byId('oButtonPrev').setEnabled(false);
}
sap.ui.getCore().byId('oButtonNext').setEnabled(true);
getConceptsAjax(oData, oTable_ref, oRowsNumber);
// aData.push(oData);
},
nextPage : function (oEvt) {
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
for (var i in oStandardMCB_ref) {
oStandardMCB_list.push(oStandardMCB_ref[i].getProperty('text'));
}
var oValidMCB_ref = sap.ui.getCore().byId('oValidMCB').getSelectedItems();
var oValidMCB_list = [];
for (var i in oValidMCB_ref) {
oValidMCB_list.push(oValidMCB_ref[i].getProperty('text'));
}
var oDomainMCB_ref = sap.ui.getCore().byId('oDomainMCB').getSelectedItems();
var oDomainMCB_list = [];
for (var i in oDomainMCB_ref) {
oDomainMCB_list.push(oDomainMCB_ref[i].getProperty('text'));
}
var oVocMCB_ref = sap.ui.getCore().byId('oVocMCB').getSelectedItems();
var oVocMCB_list = [];
for (var i in oVocMCB_ref) {
oVocMCB_list.push(oVocMCB_ref[i].getProperty('text'));
}
var oLangMCB_ref = sap.ui.getCore().byId('oLangMCB').getSelectedItems();
var oLangMCB_list = [];
for (var i in oLangMCB_ref) {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
......@@ -118,6 +277,8 @@ sap.ui.controller("conceptmapper.searchPage", {
}
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
......@@ -128,13 +289,99 @@ sap.ui.controller("conceptmapper.searchPage", {
oData.invalid_reason = oValidMCB_list;
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
// oData.language_id = oLangMCB_list;
oData.m_language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
var oModel = sap.ui.getCore().getModel('conceptsModel');
var aPageShown = oModel.getProperty("/page_shown");
var aPageFound = oModel.getProperty("/page_found");
debugger;
if (aPageShown + 1 === aPageFound) {
sap.ui.getCore().byId('oButtonNext').setEnabled(false);
}
sap.ui.getCore().byId('oButtonPrev').setEnabled(true);
oData.page = aPageShown + 2;
getConceptsAjax(oData, oTable_ref, oRowsNumber);
// aData.push(oData);
},
searcherGoToPage : function (oEvt) {
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
for (var i in oStandardMCB_ref) {
oStandardMCB_list.push(oStandardMCB_ref[i].getProperty('text'));
}
var oValidMCB_ref = sap.ui.getCore().byId('oValidMCB').getSelectedItems();
var oValidMCB_list = [];
for (var i in oValidMCB_ref) {
oValidMCB_list.push(oValidMCB_ref[i].getProperty('text'));
}
var oDomainMCB_ref = sap.ui.getCore().byId('oDomainMCB').getSelectedItems();
var oDomainMCB_list = [];
for (var i in oDomainMCB_ref) {
oDomainMCB_list.push(oDomainMCB_ref[i].getProperty('text'));
}
var oVocMCB_ref = sap.ui.getCore().byId('oVocMCB').getSelectedItems();
var oVocMCB_list = [];
for (var i in oVocMCB_ref) {
oVocMCB_list.push(oVocMCB_ref[i].getProperty('text'));
}
var oLangMCB_ref = sap.ui.getCore().byId('oLangMCB').getSelectedItems();
var oLangMCB_list = [];
for (var i in oLangMCB_ref) {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
if (!isNaN(oRowsNumber) && Number.isInteger(oRowsNumber)) {
var oTable_ref = sap.ui.getCore().byId('oTable');
oData.limit = oRowsNumber;
}
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
oData.page = parseInt(sap.ui.getCore().byId('oSearchFielGoToPage').getProperty('value'));
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
// Valid => null, Deleted => 'D', Updated => 'U'
oData.invalid_reason = oValidMCB_list;
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
oData.m_language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
// GET AJAX call on conceptSSSSS
getConceptsAjax(oData, oTable_ref, oRowsNumber);
buttonTextShown = 'Current page : ' + oData.page;
sap.ui.getCore().byId('oButtonCurrentPage').setText(buttonTextShown);
},
......@@ -662,10 +909,11 @@ sap.ui.controller("conceptmapper.searchPage", {
"key" : "FR",
"text" : "FR"
},
{
"key" : "EN",
"text" : "EN"
}]
// {
// "key" : "EN",
// "text" : "EN"
// }
]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "language");
......
......@@ -195,7 +195,9 @@ sap.ui.jsview("conceptmapper.searchPage", {
text : "{conceptsModel>concept_id}"
}),
editable : false,
sortProperty : "concept_id"
sortProperty : "concept_id",
width : '7%',
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -205,7 +207,8 @@ sap.ui.jsview("conceptmapper.searchPage", {
htmlText : "{conceptsModel>concept_name}"
}),
editable : false,
sortProperty : "concept_id"
sortProperty : "concept_id",
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -216,6 +219,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "concept_code",
editable : false,
width : '12%',
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -226,6 +233,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "concept_class_id",
editable : false,
width : '13%',
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -236,6 +247,11 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "vocabulary_id",
editable : false,
width : '13%',
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -246,6 +262,9 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "standard_concept",
editable : false,
width : '7%',
}));
oTable.addColumn(new sap.ui.table.Column({
......@@ -257,6 +276,9 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "validity",
editable : false,
width : '7%',
}));
oTable.addColumn(new sap.ui.table.Column({
......@@ -268,11 +290,15 @@ sap.ui.jsview("conceptmapper.searchPage", {
}),
sortProperty : "domain_id",
editable : false,
width : '10%',
}));
oTable.bindRows({
path : "conceptsModel>/docs"
path : "conceptsModel>/docs",
highlight:'Error',
});
var icoToolbar = new sap.m.IconTabBar({
......@@ -282,6 +308,15 @@ sap.ui.jsview("conceptmapper.searchPage", {
text : "Concepts",
showAll : true,
count : "{conceptsModel>/num_found}",
// }), new sap.m.IconTabFilter({
// text : "Valid",
// icon : "sap-icon://message-success",
// count : "{conceptsModel>/total_valid_concepts}",
// }), new sap.m.IconTabFilter({
// text : "Valid",
// icon : "sap-icon://message-success",
// count : "{conceptsModel>/total_valid_concepts}",
// iconColor : "Critical"
// select:
// }), new sap.m.IconTabFilter({
......@@ -295,7 +330,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
}) ]
});
var oDetailPage = new sap.m.Page({
title : "{i18n>app_head}",
......@@ -315,6 +350,64 @@ sap.ui.jsview("conceptmapper.searchPage", {
id : "oRowInPageInput",
placeholder : "Rows per page : 15",
}),
contentMiddle: [
// new sap.m.Input({
// id : "oInputGoTo",
// placeholder : "Go to Page",
// }).addStyleClass('inputBox'),
new sap.m.SearchField({
id: 'oSearchFielGoToPage',
placeholder : "Go to Page",
search : [ oController.searcherGoToPage, oController ],
}).addStyleClass('goTo'),
new sap.m.Button({
id : "oButtonCurrentPage",
text: 'Current page : 1' ,
enabled:false,
}),
new sap.m.Button({
id : "oButtonPrev",
text: "Previous",
type : "Reject",
enabled: false,
icon : "sap-icon://navigation-left-arrow",
// press : function(oEvt) {
// app.back();
press : [ oController.prevPage, oController ],
}),
new sap.m.Button({
//id: "hideShowFilter",
id : "oButtonNext",
text: "Next",
type : "Reject",
enabled: false,
iconFirst: false,
icon : "sap-icon://navigation-right-arrow",
// press : function(oEvt) {
// app.back();
press : [ oController.nextPage, oController ],
}),
new sap.m.Button({
id : "oButtonTotalPages",
text: 'Total page(s) : 3',
enabled:false,
press: function() {
alert}
}),
],
contentLeft: new sap.m.Button({
id: "hideShowFilter",
text: "Hide-Show Filter",
......
......@@ -2,6 +2,10 @@
width: 20% !important;
}
.goTo {
width: 15% !important;
}
.CSVPage {
width: 55% !important;
padding-left:36% !important;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment