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

modif conceptDetailPage : add relations (with test json) and comments

section
parent 20a05771
sap.ui.jsview("conceptmapper.conceptDetailPage", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf conceptmapper.conceptDetailPage
*/
/**
* Specifies the Controller belonging to this View. In the case that it is
* not implemented, or that "null" is returned, this View does not have a
* Controller.
*
* @memberOf conceptmapper.conceptDetailPage
*/
getControllerName : function() {
return "conceptmapper.conceptDetailPage";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf conceptmapper.conceptDetailPage
*/
/**
* Is initially called once after the Controller has been instantiated. It
* is the place where the UI is constructed. Since the Controller is given
* to this method, its event handlers can be attached right away.
*
* @memberOf conceptmapper.conceptDetailPage
*/
createContent : function(oController) {
// SUBHEADER
var oSubHeader = new sap.m.Bar({
contentLeft : [ new sap.m.Button({
icon : "sap-icon://nav-back",
......@@ -24,130 +31,150 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
text : "{label>/concept_name}"
}) ]
});
// var flexBox = new sap.m.FlexBox({
// alignItems: "Start",
// justifyContent: "SpaceBetween"
// })
var oAttrsConcept = [ new sap.m.ObjectAttribute({
title: "concept_id",
text : "{label>/concept_id}",
active : true,
press : function() {
alert("you press me");
}
}), new sap.m.ObjectAttribute({
title : "concept_name",
text : "{label>/concept_name}",
active : true,
press : function() {
oAttrs[0].setText("yolo");
}
}), new sap.m.ObjectAttribute({
title: "concept_code",
text : "{label>/concept_code}",
}), new sap.m.ObjectAttribute({
title: "concept_class_id",
text : "{label>/concept_class_id}",
active : true,
}), new sap.m.ObjectAttribute({
title: "vocabulary_id",
text : "{label>/concept_name}",
}), new sap.m.ObjectAttribute({
title: "domain_id",
text : "{label>/concept_name}",
title: "validity",
}), new sap.m.ObjectAttribute({
text : "{label>/concept_name}",
title: "standard_concept",
}),
// var flexBox = new sap.m.FlexBox({
// alignItems: "Start",
// justifyContent: "SpaceBetween"
// })
// CONCEPT PANEL
var oConceptPanelHeader = new sap.m.ObjectListItem(
"oConceptPanelHeader", {
// title : "Responsive ObjectHeader with attributes",
// number : "3.628.000",
// numberUnit : "EUR",
title : "{label>/concept_name}",
number : "{label>/standard_concept}",
numberUnit : "{label>/validity}",
attributes : [
new sap.m.ObjectAttribute({
title : "concept_id",
text : "{label>/concept_id}",
active : true,
press : function() {
alert("you press me");
}
}), new sap.m.ObjectAttribute({
title : "concept_code",
text : "{label>/concept_code}",
}), new sap.m.ObjectAttribute({
title : "concept_class_id",
text : "{label>/concept_class_id}",
active : true,
}), new sap.m.ObjectAttribute({
title : "vocabulary_id",
text : "{label>/vocabulary_id}",
}), new sap.m.ObjectAttribute({
title : "domain_id",
text : "{label>/domain_id}",
}),
]
});
];
var oConceptPanelHeader = new sap.m.ObjectHeader("oh2", {
//title : "Responsive ObjectHeader with attributes",
//number : "3.628.000",
//numberUnit : "EUR",
responsive: true,
attributes : oAttrsConcept
var oConceptPanelComment = new sap.m.FeedInput(
"oConceptPanelComment", {
icon: "sap-icon://post"
});
// RELATION PANEL
var oRelationList = new sap.m.List("oRelationList", {
// headerText : "relations list",
});
var oAttrsRelations = [ new sap.m.ObjectAttribute({
title: "Some title",
text : "Contract #D1234567890 Ñagçyfox",
active : true,
press : function() {
oAttrs2[0].setText("Ñagçyfox #D1234567890 Contract");
}
}), new sap.m.ObjectAttribute({
text : "John Doe Ñagçyfox",
active : true,
press : function() {
oAttrs2[0].setText("Ñagçyfox Contract #D1234567890");
}
}), new sap.m.ObjectAttribute({
title: "Custom content",
customContent: new sap.m.Link ({
text:"test",
press: function() {alert("you press me")}
oRelationList.bindItems({
path : "label>/relations",
template : new sap.m.ObjectListItem({
title : "{label>concept_name}",
number : "{label>standard_concept}",
numberUnit : "{label>validity}",
type:"Active",
press: function(){
app.back();
},
attributes : [
new sap.m.ObjectAttribute({
title : "concept_id",
text : "{label>concept_id}",
active : true,
press : function() {
alert("you press me");
}
}), new sap.m.ObjectAttribute({
title : "concept_code",
text : "{label>concept_code}",
}), new sap.m.ObjectAttribute({
title : "concept_class_id",
text : "{label>concept_class_id}",
active : true,
}), new sap.m.ObjectAttribute({
title : "vocabulary_id",
text : "{label>vocabulary_id}",
}), new sap.m.ObjectAttribute({
title : "domain_id",
text : "{label>domain_id}",
}),
]
})
}), new sap.m.ObjectAttribute({
text : "John Doe Ñagçyfox"
}), new sap.m.ObjectAttribute({
title: "Created by",
text : "John Doe Ñagçyfox"
}) ];
var oRelationsPanelHeader = new sap.m.ObjectHeader("oh3", {
title : "Relations!!!!",
//number : "3.628.000",
//numberUnit : "EUR",
responsive: true,
attributes : oAttrsRelations
});
var oConceptPanel = new sap.m.Panel("oConceptPanel_conceptDetail", {
var oRelationsPanelHeader = new sap.m.ObjectHeader(
"oRelationsPanelHeader", {
// title : "Relations!!!!",
// number : "3.628.000",
// numberUnit : "EUR",
responsive : true,
// attributes : oAttrsRelations
});
oRelationsPanelHeader.bindAggregation("attributes", {
path : "test>/tester",
template : new sap.m.ObjectAttribute({
title : "concept_id",
text : "{test>Name}"
}),
});
var oHeaderPanel = new sap.m.Panel("oHeaderPanel", {
expandable : true,
expanded : true,
expanded : false,
headerText : "Concept details",
content : [
oConceptPanelHeader
content : [ oConceptPanelHeader
]
});
var oCommentPanel = new sap.m.Panel("oCommentPanel", {
expandable : true,
expanded : false,
headerText : "Add comment",
content : [ oConceptPanelComment
]});
var oContentPanel = new sap.m.Panel("panel6", {
]
});
var oContentPanel = new sap.m.Panel("oContentPanel", {
expandable : false,
expanded : true,
headerText : "Relations table",
content : [
oRelationsPanelHeader
]});
content : [ oRelationList ]
});
var oPage = new sap.m.Page({
title : "{i18n>app_head}",
showSubHeader : true,
subHeader : oSubHeader,
headerContent : [
new sap.m.Button({
// text:"lol",
icon:"sap-icon://home"
}),
new sap.m.Button({
// text:"lol",
icon:"sap-icon://account"
})
],
content : [ oConceptPanel, oContentPanel ]
headerContent : [ new sap.m.Button({
// text:"lol",
icon : "sap-icon://home"
}), new sap.m.Button({
// text:"lol",
icon : "sap-icon://account"
}) ],
content : [ oHeaderPanel, oCommentPanel, oContentPanel ]
});
return oPage;
......
......@@ -20,7 +20,7 @@ sap.ui.controller("conceptmapper.searchPage", {
relations: [
{
concept_id : "12121",
concept_name : "Heart Rate",
concept_name : "lab Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
......@@ -28,14 +28,24 @@ sap.ui.controller("conceptmapper.searchPage", {
validity : "Valid",
standard_concept : "S",
}, {
concept_id : "12121",
concept_name : "Heart Rate",
concept_id : "4545",
concept_name : "445454 Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
domain_id : "condition",
validity : "Valid",
standard_concept : "S",
},
{
concept_id : 213121231,
concept_name : "Hematocssdjfkl fls sfdj lsfd flsdkjflsd slfj sdljsdlj fsdl fjrite",
concept_code : "334-21",
concept_class_id : "pondi",
vocabulary_id : "SNOMED",
domain_id : "LOINC",
validity : "Valid",
standard_concept : "S",
}
]
......@@ -134,10 +144,12 @@ sap.ui.controller("conceptmapper.searchPage", {
"domain_id": oEvt.getParameters().rowBindingContext.getProperty('domain_id'),
"validity": oEvt.getParameters().rowBindingContext.getProperty('validity'),
"standard_concept": oEvt.getParameters().rowBindingContext.getProperty('standard_concept'),
"relations": oEvt.getParameters().rowBindingContext.getProperty('relations'),
};
sap.ui.getCore().setModel(new sap.ui.model.json.JSONModel(oData), "label");
}
app.to('idConceptDetailPage');
app.to('idConceptDetailPage', 'slide', {'adrienparrot': "jesuisgrand"}); //('fade', 'flip', 'show', 'slide =default')
},
......@@ -288,7 +300,6 @@ sap.ui.controller("conceptmapper.searchPage", {
return;
}
var concept = oTable_ref.getRows()[idx[0]].getCells();
debugger;
var oUpdateDialog = new sap.m.Dialog({
title : "{i18n>update_concept}",
......
......@@ -17,7 +17,7 @@
// create an app
var app = new sap.m.App({
initialPage : "idSearchPage"
initialPage : "idHomePage"
});
// Adding all the pages to the app
......
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