1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    23
    Answers
    2
    Vote Rating
    0
    Ary_Fortune is on a distinguished road

      0  

    Default Answered: How to reload the screen on custom action to reflect new added fields

    Answered: How to reload the screen on custom action to reflect new added fields


    Hello All,

    I have a screen and on some custom action, Few fields (Depending on the data in database) get generated. and the json string passed to the page gets updated.

    But after the custom action this updated json string does not populate the newly added fields on the page.
    The page does not re-render. I also have data entered on the page. While I do so I need the data to be intact.

    The custom tags in the jsp are updating the json data.

    Please help.

  2. Thanks All,

    I found out that the response that I got from the custom tag java code has to be formulated into the javaScript fields and these constructed fields have to be added to the container as below.

    vCFContainer.add(new Ext.form.Field(config));

    The config has the field information from the json response and it displays the fields.

  3. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    31
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      1  

    Default


    Quote Originally Posted by Ary_Fortune View Post
    Hello All,

    I have a screen and on some custom action, Few fields (Depending on the data in database) get generated. and the json string passed to the page gets updated.

    But after the custom action this updated json string does not populate the newly added fields on the page.
    The page does not re-render. I also have data entered on the page. While I do so I need the data to be intact.

    The custom tags in the jsp are updating the json data.

    Please help.
    Can you show some code?

    How is the "json string passed to the page" delivered? I'm assuming via an AJAX request, but you need to be specific. If via an AJAX request, it seems like you simply need to add some code in the success handler to regenerate the fields based on the json data that you update.

  4. #3
    Sencha User
    Join Date
    May 2013
    Posts
    23
    Answers
    2
    Vote Rating
    0
    Ary_Fortune is on a distinguished road

      0  

    Default


    We have our framework javascript files which process the fields and layouts.
    So I had earlier thought that adding new fields to the json , the framework will handle it.

    There are already few fields on the page, I am just adding new fields to the json.
    The existing fields reflect properly, so do I need to do anything else to the response to populate these.

  5. #4
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    31
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      2  

    Default


    Quote Originally Posted by Ary_Fortune View Post
    We have our framework javascript files which process the fields and layouts.
    So I had earlier thought that adding new fields to the json , the framework will handle it.

    There are already few fields on the page, I am just adding new fields to the json.
    The existing fields reflect properly, so do I need to do anything else to the response to populate these.
    It more than likely will handle it, but depending on the type of component/view you're using to display these fields, you will probably have to do something to trigger the update of the view.

    As before, can you show a snippet of code? Without that, or at least some more explanation of what kinds of fields and layouts you're dealing with (what do you mean by "layout", for example), it's difficult to tell you what you need to do.

  6. #5
    Sencha User
    Join Date
    May 2013
    Posts
    23
    Answers
    2
    Vote Rating
    0
    Ary_Fortune is on a distinguished road

      0  

    Default


    Actually I have done anything in the JavaScript, just the JSon string that was getting passed to the framework js is changed to have new fields in it
    For e.g.
    Below is the json string

    {
    "classPath": "bsxref_hdr",
    "layout":{ "abclistfield1" : {"container":"cont_7", "contType":1 },
    "updatedby" : {"container":"cont_10", "index":16, "contType":1}},
    "labels": {"updatedby": { label: "Updated By" }, "abclistfield1":{ label : "TextField" }},


    "pageData": {
    "values": {
    "updatedby": null,
    "abclistfield1": null
    },
    "attributes": {
    "updatedby": "protected",
    "abclistfield1": "optional"
    },


    focus: {"firstEnterableField": "updatedby"},


    "messages": null
    }

    Here if updatedby was already present on the page then on custom action when the response is sent, then the respsonse json string is modified to have abclistfield1 field in it too.

    Here abclistfield1 comes from data base and its data type can be any. But the page does not render the fields again here. It is difficult for me to post the entire javaSript code here.
    But Just want to know the will just adding fields to the json string populate them or Do we need to do something in the view handler or controller javaSript to reload the page or something Like it.

    I am kind of new to ExtJs.

  7. #6
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    31
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    Without knowing what your app actually does with that JSON string, it's difficult to say what you need to do. If that string is being used a configuration for how to build out particular components, then you will probably have to run the new string through whatever process is used when the page loads and generates the components.

    But again, without knowing how this is being used, it's tough to say more than that.

  8. #7
    Sencha User
    Join Date
    May 2013
    Posts
    23
    Answers
    2
    Vote Rating
    0
    Ary_Fortune is on a distinguished road

      0  

    Default


    Thanks All,

    I found out that the response that I got from the custom tag java code has to be formulated into the javaScript fields and these constructed fields have to be added to the container as below.

    vCFContainer.add(new Ext.form.Field(config));

    The config has the field information from the json response and it displays the fields.

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