1. #1
    Ext User
    Join Date
    Aug 2010
    Location
    Gurgaon, India
    Posts
    18
    Vote Rating
    0
    sunder is on a distinguished road

      0  

    Post extjs integration with struts1.2

    extjs integration with struts1.2


    Hi,

    I am new to extjs. I want to make a web application based on EXTJS application with struts1.2.
    My problem is that:-

    I have a page (html) which have some textfield and create this with FormPanel. (register.js)
    Textfields are firstname, lastname, city, state, country.
    I have action class (RegisterAction.java)
    I got all textfied value and perform some business logic inside action class after getting those values I want to display those values on the page.

    So please anybody tell me the possible way how I can display those values on the page.

    I tried it on my end with the help of JSON.
    I am writing some code of my point of view which I had tried, please anybody tell me how much this code is fine. If I am wrong please give me suggestions how I can display these values on page.
    I got all textfied value in action class and I add these values in Arraylist and that Arraylist I convert into json object.
    1.RegisterAction.java
    List list=new Arraylist ();
    list.add(firstname);
    list.add(lastname);
    list.add(email);
    list.add(state);
    list.add(city);
    list.add(country);

    JSONArray jsonArray = JSONArray.fromObject (list);
    String showJsonObject=jsonArray.toString ();

    PrintWriter pw=response.getWriter ();
    pw.write (showJsonObject);

    Now I want display that json object on other page (showData.js).
    I read EXTJS API through this I understood that we can do it through Ext.data.Store and Ext.data.JsonReader.

    I tried it on my code but I am unable to display json objects on the page.


    2.ShowData.js
    Ext.onReady(function()
    {
    var myReader = new Ext.data.JsonReader(
    {root: 'showjsonObject'}, ['firstname','lastname','email','city','state','country']
    );
    var dataFromServer = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({url:'/register.do'}),
    reader: myReader
    });
    dataFromServer.on('load', function() {
    var grid = new Ext.grid.GridPanel({
    store: dataFromServer,
    columns: [
    {header: 'FirstName', width: 90, sortable: true, dataIndex: 'firstname'},
    {header: 'LastName', width: 90, sortable: true, dataIndex: 'lastname'},
    {header: 'Email', width: 90, sortable: true, dataIndex: 'email'},
    {header: 'City', width: 90, sortable: false, dataIndex: 'city'},
    {header: 'State', width: 90, sortable: false, dataIndex: 'state'},
    {header: 'Country', width: 90, sortable: false, dataIndex: 'country'}
    ]
    });
    });
    dataFromServer.load();
    });
    Can anybody tell me what code should be written inside show.js?
    What code should be needed to display json object on the paget.

    Anybody please give me sample code and some guidance so that I can make application.

    Thanx in Advance….

  2. #2
    Sencha User
    Join Date
    Dec 2007
    Posts
    167
    Vote Rating
    0
    hello2008 is on a distinguished road

      0  

    Default


    I suppose you implement it step by step, does the register action return the correct json data, do you check it in http log?

  3. #3
    Ext User
    Join Date
    Aug 2010
    Location
    Gurgaon, India
    Posts
    18
    Vote Rating
    0
    sunder is on a distinguished road

      0  

    Default


    I want fatch outbound value which is inside another jsonobject. that is in example given below "outbound".
    {"totalCount":1,"price":[{"price":"119.07","adult":1,"outbound":[{"locidfrom":"LAX","dateofdept":"190910"}]}]}

    so anyone can tell me how can i get outbound value("locidfrom","dateofdept") in my js file by using jsonReader.
    How can i map this outbound object to show the result.

Similar Threads

  1. Extjs integration with struts
    By narayana4u in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 16 May 2012, 7:05 AM
  2. Drupal with ExtJS integration
    By apanag in forum Community Discussion
    Replies: 35
    Last Post: 25 Jan 2011, 11:04 AM
  3. extjs integration with struts1.2 and json
    By sunder in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 3 Sep 2010, 3:22 AM
  4. ExtJs and Struts 1.x integration
    By olakara in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 8 Jun 2009, 9:02 PM
  5. Extjs Integration problem
    By vinaybtech51 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 17 Feb 2009, 8:22 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi