So far I've done some tests (e.g RPC)
Next I come to the Part Multiple Paging, in what I've read so far there are so many options for this:
MVP, Layout, UIbind.
Now I really don't know which I should choose, which is easy and good.
I tried clearing my Rootpanel and placing another Widget(composite):
RootPanel.get().clear();
Place:
LoginComp login = new LoginComp();
rootPanel.add(login, 127, 125);
I don't know if this is the most professional approach. What is the best way to include my widgets as composites?
First of all, GWT is a single page application. After you have requested the application, you'll only go to the server to recieve data.
I would use a struts or SpringMVC application for the logon and request the GWT application after a successfull login. Your GWT application should have a shell. This shell has an area where you can change your views. Changing a view is initiated via a place controller.
Take a look at the mobileWebApp example contained in the GWT SDK examples.
Also, you will find a good documentation here:
MVP and Places Documentation
In my oppinion, the best way is when you add a element in your main HTML file which acts like a content wrapper e.g.
<div id="content"></div>
Each of your page can be represented as extended Panel, simultaneously as a singleton. The page that should be display will be set into that wrapper:
RootPanel.get("content").set(pagePanelX);
Related
I am developing an application to test whether a HTML page is responsive or not. Right now, I am assuming that using media queries is the only way to make a HTML page responsive.
But I am using a very crude logic to test it. I am parsing the HTML file and reading it for the presence of a media query statement. If its present I am declaring it as responsive, otherwise non-responsive.
Is there any other way I can go about it?
Is there any other test I can perform before declaring it as responsive or non-responsive?
Check if they are using hard coded px instead of % or em. Maybe see if text is too small or links to close together.
At the end of the day it wont be a great resource for responsive checking since there are so many factors
According to Ethan Marcotte's seminal article that introduced Responsive Web Design (http://alistapart.com/article/responsive-web-design), a responsive page will use media queries, flexible grid layouts and responsive text.
But, even if a page has these elements, it doesn't mean that it is using them correctly. A responsive page is not one that simply uses media queries.
I'm not sure that the ability to programmatically determine if a page is built responsively is even a viable goal. You can check for ingredients, but that won't tell you if the right recipe was followed.
Also, why have you tagged this question with Java?
I am working on a project for a client where they are going to upgrade to Siebel Open UI. With that upgrade, they also want to start implementing Selenium. The problem we are currently facing, or going to face once implementing, is that with each build the ID's/Names of HTML elements in Siebel change. Because we are talking about a lot of views and applets it's not a good solution to change the code manually each time.
What is a good solution for this problem? One solution that was offered is a correlation table where we keep track of changes in the ID's.
Xpath in this case is also not a good option because of the complicated structure of the views and applets.
I would suggest that you look into CSS Selectors. They are faster and less brittle than XPath. For ID/names that are dynamic, typically there is at least some portion of the ID that is static.
For instance,
<a id="somestatictext_12345">...
where "12345" is some dynamically generated number. In this case you can use a CSS selector like
driver.findElement(By.cssSelector("[id^='somestatictext']"));
Examples
"[id^='somestatictext']" - ID begins with "somestatictext"
"[id$='somestatictext']" - ID ends with "somestatictext"
"[id*='somestatictext']" - ID contains "somestatictext"
For more info, take a look at this CSS Selector reference.
I am using wicket DropDownChoice and my list is very long, is there a way that when i click the drop down list and then click on a character the list will jump to the first select that start with the same character
I know this is not the exact solution to your problem, but it will solve your functional issue. If you have very long select list, I would recommend loading it progressively with a search field via Ajax.
wicket-select2 is such a (wonderful) wicket component, integrating the select2 library into wicket to provide Ajax filtering, custom rendering, etc. Although the current integration doesn't offer a way to simply add the select2 behaviour to a static non ajax DropDownChoice, it's relatively easy to do by using wicket-select2's classes as a base. For the wicket-select2 integration all you'll need is to use Select2Choice (or Select2MultiChoice for multiple selects) to which you pass a simple TextChoiceProvider
After you start using such a component, you don't really want to go back to plain old selects, in particular if you have long lists of choices.
Note : using 1.5.8 (and previously 1.4.x), the old selects in my application display the behaviour you are looking for, e.g. standard html behaviour. However from what I understood you don't use a <select> tag in your markup for your DropDownChoice: what are you using then (it's likely this is the cause of your issue).
I need to add an odontogram to my webpage.
It looks like this:
I would like to know if there is already some kind of open source odontogram.
I am using spring-mvc so it has to be in java
If it's web based I'd think you'd just want to return an SVG from a servlet.
If it must be interactive, I'd do this as an Applet or JWS application, with each tooth represented by an instance extending JComponent and containing five Polygons. The latter would make filling and hit testing relatively easy. A simple data model containing surface (proximal, distal, lingual, labial, occlusal) and color-code would also be useful. See also ImageTooth.
Addendum: You may want to plan on consulting a subject matter expert regarding the clinical correlation of the numbers, colors and locations.
I have a small application in java which searches images using bing image search. The problem I am facing is that, its getting only first 20 images. May be because when we search on bing.com it populates first 20 images first and then its an infinite scrolling feature.
Is there any way to search more than 20 images using bing?
Cheers :)
I'm guessing this is because this site uses ajax to populate the "infinite" scrolling list as you call it.
You probably send an http request and get the initial page (btw on my browser I got 6 images accross x 4 down, i.e. 24 not 20; thinking about it maybe my client also got 20 only at first and got the last 4 w/ ajax...), and you'd need to do the paging trough by way of ajax requests.
At a glance, the xhtml and associated javascript of the page is very dense and somewhat obfuscated, It would take a while to get oriented... An alternative to analyzing this page is to instead use a packet sniffer (such as wireshark) and to capture the requests which take place when you scroll down.
Essentially this will likely expose some form of ajax request, which you can then easily emulate with java. Typically the ajax response is easy to parse whatever its nature (xml, jason, gzip...).
A possible snags to this well laid out plan is if the returned data in the ajax response is encrypted, for example where the extra images are bundled in some sort of envelope for which you'll then need to discover the format.
Depending on the actual task at hand, you may try alternatives such as automations within GreaseMonkey (on Firefox) or similar tools.
What of Bing API ?
Note that all the above approaches are akin to screen-scraping and hence quite sensitive to even minute changes in the Bing application, and, depending on effective usage and context, this could put the project in a legal grey area... A better approach may be to register and obtain a proper application ID with MS/Bing and to use the Bing API.
You are simulating a browser? Doesn't the Bing engine have an entry point for programs instead - a web service or so - which would make your task much easier.
EDIT: SDK appears to be here: http://msdn.microsoft.com/en-us/library/cc980922.aspx
Just wanted to post a direct answer to the question:
Bing uses Ajax (of course) for the infinite scroll. Each "tick" is based on a simple ajax get request, which accuires new images.
For instance, this url returns 30 results (121-151) in a "htmlraw" format based on the query "max payne".
http://www.bing.com/images/async?q=max+payne&format=htmlraw&first=121
Edit:
It works with the original url too, just add &first=NUMBER to the querystring. Example:
www.bing.com/images/search?q=payne&go=&form=QBLH&scope=images&filt=all&first=10
I am building my own bulk image collector (for a "learning project" for myself) and I found out that it is paginated like this.
FYI, Google and Bing are easy, Yahoo and Altavista (redundant, since their results are from Yahoo) are far more problematic - they don't post the directlink to the original image.
Have fun! :)
This can be done by using count parameter. For example, I tried GET "https://api.cognitive.microsoft.com/bing/v7.0/images/search?q=shoes&mkt=en-us&count=30" call and it returns 30 images.