1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    31
    Vote Rating
    0
    yopiyop is on a distinguished road

      0  

    Default FormPanel readOnly

    FormPanel readOnly


    Can you add setReadOnly(boolean readOnly) method on FormPanel (
    to set all form fields to read only) ?

    thx
    David

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    31
    Vote Rating
    0
    yopiyop is on a distinguished road

      0  

    Default bug in Tab Form Panel getFields()

    bug in Tab Form Panel getFields()


    in Tab Form Panel example : FormPanel.getFields throws Exception (version beta 5):

    Code:
    java.lang.ClassCastException: com.extjs.gxt.ui.client.widget.TabPanel cannot be cast to com.extjs.gxt.ui.client.widget.LayoutContainer
        at com.extjs.gxt.ui.client.widget.form.FormPanel.getChildFields(FormPanel.java:155)
        at com.extjs.gxt.ui.client.widget.form.FormPanel.getFields(FormPanel.java:53)
    in

    Code:
            FormPanel panel = new FormPanel();  
             panel.setFrame(false);  
             panel.setHeaderVisible(false);  
             panel.setBodyBorder(false);  
             panel.setButtonAlign(HorizontalAlignment.CENTER);  
             panel.setLayout(new FitLayout());  
           
             TabPanel tabs = new TabPanel();  
           
             TabItem personal = new TabItem();  
             personal.setText("Personal Details");  
             personal.setLayout(new FormLayout());  
           
             TextField<String> name = new TextField<String>();  
             name.setFieldLabel("First Name");  
             name.setValue("Darrell");  
             personal.add(name);  
           
             TextField<String> last = new TextField<String>();  
             last.setFieldLabel("Last Name");  
             last.setValue("Meyer");  
             personal.add(last);  
           
             TextField<String> company = new TextField<String>();  
             company.setFieldLabel("Company");  
             personal.add(company);  
           
             TextField<String> email = new TextField<String>();  
             email.setFieldLabel("Email");  
             personal.add(email);  
           
             tabs.add(personal);  
           
             TabItem numbers = new TabItem();  
             numbers.setText("Phone Numbers");  
             numbers.setLayout(new FormLayout());  
           
             TextField<String> home = new TextField<String>();  
             home.setFieldLabel("Home");  
             home.setValue("800-555-1212");  
             numbers.add(home);  
           
             TextField<String> business = new TextField<String>();  
             business.setFieldLabel("Business");  
             numbers.add(business);  
           
             TextField<String> mobile = new TextField<String>();  
             mobile.setFieldLabel("Mobile");  
             numbers.add(mobile);  
           
             TextField<String> fax = new TextField<String>();  
             fax.setFieldLabel("Fax");  
             numbers.add(fax);  
           
             tabs.add(numbers);  
           
             panel.add(tabs);  
             panel.addButton(new Button("Cancel"));  
             panel.addButton(new Button("Submit"));  
           
             panel.setSize(340, 180);  
            
             
            //---------------    
            for (Field field : panel.getFields()) {  
                field.setReadOnly(true);
            }  
            Viewport v = new Viewport(); 
            v.add(panel);
            RootPanel.get().add(v);

  3. #3
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    The problem is that you are adding a TabPanel to the FormPanel - you can only add widgets that extend Field to a FormPanel.

    What you want to do is add a formpanel to a contentpanel and add the tabpanel to the contentpanel... does that make sense?

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    31
    Vote Rating
    0
    yopiyop is on a distinguished road

      0  

    Default


    Quote Originally Posted by gslender View Post
    The problem is that you are adding a TabPanel to the FormPanel - you can only add widgets that extend Field to a FormPanel.

    What you want to do is add a formpanel to a contentpanel and add the tabpanel to the contentpanel... does that make sense?
    not really, look at source : http://extjs.com/explorer/#tabpanelform

  5. #5
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    Ahhh, TabForms are new - there is a bug in the code and you'll need to repost or move this to Bugs

  6. #6
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    The bug is fixed in SVN and I added setReadOnly to FormPanel.

  7. #7
    Ext User
    Join Date
    Aug 2008
    Posts
    2
    Vote Rating
    0
    mfettah is on a distinguished road

      0  

    Default formPanel.getForm().getValues() !!!

    formPanel.getForm().getValues() !!!


    Why i can t found the methode formPanel.getForm().getValues() in the class
    com.extjs.gxt.ui.client.widget.form.FormPanel
    RequestBuilder rb ;
    ....
    rb.sendRequest(formPanel.getForm().getValues(), new RequestCallback()
    {
    public void onResponseReceived(Request req, Response res)
    {
    etc...

  8. #8
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    you should really also post a new thread - don't jump on the back of another as it becomes confusing for future readers...

    regarding your problem, you'll need to provide more details as RequestBuilder is a GWT class that is commonly used with GWT FormPanel... the GXT version is not the same nor is it based on the GWT FormPanel - so you won't be able to get/do the same things