Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm new to Ext-JS and MapFish and I'm trying to accomplish a Mapfish Print 'SimpleForm' window loaded into an Ext-JS accordion. This is something that shouldn't be to hard (I think).

The problem I have is with the WFS Layer used to select the printing area. It only loads after I've collapsed and then expanded the accordionbox containing the Mapfish Print SimpleForm. From what I've read in the API I should be able to call the function 'createTheRectangle' to create this rectangle, so I tried it like this:

    layout:'accordion',
    title: 'Print',
    items:
    [
        {
            xtype: 'print-simple', map: map, layerTree: Ext.getCmp('tree'),
            wantResetButton: true,
            showFeatureButton: true,
            configUrl: GisArts.PrintServer,
            overrides: overrides,
            title: OpenLayers.i18n('gisarts.print.tab.title'),
            listeners: { 'afterrender': {
                    fn: function(){
                        this.createTheRectangle();
                    }
                }},

When the 'afterrender' listener fires the createTheRectangle function in ext-js it gives me the following Error:

this.el is undefined

Coming from the first line of this function (ext-all-debug-w-comments.js line 66710)

getValues : function(asString){
var fs = Ext.lib.Ajax.serializeForm(this.el.dom);

if(asString === true){
    return fs;
}

return Ext.urlDecode(fs);

I suspect the problem lies in the listener firing before the form has completely loaded. One of the functions called by createTheRectangle cannot get the needed options from the form and then raises the error.

Hopefully someone can help me get this SimpleForm to work. Thanks in advance for your help!

share|improve this question
I fixed this by using a workaround where I just collapse and open the accordionbox. This does the same as clicking on it and it makes the rectangle show up. I'm still not satisfied with this option but until someone has a suggestion this will do. – Kay Lucas Oct 8 '12 at 14:33

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.