0

Hi I have a table widget in Polarion. If a button is clicked the query of the table should be changed and the widget updated. I tried to change the query in the html, but i was not able to refresh the widget after that:

<button id ="target">Test</button>
<script>
$( "#target" ).click(function() {
    $(".queryClass").html('${esc.h}if(!${esc.d}pageContext.taskIds.equals("")) id:(${esc.d}pageContext.TaskList) AND NOT status: "closed" ${esc.h}else NOT*.* ${esc.h}end');   
});

</script>

Is it possible to update the parameters of a widgt with a button click?

Der Altmann
  • 147
  • 8

1 Answers1

2

Not really. See the widgets are generated on server side and transmitted to the browser. They do some asynchrous request to load their data after loading the page, but you cannot trigger this as you cannot change the content of widget itself.

You can however use a classic wikipage and get data via normal javascript via a servlet.

Peter Parker
  • 29,093
  • 5
  • 52
  • 80
  • 1
    thank you very much :) I found a workaround to update the query: I used a page parameter and in the table the query is dependent from the parameter. If the page parameter is changed the widgets are all updated. – Der Altmann Nov 10 '20 at 10:22
  • Can you make an example how I can execute a sql query with javascript in the classic wikipedia? – Der Altmann Nov 10 '20 at 10:23