First Post
I have a top bar menu item of type input control (like search) which stores a value in RegularUser.SearchFilter and calls a process.
I would like to clear the input field and reset to the "Undefined" text the moment the user clicks enter.
Resetting SearchFilter to "" does not reset the UI. Does this require javascript in the Advanced Render section?
This is how far I've got so far. Am I on the right lines? Or is it much simpler than this?
$("#" + parser.m_widgetInfo.wrapperId).find("aw_menu_top_bar_RegularUser_SearchFilter").val("").change();
Programmatically clear input text
Re: Programmatically clear input text
My suggestion, at the end of the process that is called, add a line:
LoggedInRegularUser.searchField = UNDEFINED
Bruce
LoggedInRegularUser.searchField = UNDEFINED
Bruce
Re: Programmatically clear input text
Thanks for your reply.
I hadn't actually tried UNDEFINED (just "") unfortunatly setting it this way doesn't update the field in UI either.
It definitely sets the value to null though, which was useful to me for another purpose.
I hadn't actually tried UNDEFINED (just "") unfortunatly setting it this way doesn't update the field in UI either.
It definitely sets the value to null though, which was useful to me for another purpose.
Re: Programmatically clear input text
You'll need to set auto-refresh for the BO.unfortunatly setting it this way doesn't update the field in UI either.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Programmatically clear input text
I don't think he can.tford wrote:You'll need to set auto-refresh for the BO.unfortunatly setting it this way doesn't update the field in UI either.
Re: Programmatically clear input text
I've tried refreshing by adding the process which resets SearchFilter to undefined to the autorefresh processes list.
Also adding RegularUser to the autorefresh object list. I've even tried refreshing every 60 seconds.
Perhaps there a way to drop keys in to the input buffer like Control A, Delete?
Also adding RegularUser to the autorefresh object list. I've even tried refreshing every 60 seconds.
Perhaps there a way to drop keys in to the input buffer like Control A, Delete?
Re: Programmatically clear input text
The solution I settled for was using DISPLAY LAYOUT to clear the input field and redisplay the tab.
I added the command $("#aw-static-input47705_0").focus(); in the tab render script to ensure the input field regained focus. The field was then ready for further user input.
This is only really suitable if you want to completely refresh all the panels. Note also that the DISPLAY LAYOUT command preserves the Context so you may want to put it in a different process.
I added the command $("#aw-static-input47705_0").focus(); in the tab render script to ensure the input field regained focus. The field was then ready for further user input.
This is only really suitable if you want to completely refresh all the panels. Note also that the DISPLAY LAYOUT command preserves the Context so you may want to put it in a different process.
Re: Programmatically clear input text
Why not just have an Object called CustomSearch with an attribute 'Text' and display its very small stripped down form (transparent, no title, etc.) which has just the input box with a button following it?
The Banner frame could be arranged (using responsive - nested) to serve the same function as the Top Bar, and the form could display in one of its panels.
The Banner frame could be arranged (using responsive - nested) to serve the same function as the Top Bar, and the form could display in one of its panels.
Re: Programmatically clear input text
I do something very similar to this and it works very nicely. Allows auto-refresh to work as expected without DISPLAY LAYOUT.Why not just have an Object called CustomSearch with an attribute 'Text' and display its very small stripped down form (transparent, no title, etc.) which has just the input box with a button following it?
The Banner frame could be arranged (using responsive - nested) to serve the same function as the Top Bar, and the form could display in one of its panels.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Programmatically clear input text
Using an Object approach would mean you could also instead use a Query to display the search text entry field.
A Query is easier to strip down/make bare-bones than is a form.
The query would have inline editing enabled with an item operation button.
You could even save each custom search and build a history of what users are searching for if you wanted to be pedantic.
A Query is easier to strip down/make bare-bones than is a form.
The query would have inline editing enabled with an item operation button.
You could even save each custom search and build a history of what users are searching for if you wanted to be pedantic.
Re: Programmatically clear input text
Re: Object method .. interesting. I shall try it.
Thanks for all your feedback
Thanks for all your feedback