On 7/29/2013 10:59, ChilliPeppers wrote:
Hi Holger,
Thanks for the previous two responses. Very helpful. Going for 3 out
of 3 now!
I'm still struggling to get the syntax right for publishing a resource
to the gadgets hub correctly. The following code is supposed to,
onSelect, publish the instance of a selected row in a ResultsSetGrid
to the hub so that it will be refreshed by swa:ViewFormGadget and the
centre panel will load the respective form for the selected resource.
Not working and costing me many, many, many hours of frustration.
Could you please put me out of my misery
Thanks.
<swa:ResultSetGrid
arg:onSelect="gadgets.Hub.publish('org.myui.resourceSelectedEvent',
data['Attribute'])" arg:resultSet="{#
SELECTDISTINCT?Attribute?Description
WHERE {
?Attribute (rdfs:domain)+ ?this .
?Attribute a my:Attribute .
BIND (ui:label(?Attribute) AS ?label) .
}
ORDER BY (?label) }" arg:type="{= ?resource }"/>
Have you tried debugging what the actual data value is? For example,
change the onSelect to
alert(data['Attribute'])
as a debugging aid. You may find that instead of the URI, it is sending
the human-readable label of the resource to the event hub. In order to
get the URI you could introduce an invisible column, as shown in the
snippet taken from swa:TemplateCallDialog:
<swa:ResultSetGrid arg:hiddenColName="id"
arg:onSelect="var resource=data['id'];{= ?callback }"
arg:resultSet="{#
SELECT ?id ?result
WHERE {
?rs spr:rowIndices ?rowIndex .
BIND (spr:cell(?rs, ?rowIndex, 0)
AS ?result) .
BIND (xsd:string(?result) AS ?id) .
} }"/>
The trick is to create an invisible column (above: ?id) that has the
xsd:string of the resource (?result).
HTH
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 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
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.