PDA

View Full Version : [CLOSED] Ext.NET.SelfRedringPage



ashleysbuss
Aug 08, 2013, 5:39 PM
Hi Support,

I get and HTTP Exception in Ext.NET.SelfRedringPage when I basically try and run your Card Example in MVC any ideas?



@(Html.X().Panel().ID("Wizard").Layout(LayoutType.Card).Width(980).Height(500).B odyPadding(10).Border(true).ActiveIndex(0).Items(

Html.X().Panel().ID("Panel1").Border(false).Header(false).Html(@"<p>What is the purpose of your application?</p>
<ul>
<li><b>New</b> (Please note proof of valid citizenship required)</li>
<li><b>Renew</b></li>
<li><b>Change</b> (Add driving, title change etc.)</li>
<li><b>Company Change</b> (Company name change or department name change)</li>
<li><b>Name Change</b> (Supporting documents required)</li>
<li><b>Replacement</b> (Lost, stolen or destroyed)</li>
</ul>").Items(
Html.X().RadioFor(m=>m.boolPurposeNew).FieldLabel("New").Border(false).ID("purpose").UncheckedValue("false").Checked(true),
Html.X().RadioFor(m=>m.boolPurposeRenew).FieldLabel("Renew").Border(false).ID("purpose").UncheckedValue("false"),
Html.X().RadioFor(m=>m.boolPurposeChange).FieldLabel("Change").Border(false).ID("purpose").UncheckedValue("false"),
Html.X().RadioFor(m=>m.boolPurposeCompanyChange).FieldLabel("Company Change").Border(false).ID("purpose").UncheckedValue("false"),
Html.X().RadioFor(m=>m.boolPurposeChangeName).FieldLabel("Change Name").Border(false).ID("purpose").UncheckedValue("false"),
Html.X().RadioFor(m=>m.boolPurposeReplacement).FieldLabel("Replacement").Border(false).ID("purpose").UncheckedValue("false"))
.Buttons(
Html.X().Button().ID("btnPrev").Text("Pervious").Disabled(true).Icon(Icon.PreviousGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Prev_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{Wizard}.items.indexOf(#{Wizard}.layout.activeIte m)", ParameterMode.Raw));
}),

Html.X().Button().ID("btnNext").Text("Next").Icon(Icon.NextGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Next_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{Wizard}.items.indexOf(#{Wizard}.layout.activeIte m)", ParameterMode.Raw));
}))))

As normal I must have missed a comma?

Thanks,

Ashley

ashleysbuss
Aug 08, 2013, 10:02 PM
Hi Support,

I found why I was getting the error it was because I was using the .ID not .Name to tie the Radio boxes together. Once I swapped them around life is good. Now it displays but the .HTML is under the .Items so in the following code the .Html is meant to show you what to do and the radio buttons are the selection, but in the panel they are the other way around?


@(Html.X().Panel().ID("Wizard").BodyPadding(15).Height(600).Layout(LayoutType.Ca rd).ActiveIndex(0).Items(
Html.X().Panel().ID("Panel1").Border(false).Header(false)
.Html(@"<h2>What is the purpose of your application?</h2>
<ul>
<li><b>New</b> (Please note proof of valid citizenship required)</li>
<li><b>Renew</b></li>
<li><b>Change</b> (Add driving, title change etc.)</li>
<li><b>Company Change</b> (Company name change or department name change)</li>
<li><b>Name Change</b> (Supporting documents required)</li>
<li><b>Replacement</b> (Lost, stolen or destroyed)</li>
</ul>
<p>Please select a purpose below:</p>").Items(
Html.X().RadioFor(m=>m.boolPurposeNew).FieldLabel("New").Border(false).UncheckedValue("false").Checked(true).Name("purpose"),
Html.X().RadioFor(m=>m.boolPurposeRenew).FieldLabel("Renew").Border(false).UncheckedValue("false").Name("purpose"),
Html.X().RadioFor(m=>m.boolPurposeChange).FieldLabel("Change").Border(false).UncheckedValue("false").Name("purpose"),
Html.X().RadioFor(m=>m.boolPurposeCompanyChange).FieldLabel("Company Change").Border(false).UncheckedValue("false").Name("purpose"),
Html.X().RadioFor(m=>m.boolPurposeChangeName).FieldLabel("Change Name").Border(false).UncheckedValue("false").Name("purpose"),
Html.X().RadioFor(m=>m.boolPurposeReplacement).FieldLabel("Replacement").Border(false).UncheckedValue("false").Name("purpose")),

Html.X().Panel()
.ID("Panel2")
.Html("<h1>Card 2</h1><p>Step 2 of 3</p>")
.Border(false)
.Header(false),

Html.X().Panel()
.ID("Panel3")
.Html("<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>")
.Border(false)
.Header(false)
)
.Buttons(
Html.X().Button()
.ID("btnPrev")
.Text("Prev")
.Disabled(true)
.Icon(Icon.PreviousGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Prev_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{Wizard}.items.indexOf(#{Wizard}.layout.activeIte m)", ParameterMode.Raw));
}),

Html.X().Button()
.ID("btnNext")
.Text("Next")
.Icon(Icon.NextGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Next_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{Wizard}.items.indexOf(#{Wizard}.layout.activeIte m)", ParameterMode.Raw));
})
)
)

Baidaly
Aug 09, 2013, 1:08 AM
Hello!

You should add a container with your Html:


@(X.Panel()
.ID("WizardPanel")
.Title("Example Wizard")
.BodyPadding(15)
.Height(300)
.Layout(LayoutType.Card)
.ActiveIndex(0)
.Items(
X.Panel()
.ID("Panel1")
.Border(false)
.Header(false)
.Items(
X.Container()
.Html("<h1>Welcome to the Wizard!</h1><p>Step 1 of 3</p>"),
X.Radio().FieldLabel("New")
),

X.Panel()
.ID("Panel2")
.Html("<h1>Card 2</h1><p>Step 2 of 3</p>")
.Border(false)
.Header(false),

X.Panel()
.ID("Panel3")
.Html("<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>")
.Border(false)
.Header(false)
)
.Buttons(
X.Button()
.ID("btnPrev")
.Text("Prev")
.Disabled(true)
.Icon(Icon.PreviousGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Prev_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{WizardPanel}.items.indexOf(#{WizardPanel}.layout .activeItem)", ParameterMode.Raw));
}),

X.Button()
.ID("btnNext")
.Text("Next")
.Icon(Icon.NextGreen)
.DirectEvents(de => {
de.Click.Url = Url.Action("Next_Click");
de.Click.ExtraParams.Add(new Parameter("index", "#{WizardPanel}.items.indexOf(#{WizardPanel}.layout .activeItem)", ParameterMode.Raw));
})
)
)