Hi,

I'd like to be able to call a [DirectMethod] from the clients side, have it generate a window with a dynamic form on the server-side, then show the window on the client. right now, the window is showing, but there are no fields?!

Is this possible? Can you show me a quick example?

Client Code Call to method.:

<ext:XScript runat="server">
<script>
    var intervalId
    function OpenTaskModal(title, assignid, taskid, worklfowid, soeid, userid) {
        try {

            #{DirectMethods}.ShowTaskWindow(title, assignid, taskid, worklfowid, soeid, userid);
 
        }
        catch (e) {
            alert(e);
        }
    } 

</script> 
</ext:XScript>
Client Code Window to be populated then shown.:

<ext:Window runat="server" ID="winTask" Shadow="Drop" ShadowOffset="15" Modal="true" InitCenter="true" Hidden="true">
 <Content>
 <ext:FormPanel runat="server" ID="formPanelTask">
 <Content>
  <ext:FormLayout runat="server" ID="formLayoutTask">
 
 
 </ext:FormLayout>
 </Content> 
 </ext:FormPanel>
 

 
 </Content>
 <BottomBar>
 <ext:Toolbar runat="server" ID="taskToolbar">
 <Items>
<ext:ToolbarFill />
 <ext:Button runat="server" ID="btnComplete" Icon="Accept" Text="Complete Task"></ext:Button>
 
 </Items>
 </ext:Toolbar>
 
 </BottomBar>
</ext:Window>
Server code:

[DirectMethod]
public void ShowTaskWindow(string title, string assignid, string taskid, string worklfowid, string soeid, string userid)
{ 
    this.formLayoutTask.Anchors.Add(new TextField(new TextField.Config() { AllowBlank = true, Text = taskid }));
    this.formLayoutTask.Anchors.Add(new TextField(new TextField.Config() { AllowBlank = true, Text = soeid }));
    this.formLayoutTask.Anchors.Add(new TextField(new TextField.Config() { AllowBlank = true, Text = userid }));
    this.formLayoutTask.Anchors.Add(new  TextField(new TextField.Config() {AllowBlank=true, Text=title}));
    this.formLayoutTask.Anchors.Add(new Checkbox (new Checkbox.Config() {  Checked = true }));

    this.winTask.Hidden = false;
}
-Raphael