Starting from the following HTML code, which generates 2 select boxes and a submit button I could not succeed to launch the app:series_por_canal AFTER pressing the search button.
I have replaced the original xquery function by a simple "hello" example because the effect is the same..
<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page_pru.html" data-template-at="content">
<form>
<fieldset>
<legend>Análisis de series:</legend>
<div class="form-group" data-toggle="tooltip" data-placement="left" title="Nombre de canal">
<div id="col-md-12 col-xs-12">
<span class="app:Lista_canales"/>
</div>
</div>
<div class="form-group" data-toggle="tooltip" data-placement="left" title="Potential Issues">
<div id="col-md-12 col-xs-12">
<span class="app:Lista_problemas"/>
</div>
</div>
<button id="f-btn-search" type="submit" class="btn btn-primary" action="app:dumb_example">
Search
</button>
<!-- <div id="results" class="app:dumb_example"/> -->
</fieldset>
</form>
</div>
the xquery function now is:
declare function app:dumb_example($node as node(), $model as map(*)) {
let $name:="John Smith"
return
<p>Hello {$name}!</p>
};
This is a snapshot of my output after entering the page:
After making my selection on the 2 boxes and pressing the search button nothing happens (no error either), seems as if the action attribute is not valid to launch an xQuery.... if that is the case, what are the alternatives to do this?
Uncommenting the row where series_por_canal is called with class attribute it works, but running the query in parallel instead of after pressing the button. In this case I can live with that (with no parameters selected the output table will be empty as shown in the snapshots below) but would anyway like to understand how to run a xquery function after pressing a form button.
Thanks in advance for your advice....
This is the page.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta data-template="config:app-meta"/>
<link rel="stylesheet" type="text/css" href="/exist/apps/analisis-programacion/resources/css/exist.css"/>
<!-- <link rel="stylesheet" type="text/css" href="/exist/apps/analisis-programacion/resources/css/style.css"/> -->
<script type="text/javascript" src="$shared/resources/scripts/jquery/jquery-1.7.1.min.js"/>
<script type="text/javascript" src="$shared/resources/scripts/bootstrap.min.js"/>
<!-- <script type="text/javascript" src="$shared/resources/scripts/loadsource.js"/>-->
<!-- <title data-template="config:app-title">App Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> -->
</head>
<body id="grey-top">
<div class="grey-bot">
<div class="container-fluid" id="main-container">
<div class="row-fluid">
<div class="span12" id="header">
<img src="/exist/apps/analisis-programacion/resources/images/Logo.png"/>
</div>
</div>
<div class="row-fluid">
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"/>
<span class="icon-bar"/>
<span class="icon-bar"/>
</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="dropdown" id="about">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Home</a>
<ul class="dropdown-menu">
<li>
<a href="index.html">Start page</a>
</li>
</ul>
</li>
<li class="dropdown" id="about">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reports</a>
<ul class="dropdown-menu">
<li>
<a href="/exist/apps/analisis-programacion/views/reports/prg_level_01.html">Series por canal</a>
</li>
<li>
<a href="/exist/apps/analisis-programacion/views/reports/prg_level_02.html">Masters duplicados</a>
</li>
<li>
<a href="/exist/apps/analisis-programacion/views/reports/prg_level_03.html">Series programadas</a>
</li>
</ul>
</li>
<li class="dropdown" id="about">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Search</a>
<ul class="dropdown-menu">
<li>
<a href="/exist/apps/analisis-programacion/views/search/search.html">Search</a>
</li>
</ul>
</li>
<li class="dropdown" id="about">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Administration</a>
<ul class="dropdown-menu">
<li>
<a href="/exist/apps/analisis-programacion/views/admin/upload.html">Upload new file</a>
</li>
</ul>
</li>
</ul>
<!--<div id="login_form">
<div class="results app:get-login"/>
</div>-->
</div>
</div>
</div>
</div>
</div>
<div id="content" class="row-fluid"/>
</div>
</div>
</body>