Hi Jack,
first off I would define "static" JavaScript functions in auxiliary .js
files instead of defining them inline. This makes editing and debugging
easier. The only cases where I would insert JavaScript into the SWP
would be if the code itself needs to be generated dynamically, depending
on SPARQL queries etc. To get your own .js file into a web application,
use ui:headIncludes.
On 7/19/2014 9:58, Jack Hodges wrote:
The following <ui:group> defines a javascript function that is called
when an item in the tree is selected for viewing. In this body all
that is stipulated is the url for the resource. In most of my views I
can select what kind of view is used with a match-id or a priority. Is
the ui:instanceView selected based on whether it (the resource type)
is a class or an instance? Certainly not in this function:
<ui:group>
<script>var serverURL = ''; // 'http://localhost:8083/tbl/';
function openInNewTab(resource){
var url=document.URL;
var q= url.indexOf('?');
var sendTo= url.substring(0,q)+"?_resource="+resource;;
//alert('openInNewTab ' + sendTo);
window.open(sendTo);
}</script>
</ui:group>
I want to be able to determine which view will be used when and item
in the tree is selected. Can I construct the URL to use any SWP or
will it be overridden?
The rules of when which views are selected are specified in the SWP
manual, esp. in
http://uispin.org/ui.html#linking
As a general rule, you should use ui:instanceView to associate the
classes from your domain model with your customized views. If nothing is
specified for a class, it will walk up the class hierarchy, eventually
reaching rdfs:Resource where the SWA ontology defines some standard views.
I would just try it except that everything is taking so damned long I
might as well submit the question and wait for some kind of response
here :-(
Something seems seriously broken in your set up, and just repeating the
same complaints doesn't help - we need to get to the ground of that.
What have you tried to overcome the slowness and what is going on in
your workspace that could explain this? We do not have the problems you
describe and use SWP on a daily basis - most of our own product code
base uses SWP and SWA for the web user interfaces.
Holger
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL
Web Pages and SPIN.
To post to this group, send email to
topbraid-users@googlegroups.com
To unsubscribe from this group, send email to
topbraid-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.