How to set webview area upon loading a link? - java

Ok so I have an rss reader that links to articles. One of the sites it links to doesn't have a mobile view. I was wondering if anyone knew if it was possible to set the "zoom" and position of the view once the page is loaded? So for instance if the following link were my article... http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7
Then how could I have the view focus on the article without the user having to zoom in and scroll the the top of the article. Thanks.

I think, you have to use an anchor, which are based on the ids of the HTML code. Then, you have to pass the Id you want to stick to after the url and a #.
With your example, it would give something like that :
http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7#c1256209263986
As the div you are looking for has an id (lucky you cause they don't have all the time)
<div id="c1256209263986" class="iw_component"><div xmlns:esi="http://www.edge-delivery.org
Hope this will help you (Try to click on the link I put, this should open the page at the start of the article.)
I never tried that but have a go a this, and come back to tell me if it worked.

Related

Anchor not working in IE7 via redirect (spring-mvc, jsp)

So for this project I am doing I have a page which generates content via clickable buttons. The button posts the form to my controller and the controller acts on the button that has been clicked. To show what was changed a redirect will occur (form in the session) with an anchor included. A little piece of javascript will then go to anchor which is in the link (eg. website/add/picture#123). This works fine in pretty much every browser except Internet Explorer 7.. I found out this has to do with an input field of file type.. Because if I remove the input field, then even IE7 will nicely scroll to the anchor..
Does anyone have any idea why this behaviour occurs?
If it's unclear please tell me and I'll provide more details..
Thanks a lot,
Davey
So.. I didn't manage to solve the input type=file bug.. I suppose it's just an IE7 bug. I made a work around to put the input field on a popup. A lot of overhead but it is working pretty well now

WebView Android application - how to read website content

Basically I am designing an webview app which would work something like this...
Pic Link : http://tinypic.com/r/2z9060n/6
I have made a webview browser application as shown in the pic. Now I want to define a mechanism using which I can crawl the webcontent and get content say marked in Red in the pic. Based on this content I wanna call another API which will show a message at the green box down.
Any help in the regard would be much appreciated.
Thanks
You can use a HTML parser such as Jsoup to parse the HTML page for the title / price of the item. Based on what the title and price are you can display a message using an overlay.
On a side note, the site is flipkart.com. You could also ask them if they have an API that they'd like to expose to you.

Java Android: Make a word (from a paragraph) into a button

I searched for some answers, but came up empty, maybe I'm not wording my question correctly.
Basically I want a hyper link, except it has a java on click listener attached to it, instead of an html link. I have some paragraphs of text and certain words are highlighted, I want the user to be able to click those words and it executes a function.
Any thoughts or website tutorials? Thanks.
You should use the Linkify class to achieve what you want. Here is a full tutorial that will help you

Context sensitive help in GWT application

I need to provide context sensitive help in my GWT application. For this every GWT view will have many help links each of which will open a dialog box with appropriate help text (different for each link). The problem is I cannot have so many ui:field elements each with unique name and click listener in my view classes as the number of help links may be very large. What I need is to have many Anchor elements in my UI binder xml file and all the anchors should have the same click listener. The click listener will decide based on some parameter which help text to display in the dialog box.
I tried to use Hyperlink element with different history tokens for all links, but it changes the history which is not desirable. I just want to show a dialog box with appropriate help message without modifying history.
Is it possible in GWT?
Thanks for your help.
You can obviously use <g:Anchor href="javascript:;"> in your UiBinder and later add handler in your code.
But, since you have a lot of this all around your app I'd use gwtQuery:
$(".help-link").click(new Function(){
public void f(Element element) {
// do something here
// `element` tells you which element triggered the event
});
then I'd just add css class .help-link to all relevant anchors.

How to add Links in liferay

I am using Liferay 6.0.4 and I have a page which is available to all users including guests. The page is called "Information". The page has already been created.
Right now its an empty page.
I want to add these four links to that page on the left hand side:
1. Calender
2. Forums
3. Blogs
4. Docs
I have created that page with 30:70 layout so that I can place one Web Content showing these four url's on the left side and corresponding link content on the right side. The default content to show is the content of the link Calender.
I am not able to figure out how to achieve it as I am really new to Liferay. Please guide to me to the proper direction and if possible write some steps to follow...
If I understand correctly, you want a menu on the left hand side that updates the right hand side.
For this, you should use the Navigation Portlet on the left hand side, and create 4 child pages "Calendar", "Forums", "Blogs" and "Docs". On each of these pages, just drop the appropriate portlet and you're set.

Categories