gridfilter load store by a custom method - extjs

if in an extjs grid filter, I set the autorelaod to false and I want to reload the store when the user clicks outside the filter, how do I go about it? I am looking at:
filter.onblur(
check to see if filter value has changed
if yes,
fire :'updateFilter'
)
Is this correct?
The second question is: If I wish to load the store via a custom loader method...I cannot afford to call 'updatefilter'. But I am at a loss to figure out what are the events I need to fire in sequence so that my custom method will be called.(instead of the default store.load)
Thank you

I think the event is 'update'.
Explained in docs 'Ext.data.Store-event-update'

Related

AngularJs Restangular get in interval

I must check data in API every for example 5sec and pass to array which is binding to html. When I invoke function in $interval like this:
$interval(refreshData, 5000);
It works, but destroy any other action which I doing for example close dropdowns etc.
What is the best way for create GET in specific interval?
I saw that in Firefox is ok, only Google Chrome,cancel any actions like coil selected dropdown list etc. when I load data to variable in promise. Anyone have idea why it happen?

commandButton issue

Currently I have a two commandButtons:
one to execute a validation using actionlistener that populates a Return.inputValue
and another to move the return value from the previous listener to a
pageflowscope variable as below
<amx:commandButton text="commandButton1" id="cb4" action="godecide">
<amx:setPropertyListener from="#{bindings.Return.inputValue}" type="action" to="#{pageFlowScope.ReturnValue}"/>
</amx:commandButton>
<amx:commandButton actionListener="#{bindings.CheckUser.execute}" text="CheckUser"
disabled="#{!bindings.CheckUser.enabled}" id="cb3"/>
How can achieve this with one command button please?
I think you can call a method in the button action and within that method take the value from Return, set this value whenever you want and then redirect the page to some other page. As you want to have this value in pageFlowScope, define the scope of the bean in adfc-config as pageFlow or I thing Session should be fine as well.
There are two approaches:
Do everything you need within the taskflow action. Thats the action you have described in first button, you can add method call, used in the second button as a listener.
Do all the job in your bean. Set actionListener in the button, that will handle all the work needed to be done.
In both cases you can keep propertyListener to set this value.
Give more details on the case, if you need further explanation.
in first command button execute method via action which will your required task and in actionListner pass that generated value to other manager that is fine.
by this you no need to use sesssion moreover session are havey.

Backbone view based on model from collection, how to update view?

I am looking for a bit of direction I am still fairly new to Backbone and am currently creating a test application to learn more.
My problem is this, I am populating a backbone view with a underscore template. I load a collection of models, then I find the model I need and populate these values into the template. There can be many pages based on the template so I have a dynamic route that accepts an id.
My problem is I want to add a next feature, that would change the current page and reload the template with the new model.
I have tried a crude method along the lines of :
Backbone.history.navigate(newLocation)
However this did'nt work, please note newLocation is actually populated with the route and the id I want to navigate to.
I will add some code from my view below, I won't include the full code however if it is needed please ask.
Any help or a push in the right direction would be great.
Thanks in advance
You need to use your router object's navigate method rather than than history's class method, and you need to pass it the option `{trigger: true} in order to invoke the corresponding route function.

Show custom pop up warning message when user changes any value (text box/LOV) on page

I have requirement to show custom pop up warning message when user changes any value (text box/LOV) on page and close tab/cancel button by mistake.
Option I tried are:
a) Within application we are using a complex task flow/RegionModel for 7 different scenario's. Also requirement is to display custom message - Hence could not use approach "unsaveddatawarning"
http://www.oracle.com/technetwork/developer-tools/adf/unsaveddatawarning-100139.html
b) Second option I tried was to have custom region controller:
CustomRegionController implements RegionController
Inside validateRegion(RegionContext regionContext) thought to find if page data is dirty
AdfFacesContext.getCurrentInstance().getDirtyPageHandler().isDataDirty();
or
DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCDataControl cDataControl = dcBindings.getDataControl();
boolean dirtyFlag = cDataControl.isTransactionModified();
In both scenario it always gives true (seems due to common set of VO/View Link application module always gets dirty when data is being rendered on page load).
Last option I am left with is to invoke valueChangeListener for each element (textbaox, LOV, Check box). I do not like this option at all. Please suggest if there can be better way to handle this scenario.
Why is using a value change listener a problem? Have each input component call the same VCL method in the backing bean. If necessary you can get the component id from the vcl event object.

How to reset GridFilter in extjs

This is what I am doing:
this.TabPanel.Grid.getStore().clearFilter (false);
alert(this.TabPanel.Grid.getStore().isFiltered());
and the alert shows: false. When I go on the page, I see that the filter is still selected(checked) and the results are also fitlered. What I am missing?
EDIT:Can I get a handle to the gridfilter object through my store? If yes, I can call the gridfilter.clearFilters().
How is that code running? Can you post a more complete example? If you have some component that is a user is using to set the filter(like some check box or something), you will still need to clear that manually as well.

Resources