Web control in bada not loading if created with UiBuilder - c++

I'm trying to display a webpage inside the web control, when I create the control programmatically all works perfectly, but when I create the control using the Ui Builder (XML) and then get the control and instruct it to load a url:
__pWebControl = static_cast<Web*>(GetControl(L"IDC_WEB1"));
__pWebControl->LoadUrl("http://www.google.es");
it just shows a blank page, like nothing has done.
(Note: I've tried to call form->RequestDraw() with no success either)
Thanks.

Did you try waiting about two seconds before the redraw?
I've been using Osp::Web::Controls::Web in my apps extensively to display any kind of (non-editable, formatted) text. I ended up having to wait about a second or two before refreshing the entire frame to see any content in it.
OnTimerExpired(Osp::Base::Runtime::Timer& timer)
{
m_pFrame->RequestRedraw();
delete pTimerImp;
}
the timer is set like this:
pTimerImp = new Timer;
pTimerImp->Construct(*this);
pTimerImp->Start(2000);
Redrawing without waiting has always resulted in empty Web's on both WQVGA (slower) and WVGA (faster) models under both 1.1 (WQVGA) and 1.0/1.2 (WVGA).
Have you tried doing the same trick? It may help.

Have you tried to use Reload() after LoadUrl()?
I use SDK 2.0.3 and there is a WebControl which works quite well, so if you still have this problem, try the new SDK Version.

Related

CEFsharp load url is holding on to the previously navigated url

We have a C++ application (using Owl UI framework) which calls a CEFsharp Chromiumbrowser control inside an owl dialog. It is working perfectly the first time and the chromium embedded control shows the page properly. It is important to mention here that the first url which is say "http//www.someurl" navigates internally to "http://www.anotherurl/opensomething" each time. When we close the Owl MDI window and then try to open it again, the CEFSharp browser control tries to go straight to "http://www.anotherurl/opensomething" instead of going to "http//www.someurl" which it is being specifically asked to navigate to. We are using Chromiumbrowser load method to load the url but just cannot make it to load the first url from the second time onward. Our CEFsharp version is 63.03 . However if we open the chromium browser control in its own window and not embed it inside the MDI dialog it works perfectly everytime. Can't figure out so far as to why this is not loading the url properly from the second time around. Thanks for any help in advance.

Opening and testing a sub-window programmatically made in Vaadin, using Vaadin TestBench

Good day, fellow stackoverflow users. I have a problem using Vaadin TestBench in order to test a sub-window.
To be more specific, I've programmed a "popup" window that will be invoked by the main application when such application fails for whatever reason. As this sub-window doesn't have an URL, it will simply be invoked programmatically. I'm having problems coming up with a way of testing this single sub-window, as I have searched and read the Vaadin documentation, but all examples I see involve creating a driver for a certain browser, invoking a URL, accessing its elements and then doing the tests.
All I want is something like this:
Window popup = new Window() // Create sub-window (popup) programmatically
// instead of navigating to an URL with a web driver
// Here, I select the elements of the popup and do actions on it
// programmatically
...
// End the test and close the popup window
popup.close()
Is there a way of accomplishing this feat? I'm using the latest version of Vaadin on Springboot.
Vaadin Testbench and Selenium use the same base. You can reach the popup in the same way you do in Selenium:
driver.switchTo().activeElement();
or (if it is an alert)
driver.switchTo().alert().submit(); //submit = click OK, maybe it differs from your intention
If your "popup" is a separate browser window, you can switch by windowHandle.
driver.switchTo().window();
Hope this helps :)

ListView in android for dynamic data

how to refresh List View dynamic data content in android?
I tried loading dynamic data for the List View in android application but no luck .Any advice how to accomplish this?
Call notifyDataSetChanged() on your Adapter object once you've modified the data in that adapter.
Some additional specifics on how/when to call notifyDataSetChanged() can be viewed in this Google I/O video.
Or else Look at this link.it may helpful.
Dynamic ListView in Android app
Or else
The right thing to do is to call notifyDataSetChanged() on your Adapter.
Troubleshooting
If calling notifyDataSetChanged() doesn't work all the layout methods won't help either. Believe me the list view was properly updated. If you fail to find the difference you need to check where the data in your adapter comes from.
If this is just a collection you're keeping in memory check that you actually deleted the item from the collection before calling the notifyDataSetChanged().
If you're working with a database or service backend you'll have to call the method to retrieve the information again (or manipulate the in memory data) before calling the notifyDataSetChanged().
The thing is this notifyDataSetChanged only works if the dataset has changed. So that is the place to look if you don't find changes coming through. Debug if needed.
UI Thread
It is true that this has to be called from the UI thread. Other answers have examples on how to achieve this. However this is only required if you're working on this information from outside the UI thread. That is from a service or a non UI thread. In simple cases you'll be updating your data from a button click or another activity/fragment. So still within the UI thread. No need to always pop that runOnUiTrhead in.
More Information
Another nice post about the power of list Views is found here:http://www.vogella.com/articles/AndroidListView/article.html

Access content property in the debugger

how can i access the content property of a controller within the chrome debugger.
I really try to find a way to debug my application. So far i can't find a way to do that.
Thank you
Alex
add the statement
debugger;
in the method you want to debug,
Open Google Chrome, CTRL+SHIFT+i
Hit the URL of your application, navigate to the state where you think the code would run
Google Chrome automatically stops at the debugger; statement and focuses you to the sources/scripts tab as you can see in the picture
Inside the Watch expression tab click on the "+" too evaluate code in your case it would be
this.get("content");
As long as you have this breakpoint you can switch to the console panel and execute the code in that context, whenever you are done you can either close the panel by clicking CTRL+SHIFT+I or the close button down there, you can add breakpoints manually by clicking on the line number as well , Hope this helps
For more info
I'm using Ember Extentions which is not ready yet but certainly usable.
There are 2 possibilities
Use the Ember Inspector Tool for Chrome: It is not officially released yet, but from what i have heard it seems usable. I had no time to try it myself yet, but here is an article telling you how to install and use it.
Get access to your controller in the console of your browser. And then examine it as you like. Here is the code to get access to your controller.I use it myself in my app for debugging:
// i assume that your Ember.Application is stored in the global var App
var App = Ember.Application.create({
getController : function(name){
return this.__container__.lookup("controller:" + name);
}
});
// now you can use it like this. To get the users controller (App.UsersController) just use this in the console:
App.getController("users")

Is there a way to make WatiN click a link before the page finishes loading

We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?
Here's the code we found to work:
IE browser = new IE(....);
browser.Button("SlowPageLoadingButton").ClickNoWait();
Link continueLink = browser.Link(Find.ByText("linktext"));
continueLink.WaitUntilExists();
continueLink.Click();
You should be able to leave out the call to WaitUntilExists() since WatiN does this internally when you call a method or property on an element (like the link.Click() in you rexample).
HTH,
Jeroen van Menen
Lead dev WatiN