0

I'd like to add a new Window with working Listeners and DirectEvents from code-behind to realize an admin-interface on Button-Click. So far I have following Code (minimalized):

Window editwindow = new Window(){
   ID="Window_Edit",
   width = 380,
   height = 120,
   hidden = false
};
FormPanel editpanel = new FormPanel(){
   ID="Panel_Edit"
}; 
editpanel.Items.Add(new TextField(){
   ID="Edit_Fieldname",
   FieldLabel = "Some Label",
   LabelStyle="text-align:right;",
   Width = 260,
   LabelWidth=120
});
editwindow.Add(editpanel);
this.Page.Controls.Add(editwindow);
//Viewport.Add(editwindow); Viewport is a wrapping <ext:Container>
//editwindow.DoLayout(); this has been throwing a reference error on client-side

I'd like to know how I can make the window be displayed. Right now if I inspect the execution with firebug a status code 200: OK is returned on the Post Request. But I do a Store operation some lines before that, and the response does not Contain these Store Changes!

The funny thing now is, that changing the triggering Button's Text works without fault, so I am sure a full reload is not executed.

1 Answer 1

1

I'm making a few assumptions with my response because you have not posted a sample demonstrating the whole scenario, but I think revising to the following should work:

// Old
// editwindow.Add(editpanel);
// this.Page.Controls.Add(editwindow);

// New
editwindow.Items.Add(editpanel);
editwindow.Render(this.Form);

The following sample also demonstrates the scenario of dynamically creating a Window during a DirectEvent and adding the , see

http://examples.ext.net/#/XRender/Basic/New_Window/

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.