Results 1 to 2 of 2

Thread: Passing Params from a Host Page to Ext JS

  1. #1
    Ext User
    Join Date
    Apr 2010
    Vote Rating

    Default Passing Params from a Host Page to Ext JS

    Can someone please suggest an elegant way of passing parameters from a host page to an Ext JS file? My problem is: I am attempting to integrate some cool Ext JS components to an existing app writing primarily using Java Server Faces (JSF, MyFaces impl). I have written a fairly simple JS code to open a window, but since this window needs to be rendered inside of a MyFaces table component (iterating over a Collection), I need a way of obtaining the row index of the row on which the user clicked.

    Perhaps another way of asking this question is: are there other ways I can attach Ext JS user interface to a host page? So far I've only been using a DIV element, and can't think of an easy way to pass a parameter using that.

    Here is my Ext JS code:
    Ext.onReady(function() { var formPanel = new Ext.FormPanel( { items: [ { checked: true, fieldLabel: 'Yes', boxLabel: 'Yes', xtype: 'radio', name: 'radioField', inputValue: 'Y' }, { fieldLabel: 'No', boxLabel: 'No', xtype: 'radio', name: 'radioField', inputValue: 'N' } ], buttons: [ { text: 'Submit', handler: function() { formPanel.getForm().load( { url: 'myTestServlet?param=' + document.getElementById('myForm:rowIdx').getValue(), waitMsg: 'Loading' }); } }, { text: 'Cancel', handler: function() { w.hide(); } } ] });
    var w = new Ext.Window( { title: 'Demo', collapsible: true, maximizable: true, width: 370, height: 490, minWidth: 185, minHeight: 245, layout: 'fit', items: formPanel });
    var subjectId = 1;
    var b = new Ext.Button( { text: '+', handler: function() { alert(subjectId);; }, renderTo: 'div-element' });

    and here is an excerpt from my host html page:

    <t:dataTable id="table"
     styleClass="recordSetTable" headerClass="resultSetTableHeader"
     renderedIfEmpty="false" var="row" preserveDataModel="false"
     preserveSort="true" disabled="#{!bean.editable}">
      <!-- Render columns... -->
      <div id="div-element" />

  2. #2
    Sencha User's Avatar
    Join Date
    Mar 2007
    DC Area =)
    Vote Rating


    maybe set and read the URL parameters?

Similar Threads

  1. Error in passing params in Ext.Ajax.request
    By ritesh.kapse in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 19 Feb 2009, 8:25 AM
  2. Ext.get and passing params
    By m0rd0 in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 10 Jul 2008, 7:57 AM
  3. [HELP] Passing extra params to
    By Phunky in forum Ext 2.x: Help & Discussion
    Replies: 13
    Last Post: 7 Feb 2008, 9:13 AM
  4. passing params to DWRPRoxy
    By s.kerroumi in forum Community Discussion
    Replies: 1
    Last Post: 4 Jan 2008, 6:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts