On 11/22/2012 9:31, Aubrey Beach wrote:
Hello everyone,

I am brand new to TopBraid and my goal is to build a UI for an existing ontology file, but I am running into some issues identifying how to pass selected values from a tree widget to the grid view. I have modified some of the examples from the SWA Help section, but I'm going crazy trying to figure out how to get this working. For example, when someone clicks "Radiation" the results should be filter from the default view. Any advice would be extremely helpful! I am having a hard time finding beginner documentation.

My code within UI.Prototype:

<swa:FullScreenBorderLayout arg:westSize="200">
    <div class="ui-layout-west">
        <swa:Header arg:label="Find Data By Parameter"/>
<swa:Tree arg:dataProvider="swa:ClassTreeDataProvider" arg:id="classTree" arg:onSelect="swa.loadWithResource('form', 'resource', resource)" arg:root="eso:ScienceParameter"/>
    </div>
    <ui:loadable class="ui-layout-center" ui:loadId="form">
        <swa:ResultSetGrid arg:resultSet="{#
                SELECT ?variableName ?parameter
                WHERE {
                    ?variableName eso:parameter ?parameter .
                    ?parameter rdfs:subClassOf ?this .
                }
                ORDER BY (?parameter) }"/>
    </ui:loadable>
</swa:FullScreenBorderLayout>

The query in the loadable above can refer to the variable ?resource to filter its results. So one way (untested) would be to rewrite it as

<ui:loadable...
    <ui:if ui:condition="{= bound(?resource) }">
<swa:ResultSetGrid arg:resultSet="{# ... query that depends on ?resource }" />
    </ui:if>
</ui:loadable>

The effect of this is that the loadable will remain empty until the first click on the tree has been made. Your onSelect handler sets the variable ?resource (second argument of swa.loadWithResource) when the loadable gets reloaded. Try replacing ?this with ?resource in your original query.

HTH
Holger

PS: Yes the documentation needs to be further extended, meanwhile please feel free to ask here because it gives us some ideas on what beginners are struggling with.

--
-- 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 Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en


Reply via email to