PDA

View Full Version : [CLOSED] Get URL from form to load in new window



OriCoder
Nov 26, 2014, 9:46 AM
Hi,

I'm following the load external website example (http://mvc.ext.net/#/Window_Basic/Load_External_Website/)

I have it working however want to be able to get the url to load from a textfield entry. Code so far is


Html.X().TextField().TabIndex(9)
.FieldLabel("Website")
.Name("Website")
.ID("Website")
.Width(245)
.Padding(5)
,
Html.X().Button()
.Text("Go")
.Icon(Icon.Application)
.Handler("App.WebsiteWindow.show(this);")
,

for the button and form field and


@(Html.X().Window()
.ID("WebsiteWindow")
.Title("Company Website")
.Width(1000)
.Height(500)
.X(200)
.Y(50)
.Modal(true)
.AutoRender(false)
.Collapsible(true)
.Maximizable(true)
.Hidden(true)
.Loader(Html.X().ComponentLoader()
.Url("App.Website.getValue()")
.Mode(LoadMode.Frame)
.LoadMask(lm => lm.ShowMask = true)
)
)

for the window, if there is an easier way to gain this functionality without the button I'd be happy to do it that way

thanks

Daniil
Nov 26, 2014, 1:10 PM
Hi @OriCoder,

Please:

1. Remove the Url of ComponentLoader
2. Set .AutoLoad(false) for the ComponentLoader
3. Set this for the Button:


.Handler("App.WebsiteWindow.show(); App.WebsiteWindow.load(App.Website.getValue());")

OriCoder
Nov 26, 2014, 2:14 PM
Works a treat, thanks!

You can now close off this thread.