Nov 08, 2013, 9:42 AM
[CLOSED] MVC - how to exclude form field at runtime
Hi guys,
I have a Window with inside a FormPanel; the panel contains two textfield; I was wondering how can I exclude at runtime the second textfield using a parameter contained in the model.
Seems simple but i Cannot find the correct sintax!
More generally the question would be: how can I insert code snippet ( @if(Model.parameter == 0) ... ) inside the Window definition?
Any suggestion is really appreciated!
Thanks
I have a Window with inside a FormPanel; the panel contains two textfield; I was wondering how can I exclude at runtime the second textfield using a parameter contained in the model.
Seems simple but i Cannot find the correct sintax!
More generally the question would be: how can I insert code snippet ( @if(Model.parameter == 0) ... ) inside the Window definition?
Any suggestion is really appreciated!
Thanks
Html.X().Window()
.ID("FormId")
.Title("FormTitle")
.Width(windowWidth)
.Height(580)
.Layout(LayoutType.Fit)
.Closable(false)
.Border(false)
.Hidden(true)
.Resizable(false)
.Modal(true)
.Items(
Html.X().FormPanel()
.Url(Url.Action("Submit","Firm"))
.ID("FormPanelId")
.MarginSpec("0 0 0 0")
.Layout(LayoutType.VBox)
.BodyPadding(5)
.Defaults(Html.X().Parameter().Name("margins").Value("0 5 0 0").Mode(ParameterMode.Value))
.LayoutConfig(new VBoxLayoutConfig { Align = VBoxAlign.Left })
.Items(
Html.X().TextField()
.FieldLabel("Name")
.ID("Id1")
.Width(componentWidth)
.LabelWidth(labelWidth)
.Margins("5 10 0 0")
.ReadOnly(true),
Html.X().TextField()
.FieldLabel("Surname")
.ID("Id2")
.Width(componentWidth)
.LabelWidth(labelWidth)
.Margins("5 10 0 0")
.ReadOnly(true)))
Last edited by Daniil; Nov 08, 2013 at 12:50 PM.
Reason: [CLOSED]