1. #1
    Ext User
    Join Date
    May 2010
    Vote Rating
    yoyoyo is on a distinguished road


    Exclamation Dynamically generate and populate a FormPanel

    Dynamically generate and populate a FormPanel

    Hi All,

    The question has already been asked a fair bit on the internet but I couldn't get my hands on a solution that actual works.

    What i'm trying to achieve is the following:

    1. retrieve a json array using ajax which contains the definition of the form to generate
    2. parse that array and add into a FormPanel all required TextField
    3. render the result into the interface

    At the moment I'm pretty much adding text fields to the FormPanel using the add() function (i.e. form.add(field)). The TextField becomes visible on the page but when I submit the form by clicking on the button, the content of that field does not get posted to my server.

    Any solution or workarounds?

    Thanks for your time.
    Last edited by yoyoyo; 20 May 2010 at 11:59 PM. Reason: typo in the title

  2. #2
    Ext User
    Join Date
    May 2010
    Vote Rating
    kevin-berry is on a distinguished road



    Hi, I'm currently working on the same thing - I haven't got it completely figured yet, as I'm still in the process of getting all the elements configured how I need them, but perhaps this thread will help you. If I figure it out, I'll try to remember to let you know how I did it.


  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Haan, Germany
    Vote Rating
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about



    i created a very easy example. The form is generated by a php file where i randomly create fields.
    PHP Code:
    $out = array();
    $fieldTypes = array('input','textarea','int','checkbox');
    if (
    $action) {
        if (
    $action === 'getForm') {
            for (
    $i 0$i 10$i++) {
    $out['data'][] = 
    'name' => 'field' . ($i+1),
    'label' => 'Field ' . ($i+1),
    'type' => $fieldTypes[rand(0,3)],
    'value' => 'V' rand(11119999)
    Online example with source:
    vg Steffen
    Release Manager of TYPO3 4.5

  4. #4
    Sencha User
    Join Date
    Dec 2007
    Vote Rating
    corvonero will become famous soon enough



    I'm actually *thinking* about something very similar for an ongoing project.

    Nothing I can add to your knowledge at this time, apart from the fact that in such case I would concentrate in client side checking rules.

    When you're in need of creating the form dinamically, there's also a very high chance that this form is going to be very complex and require complex validation rules, which would be nice to implement at client side as well.

    Also, to keep it even more complex, there might be a strong need to show some fields only if some other fields exists/has a certain value.


    if (comboBox.value == '3') {
    } else {

    If you're developing some kind of 'standard' I think you should not avoid such a features, or at least plan for them.


  5. #5
    Sencha User
    Join Date
    Sep 2010
    Vote Rating
    pratik016 is on a distinguished road



    Hello Friends,
    I think now anyone of you might got this answer...
    I am also stuck here for the same situation. Please give reply on my thread.
    Please please do some help. I am assuming that you solved your problem as this thread is very old

Similar Threads

  1. unable to dynamically generate a treepanel
    By pailyanish in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 30 Sep 2009, 1:03 AM
  2. Viewport generate items dynamically ?
    By Fabyo in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 18 Nov 2008, 8:57 AM
  3. Dynamically Generate Window
    By hanson72 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 22 Aug 2008, 9:57 AM
  4. Dynamically generate column panel via ajax request
    By Zakaroonikov in forum Community Discussion
    Replies: 0
    Last Post: 26 Mar 2008, 9:38 PM
  5. How to Generate Combo values dynamically based on previous selection
    By msuresh in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 14 Jan 2008, 9:33 AM

Thread Participants: 4

Tags for this Thread

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..."