Languages

Menu
Sites
Language
WebViewer doesn't include new window creation

I want to use a Web Component inside my native application. A webpage is loading but when the user taps a text the normal behaviour is to open a new window tab. The message  "WebViewer doesn't include new window creation" appears. How can i solve this issue ?

I have javascript enabled but this does not affect the new window creation.

Can native application with web viewer, open a new tab without opening the default Tizen browser? 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

17 Replies
muditha murthy
You can use IWebUiEventListener or IWebUiEventListenerF for new window creation. On "OnWebWindowCreateRequested()" callback, you can make a new Form or Panel which has Web control.
Mannu Malhotra

Hello,

but i am not able to get the external url from the __pWeb control (i.e. my existing web control). Is there any way to get the url on which user want to navigate.

Alex Ashirov

Hello,

It seems that you need to use Tizen::Web::Controls::HitElementResult for this purpose:

bool Tizen::Web::Controls::HitElementResult::HasUrl ()

Tizen::Web::Controls::HitElementResult::GetUrl()

Mannu Malhotra

I am really not able to understand how to add use hitElementResult class, there is no constructor provided.

Can you provide sample code?

Alex Ashirov

Hi,

Actually, I didn’t use this class and I don’t have code sample. But according to documentation:

After the Web page is loaded, you can retrieve information (such as tag name, attributes, character data, images, and URLs) about HTML elements that have been clicked on the loaded Web page using the Tizen::Web::Controls::HitElementResult class.”

It seems like what you are looking for. As far as I understand you can access objects of the class using:

Tizen::Web::Controls::Web::GetElementByPointN  ()

Mannu Malhotra

Yes I explored that, but GetElementByPointN requires Point coordinate object and I am not able to add the touch event to the web control to get that.

can you help with that?

Alex Ashirov

Hi,

It seems that Tizen::Web::Controls::ILoadingListener::OnLoadingRequested() is exactly what you are looking for.

Mannu Malhotra

unfortunatly OnLoadingRequested do not gets called in case of new tab creation :(

Still problem remains same. I really cant believe how come tizen didnt give support of new tab in webviewer control.

Alex Ashirov

Hi,

As mentioned above you can use On "OnWebWindowCreateRequested()" callback for this purpose.

Mannu Malhotra

OMG but i dont have that URL, in the event of OnWebWindowCreateRequested i need that url.

Mannu Malhotra

How to add touch event to webviewer?
 

seongjun yim

I think that you mistunderstand the usage of OnWebWindowCreateRequested()

You don't have to trace a url for new window.

If you return a new web control pointer as the return value of OnWebWindowCreateRequested(), webkit will load the url automatically.

You have to make the new web control pointer and call Construct() and then return it in OnWebWindowCreateRequested().

If you want to trace the url, please trace it OnLoadingRequested().

Thank you~

Mannu Malhotra

Hi thanks for showing interest.

1. OnLoadingRequested do not get called in the case of new web windows creation.

2. As told by you, I wrote this inside OnWebWindowsCreateRequest() -

Rectangle bound = __pMainForm->GetClientAreaBounds();
__pWebNew->Construct(Rectangle(0, 0, bound.width, bound.height));

return __pWebNew;

 

but nothing happened. Nothing

Can you tell me exact code?

Mannu Malhotra

Cool, i was suppose to add that control in my mainframe too, did that and now i am able to open those links, thanks a lot.

But on back button tap it is exiting the app, which is suppose to go back to the previous webview control.

What should i do now?

Is there any way to alter the pageNavigation list of the control ? If not then what is the soultion who can i handle it ?

Alex Ashirov

Hi,

You can try to change the navigation behavior using Tizen::Ui::Controls::IFormBackEventListener::OnFormBackRequested().

You can take a look at WebViewer sample to figure out how to use it.

Alex Ashirov

Hi,
You can use 
void Tizen::Ui::Control::AddTouchEventListener(ITouchEventListener & listener)    
the same way as for other controls

 

Alex Ashirov

Hello,

BTW, the "WebViewer doesn't include new window creation"message is shown from

Tizen::Web::Controls::Web* WebViewer::OnWebWindowCreateRequested(void)