Skip to content

Commit

Permalink
init form page
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Nov 23, 2024
1 parent ddc9a44 commit 5f383b2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dev-page/scripts/init-form-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,19 @@ sparnaturalForm.addEventListener("queryUpdated", (event) => {
// Listen for form submission and trigger YASQE query
sparnaturalForm.addEventListener("submit", () => {
sparnaturalForm.disablePlayBtn();
yasqe.query();
let finalResult = sparnaturalForm.executeSparql(
yasqe.getValue(),
(finalResult) => {
// send final result to YasR
yasr.setResponse(finalResult);
// re-enable submit button
sparnaturalForm.enablePlayBtn();
},
(error) => {
console.error("Got an error when executing SPARQL in Sparnatural");
console.dir(error);
}
);
});

console.log("init yasr & yasqe...");
Expand Down

0 comments on commit 5f383b2

Please sign in to comment.