AngularStrap Typeahead with async call double popup - typeahead

I'm using AngularStrap Typeahead with an async call in my webapplication and i'm noticing a strange behaviour: when i select one entry from the list the selected value correctly displays in the typeahead, the popup disappears but shortly after a new popup comes out displaying only 1 entry, which is the one i already selected.
This happens only with async calls, and this issue also happens on the
official angulastrap showcase page.
Notice that the not-async calls are working properly.
Has anyone already faced and solved this issue?
Thank you.

Related

on-screen calculation with DA

when
:p1_radio_button_1
:p1_radio_button_2
:p1_radio_button_3
change,
dynamic actions fired to set values on
:p1_score_1
:p1_score_2
:p1_score_3
with simple math such as (:p1_lov_1's return value) * (a constant from global page) /100
and these changes on :p1_score_x fires another DA to do some other simple calculations.
eventually I am expecting a weighted_score to be calculated.
**
mechanically, it works. but when I click radio buttons a couple of times one after another, calculation goes crazy.
I believe my approach is wrong. What would you suggest? Should I submit the page after each radio button clicks?
Thanks in advance.
APEX version 18.x
browser Firefox
OS windows
I think chained dynamic actions are not the best idea. I changed the behaviour a little:
placed a dummyButton
hide realButton on page load
redirected dummyButton to page inline dialog saying to end user "please click calcButton"
show realButton when calcButton clicked
hide dummyButton when calcButton clicked
hide realButton & show dummyButton if anything changes on radioButtons
I wasn't sure if I should delete the post or reply it. admins; please delete if it somehow against the community rules.
thank you very much

iPadOS13 (b7), UIMenuController and multiple windows

Having problems popping a UIMenuController when using multiple (side by side) windows.
So I handle a tap in a view then I set the firstResponder to that view, then I present a UIMenuController in that view and the canPerformAction: is called on that view - all good!
I then attempt the same in the adjacent window (same code obviously) and the canPerformAction: is still sent to the previous view (in the other window.) Indeed, pressing the menu also results in the handler being called on the other view.
Both views return YES from canBecomeFirstRepsonder:
Anyone got any ideas?
Thanks
Turns out you need to call [view.window makeKeyWindow] prior to calling [view becomeFirstResponder] prior to presenting the UIMenuController.
Makes sense I guess...

QMenu activated multiple times

I was playing around with the Qt demo browser example mentioned here and noticed an anomaly when I tried making a minor change to the bookmark handling code.
My intention was to make the bookmarks in the toolbar open up in a new tab instead of the existing tab. It works perfectly for the bookmarks that are located directly on the bookmarks tab. But the bookmarks inside a folder are the ones which are behaving weirdly.
I modified the BookmarksToolBar::activated SLOT in the bookmarks.cpp to open the url in a new tab instead of existing tab. That's when I noticed that the SLOT is being called multiple times, the count being equal to the number of times the menu is rendered. i.e, the first time a menu item is activated, the SLOT is called once, the next time an item is activated, the SLOT gets called twice and so on.
I thought there must have been multiple signal-slot connections and thus I checked on the BookmarksToolBar::build() method where the signal-slot connection is done and found that the control flow enters the method only once. I am finding it hard to figure out how the SLOT is being called multiple times.
The project is question is an example project 'Tab browser' which comes with Qt and can be accessed by clicking on 'Examples' on the Qt-Creator welcome screen. Thus I did not post any source code here.
Any guidance or help in understanding the cause for this anomaly and possible solutions to fix it would be appreciated.
Found the cause of the problem and solution myself. The root of the problem is in modelmenu.cpp.
Apparently the ModelMenu::createMenu method connects the QMenu::triggered and QMenu::hovered signals to SLOT each time the method is called. The SLOT triggered emits the signal ModelMenu::activated.
Using Qt::UniqueConnection should solve the issue.
Replacing this:
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(triggered(QAction*)));
connect(menu, SIGNAL(hovered(QAction*)), this, SLOT(hovered(QAction*)));
With this:
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(triggered(QAction*)),Qt::UniqueConnection);
connect(menu, SIGNAL(hovered(QAction*)), this, SLOT(hovered(QAction*)),Qt::UniqueConnection);
Fixed the problem. Just leaving this here hoping this would help someone in future.

asp repeater itemcommand not working on second click

I have a repeater which I bind the data using Bind method from the database. There is a Asp:Button with an onclientclick and onclick event. In OnClientClick I open a new window and onclick I am adding the data to the database. This works perfectly on the first Page load. After first click on any of the buttons in the repeater, the click events stops working on subsequent clicks.
I have spending hours on finding a solution for the same, can any one guide me where i am going wrong what needs to be done.
P.S: My application is AJAX Enabled , using WCF and JQUERY
Thanks & Regards,
Phani...
Never Mind I got it solved my self. For others who are trying to solve the same issue, here is the solution:
The code below opens up a new window with out popup blocker blocking the window
OnClientClick of the button write Javascript like below to open a new window and refresh the parent window (I have to do this as the ItemCommand event was not firing until the page is refreshed)
OnClientClick = "target='_blank'; setTimeout("location.reload(true);", timeout);
Phani...

After Navigate2 Method returns S_OK Stuck at READYSTATE of READYSTATE_LOADING

I am working on a MFC Document View architecture application which has multiple documents and views and a tabbed window interface.
I have been tasked with making an automatic switch to another tab on the press of the OK button in one of the other tabs. When the other tab is clicked on it uses a C++ wrapper over IWebBrowser2 to navigate to a specific web page.
When this is done manually by clicking on the tab everything is fine and the webpage within the view loads successfully.
In my first attempt at doing this the tab successfully switched in response to a call to
AfxGetMainWnd()->SendMessageToDescendants(SOME_MESSAGE, ...);
however by sending this windows message at the wrong point the application would crash once control returned because the chain of events caused the (modeless) dialog (*) that
sent the message, to no longer exist.
I then found the correct place to make the call, but now when the other tab is activated, it no longer displays the webpage as it should.
To debug this problem I added code to check the READYSTATE in both the situation where it works and the situation where it does not. When the page fails to load (despite the call to Navigate2 returning S_OK), the READYSTATE just stays at READYSTATE_LOADING.
Unfortunately now I am to many edits away from when I had it partially working.
I have added TRACE statements to the most obvious events such as OnSetFocus, CView::OnActivateView but all traces come out in the same order despite the behaviour being different
* hosted in the view