Include ExtJS control into my div - extjs

I am trying to use this example to include this im my web-site. The matter is, if I try to copy it into my application, these controls fit all page. How can I include ExtJS controls into my div?

The ExtJS Portal demo uses an Ext.Viewport control to maximize the application to the entire browser window. To have the portal or parts inside another element or control, exchange the Viewport control with a Ext.Container or a Ext.Panel.

You should use renderTo propery to specify id of element, where control should be rendered.

Related

Display HTML in Boxlayout

I want to display HTML in my forms. The problem is I have to use a Boxlayout to place my components. So when I put a WebBrowser I'll have some height and scroll issues. I get the HTML I want to display from a webservice. The length of the content is variable. I just want to display a part of this response. Here is what I already have:
The webBrowser is below the edit button and ends near the LBL_LIB_NOM label.
As you can see the webBrowser is way too high and I can't scroll the Form when I click over the WebBrowser. In this example I would like to reduce the size of the WebBrowser so we can only see the Title. I also would like if possible to scroll my form when I click on the WebBrowser since I don't want the WebBrowser to scroll.
I have tried a few things to solve my issue:
I tried to override the calcPreferredSize method.
I revalidate my form and my webbrowser.
I resized it's container using the deprecated setPreferedSize method.
In that case the container is well sized but the the WebBrowser displays
above the other components.
The usual answer I have seen in other posts is to put the WebBrowser in a BorderLayout but I can't do that.
So here is my question: Is there any other component I can use to display one HTML line ? Or is there a way to make a webBrowser work properly in a boxLayout ? Do I have to write my own HTML renderer ?
I'm guessing you want box layout so you can scroll... This is problematic.
Web views generally expect to scroll themselves and this is common in native widgets which handle their own events and thus scrolling. It's hard for our code to know when your swipe is intended for us or to the underlying native widget and it's harder still to do this in a consistently portable way.
There are 3 options:
Use only Codename One code
Use a border layout or similar layout
Use the web browser for the entire UI of this form
If you want to take the first option this article might be useful as a starting point.

Adding more than one viewport in Extjs Application

Is it possible to add more than one viewport in an application. Since we can add other containers more than one time and viewport is also a container.
I think of the Viewport as representing all of the possible viewing space of the web browser window. It is a special Container that re-sizes as the web browser re-sizes. In a full screen ExtJS application, all the other containers should all be nested under the single Viewport so that they can re-size themselves relative to the browser window as well. For this reason there is no concept of multiple ExtJS Viewports.
If, instead of a full screen ExtJS application, you wish to have multiple ExtJS widget applications embedded in div tags of some static html page then Viewport should probably not be used. Container or Panel objects can be the top level parent.

Hide/Show a FormPanel in GWT

I'm building a web application with GWT/GAE, and i wanna show a Pop-up to allow user to upload images.
According to this tutorial, i need a FormPanel with a FileUpload widget to do the Job. I have extended the Panel and added the proper Widgets, but i don't know how to show the panel when -for example- a user clics a link.
FormPanel javadoc doesn't have a show or hide method, which i used when i worked with PopupPanel or DialogBox. How can i accomplish this in GWT?
PS: I'm not using UIBinder, only plain Java Code
How about adding the FormPanel as a child to a PopupPanel and DialogBox?
PopupPanel and DialogPanels are HTML absolute divs, attached to the document root, which is why they seem to float freely from the rest of your application. A FormPanel is just a widget and is a div elemen positioned relative to the parent it's attached.

How to make a navigation in Expression Blend 4?

So I created a layout in Expression Blend 4 for my Silverlight application. Now I need to create a simple navigation to navigate between pages. I have a canvas control in the layout (MainPage.xaml) and I would like the navigation buttons to just change the content of the canvas.
So if a user clicks on a navigation button for Page1.xaml, the Page1's content will be loaded into the canvas.
Could anybody give me an example how to do it? I tried using the MenuItem control but I could not understand how to use it. Now I have just used buttons but I don't know how to make a navigation from them.
I would love to be wrong about this but Im pretty sure, Blend 2,3,4 (the ones I have used)are just like windows form development your controls are not active until you actually build and run the application.
Sorry
Edit
To answer your comment the menuItem is a simple control that has been predefined like a button or link. The main idea with blend is to give developers and designers the ability to customize the look and feel of control layout in a similar way html uses CSS and javascript.
Try using "Hyperlink Buttons" for your menu and display the content in a "Frame" control.

How can I load a WPF (xaml) window inside of another WPF windows in a Panel?

Is this possible?
I used a Frame control and:
show(ex:showwindow.xaml)
But I get this error:
root element is not valid for navigation
sure you can navigate (show) a window by using:
YourFrame.Navigate(YourWindow);
However I don't like much this multi-window approach, better create some user controls for segmenting your application.
It is more common to use the Page class with the Frame control. Windows, in WPF are the top level items, with their own titlebar, chrome etc. Also, the Page can tap into the NavigationService provide by the framework.
more info about Navigation from Microsoft

Resources