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

      0  

    Default BasicDialog with one TabPanelItem a try to submit form

    BasicDialog with one TabPanelItem a try to submit form


    Hi Jack, great work...
    I'm new to the yui and yui-ext extension.
    and I have a questions ...
    In BasicDialog with one TabPanelItem a try to submit a simple form..
    The server response a simple text, with this text i want to replace the TabPanelItem

    Thanks

    ....
    my code:

    String.prototype.htmlDecode = function(){
    • var ret;
      var sReplace = /\+/gi;

      ret= unescape(this);
      ret = ret.replace(sReplace, " ");
      return(ret);
    }


    var fncSubmitFrm = function() {
    • var fncSuccess = function(o){
      [list:3610349b2e]var data = o.responseText.htmlDecode();

      // UPDATE dialog-tabItemPanel
      // it works! but it is the way to do this?
      var tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
      getEl(tabEls[0].id).update(data,true);
      var Tab = dialog.getTabs().getTab(tabEls[0].id);

      // get new content
      tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
      // why tabEls[1] ?????
      Tab.setText(tabEls[1].title);
      tabEls[1].title='';


    };

    var fncFailure = function(o){
    • alert(o.responseText);
    };

    YAHOO.util.Connect.setForm(document.getElementById('form1'));
    var frmAction = document.getElementById('form1').action;
    YAHOO.util.Connect.asyncRequest('POST',frmAction,{success: fncSuccess , failure: fncFailure });[/list:u:3610349b2e]
    };


    dialog = new YAHOO.ext.BasicDialog('ID',
    {
    • modal:true,
      autoTabs:true,
      width:280,
      height:180,
      shadow:true,
      minWidth:300,
      minHeight:200,
      closable:true
    }
    );

    dialog.addButton('Submit', fncSubmitFrm );

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Don't use DOM calls. Use the methods of TabPanel (getTab) to get the TabPanelItem you want. Get its UpdateManager, and call formUpdate on that.

    http://www.yui-ext.com/deploy/yui-ext/docs/

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    6
    Vote Rating
    0
    JuanParraC is on a distinguished road

      0  

    Default


    Thanks Animal,
    but the server responds with Response.Write (Server.URLEncode (shtml))
    for that reason I had to implement the function
    String.prototype.htmlDecode = function(){
    • var ret;
      var sReplace = /\+/gi;
      ret= unescape(this);
      ret = ret.replace(sReplace, " ");
      return(ret);
    }
    How to use formUpdate in this case?

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You mean that the server sends back non-standard HTML, or some kind of response that needs "massaging" to produce valid HTML?

    Then add a custom renderer to the TabPanelItem's UpdateManager: http://www.yui-ext.com/deploy/yui-ex...ml#setRenderer

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    6
    Vote Rating
    0
    JuanParraC is on a distinguished road

      0  

    Default


    yes, I try to do this. now i have to another problem, with this way the form values are not passed

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    http://www.yui-ext.com/deploy/yui-ex...tml#formUpdate

    It POSTS the form with all form inputs sent.

    You can add your own extra params in the url parameter - which can be a function which returns a URL, so you can code this to know all about your object and set up appropriatye params.

Similar Threads

  1. BasicDialog in JSF: Submit a Form without Ajax, revisited
    By tromanow in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 26 Jul 2007, 5:45 AM
  2. ID of submit within form masks submit function
    By aconran in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 19 Feb 2007, 12:08 AM
  3. Basic Dialog Form plus submit example?
    By rob30UK in forum Ext 1.x: Help & Discussion
    Replies: 26
    Last Post: 13 Jan 2007, 9:11 AM
  4. BasicDialog: how to submit a form without AJAX.
    By moraes in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 5 Jan 2007, 7:02 AM
  5. Basic Dialog and form submit
    By JC in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 21 Nov 2006, 12:44 AM

Thread Participants: 1