asp repeater itemcommand not working on second click - repeater

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...

Related

How can I Close a popup window, after execute Update SQL. (Oracle APEX 21.1)

I created a pop-up page. That pop-up window has a radio button, a text box, and an execute button. I want to work that page working like... when pressing the button, run a update SQL with the values of the radio button and text box, and close itself.
I tried that answer in the following link. But the pop-up page just reloaded and the page stayed open. How to close popup window in Oracle-apex?
If possible, I would like to validate the value of the text box. If it was an incorrect value then break the process with a message. If path that validation, run a update SQL and close the pop-up window.
Thank you for your kindness for read this confusing question.
You should be using a "Close Dialog" process type after your Save Process.
Make sure that you also set the server side condition accordingly so that the dialog only closes after your save process.
I GOT RESOLVED IT!
Not use any close method, redirect util is fine work like this APEX_UTIL.REDIRECT_URL (APEX_PAGE.GET_URL(p_page => 7));
Thank you to all ppl for look this page :)

CWnd::SetRedraw(False) make mouse go throught window

So I have a MFC application which flick when we do some action.
So I figured I would set SetRedraw(false) and set it to true at the end of the function.
The application doesn't refresh anymore but if I click on it while SetRedraw(false), my cursor is not catched by my application, it goes throught it and set focus on the application below.
Anyone has some kind of idea how I could fix that.
I ended up using CWnd::LockWindowUpdate instead after some research.
It freezes the update but doesn't act if the window was transparent.

Cant focus Firemonkey application when modal dialog open, unless modal dialog itself is clicked

I have an application in which users, upon logging in, are prompted with a modal dialog where they must choose the facility they wish to work out of. At this stage, the application looks like this:
The modal dialog is shown by calling this method:
bool __fastcall ShowFacChoiceForm()
{
TFacChoiceForm *Form = new TFacChoiceForm( Application );
bool Result = ( Form->ShowModal() == mrOk );
delete Form;
return Result;
}
In this case, TFacChoiceForm inherits from TForm so the ShowFacChoiceForm() function is calling the standard TForm.ShowModal method documented here.
The issue I am running into is that if my application loses focus, it cannot become the active window again unless the modal dialog itself is clicked. To better illustrate this, I will present the following scenario:
Lets say its Friday afternoon and I decide to goof off a bit and read some web comics. With my application open, I open up another window on top of it, like so:
Then, out of nowhere my boss comes in for a performance review, and I attempt to refocus my application by clicking somewhere on the main form. For example, at the position of this red X in the next image.
In the above image, I have clicked at the location of the red X. Now, both the form containing the web comic, and my application are inactive. Thus, my application does not come to the front of the screen.
However, if I am able to click somewhere on the modal dialog, like the red X in the following image...
...then my application comes to the front like one would expect.
To solve this, I have looked at using something like SetForegroundWindow from the Windows API, but I have not been able to find a way to trigger the event, since my main form does not fire events while I have a modal dialog open.
My question is, how can I make sure that if the user clicks anywhere on my application that it is brought to the front? Is there a property I can edit in my form to do this?
If you set modalresult to mrcancel in the ondeactivate of the modal dialog then the main form will get focus when its clicked. You can then check if the user is logged in the mousedown event of the main form and if not, show the modal dialog again.

Going back to the main page after closing the pop up window

I am having a problem on handling the pop up windows in robot framework.
The process I want to automate is :
When the button is clicked, the popup window appears. When the link from that popup window is clicked, the popup window is closed automatically and go back to the main page.
While the popup window appears, the main page is disabled, and it can be enabled only when the link from the pop up window is clicked.
The problem I have here is that I cannot go back to the main page after clicking the link from the popup window. I got the following error.
20140604 16:04:24.160 : FAIL : NoSuchWindowException: Message: u'Unable to get browser'
I hope you guys can help me solve this problem.
Thank you!
I had the same issue and here is the method to resolve the issue
String window = driver.getWindowHandle();
Now click the button to invoke the popup and give some wait time
and then switch to ur new window with the below code
driver.switchTo().window("your new window name");
//perform your action in the new window and then
To get back control over your main page after the popup closes, use the below code
driver.switchTo().window(window);
This will help you activate the main window and continue your action there.
Let me know if this helpw
No idea in Python but in Java you can use below code after pop opened to solve your problem:
Object[] parentHandle = myDriver.getWindowHandles().toArray();
myDriver.switchTo().window((String) parentHandle[0]);
In the first line of code parentHandle is the number of current
windows in Array form. And in second line of code I am switching to
the first window, for second window you can use 1.
If still have problem or you need something else, please suggest.
I have seen this issue and found that there is a recovery period where Selenium does not work correctly for a short time after closing a window. Try using a fixed delay or poll with Wait Until Keyword Succeeds combined with a keyword from Selenium2Library.

How to capture events fired from new Popup IE window

Greetings!
Situation:
My ActiveX DLL contains a customized webbrowser. The webbrowser displays a web page. When user clicks the link within the displayed page, a new IE window pop up and navigate to the clicked link URL.
Question:
How can I capture the DocumenComplete and NavigateComplete events fired from the NEW pop up IE window?
What I already tried:
I tried to capture the
*NewWindow2(IDispatch **ppDisp,
VARIANT_BOOL Cancel)
event fired from customized webbrowser (not new IE window), and obtained the pointer ppDisp which points to the new IE windown. I tried to use this pointer as event source to advise or connect to the event handler (IDispatch::Invoke) for event capture. However it does not work. Maybe the failure is because the document in new IE window has not been loaded yet. I am not sure.
Can you please give me an suggestion what I should do?
Thanks!
You don't obtain the new web browser in ppDisp. You create one, sink events, and return its application property in ppDisp to the event.
void CYourDlg::OnNewWindow2(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel)
{
CDlgNewWB* dlgNewWB = new CYourDlg;
this.listDialogWeb.Add(dlgNewWB);
dlgNewWB ->Create(IDD_WBDLG_DIALOG);
dlgNewWB ->m_webBrowser.SetRegisterAsBrowser(TRUE);
*ppDisp = dlgNewWB ->m_webBrowser.GetApplication();
}