<script type="text/javascript">
var displayName = "";
function buttonHandler()
{
if (displayName.length > 0)
{
//Set the name of the destination wiki page,
//and the text we'll use for filtering.
var params = {};
params['name']= 'showFilter';
params['displayName'] = displayName;
// Build the URL to the destination page.
// In building the URL for the "Show Filtered Grid" page, we use the following arguments:
// controller - The current controller (wiki)
// action - The wiki controller's "page" action
// containerPath - The current container
// parameters - The parameter array we just created above (params)
window.location = LABKEY.ActionURL.buildURL(
"wiki",
"page",
LABKEY.ActionURL.getContainer(),
params);
}
else
{
alert('You must enter a value to submit.');
}
}
Ext.onReady(function() {
var filterField = new Ext.form.TextField({
id : 'filter-field',
fieldLabel : 'Search text',
style : { margin: '10px' },
labelStyle : 'margin:10px;',
listeners : {
// Set the global variable whenever the field is changed.
change : function(field, newVal, oldVal) {
displayName = newVal;
}
}
});
var submitBtn = new Ext.Button({
text : 'Submit',
style : {
margin : '10px',
float : 'right'
},
handler : buttonHandler
});
var theForm = new Ext.form.FormPanel({
id : 'the-form',
renderTo : 'theFormDiv',
title : 'Enter search text for filtering the list',
autoHeight: true,
width : 400,
items : [ filterField , submitBtn ]
});
});
</script>
<div id="theFormDiv"></div>