Holger Knublauch

app:reloadable

......@@ -6869,6 +6869,18 @@ This expression is called if a node and a predicate/subject type combination is
rdfs:range app:WeightedExpression ;
rdfs:subPropertyOf app:systemProperty .
app:reloadable
rdf:type ui:NodeClass ;
rdfs:comment "Marks the children of this element as reloadable through an Ajax request. The JavaScript function appReload (which can also be produced through the SPIN function app:reload) can be used to trigger a reload."^^xsd:string ;
rdfs:label "reloadable"^^xsd:string ;
rdfs:subClassOf ui:ControlElement ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the reloadable element."^^xsd:string ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
app:removeUniqueId
rdf:type spin:Function ;
rdfs:comment "Takes a string and removes everything after the :: (including the :: itself). This is needed to de-code tree node ids."^^xsd:string ;
......
......@@ -173,6 +173,14 @@ a:active.appFormHeaderLink {
background-position: -16px 0px !important;
}
.appLoadingIndicator {
background-image: url(images/appLoadingIndicator.gif);
background-repeat: no-repeat;
background-position: 8px 8px;
width: 32px;
height: 32px;
}
div.appTop {text-align:right}
div.appTop div {display:inline; white-space:nowrap}
div.appTop div.appLeft {float:left}
......
......@@ -212,6 +212,27 @@ function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphU
}
function appReload(id, args) {
var e = $('#' + id);
var base = e.attr('reload');
if(!base) {
alert('Error: Invalid use of appReload: Missing reload attribute at ' + id);
return;
}
var url = base;
if(args) {
var c = {};
for(var key in args) {
c['_scope' + key] = args[key];
}
var p = jQuery.param(c);
url = p + "&" + base;
}
e.html('<div class="appLoadingIndicator" />');
e.load(uispinServlet, url);
}
/**
* Loads a SearchResultsGrid based on the selections in a form with
* a given id. Will replace the content of a given target element.
......
......@@ -47,28 +47,25 @@ log:LogBrowser
[ rdf:type app:Tree ;
arg:dataProvider log:LogEventClassTreeDataProvider ;
arg:id "classTree"^^xsd:string ;
arg:onSelect
[ rdf:type app:createLoadSearchFormCall ;
arg:noBorder "true"^^xsd:boolean ;
arg:oldElementId "searchForm" ;
arg:queryGraph <http://www.reportinghub.no/graph/logging> ;
arg:resourceTypeCode
"resource" ;
arg:resultsId "results"
] ;
arg:onSelect "appReload('form', {resourceType: '<' + resource + '>'})"^^xsd:string ;
ui:childIndex 1
] ;
ui:childIndex 0
] ;
ui:child
[ rdf:type html:Div ;
html:id "formHolder"^^xsd:string ;
[ rdf:type app:reloadable ;
arg:id "form"^^xsd:string ;
ui:child
[ rdf:type app:SearchForm ;
arg:formId "searchForm"^^xsd:string ;
arg:noBorder "true"^^xsd:boolean ;
arg:queryGraph <http://www.reportinghub.no/graph/logging> ;
arg:resourceType log:LogEvent ;
arg:resourceType
[ rdf:type sp:coalesce ;
sp:arg1 [ sp:varName "resourceType"^^xsd:string
] ;
sp:arg2 log:LogEvent
] ;
arg:resultsId "results"^^xsd:string ;
ui:childIndex 0
] ;
......