Thread: ExtJS Tab Issue

This question is not answered. Helpful answers available: 5. Correct answers available: 1.


Permlink Replies: 7 - Pages: 1 - Last Post: Jul 15, 2009 10:59 PM Last Post By: user6044915
Maerio

Posts: 1
Registered: 04/24/09
ExtJS Tab Issue
Posted: Apr 24, 2009 7:01 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

i develop an Apex application, on which i want to implement an ExtJs Tab panel with 4 Tabs.
I followed the tutorial from http://oracleinsights.blogspot.com/2008/06/tabbed-regions-in-oracle-apex-using.html.
I thought it works fine, but now i have trouble after submit the page. The Apex items won't be saved correctly.

Debug Code without ExtJs Tab (works):
0.03: Session State: Save  form items and p_arg_values
0.03: ...Session State:  Save "P3510_ID" - saving same value: "3"
0.03: ...Session State:  Save "P3510_ROW_FETCHED" - saving same value:  "1"
0.03: ...Session State:  Save "P3510_ADDRESSID" - saving same value:  "146"
0.03: ...Session State:  Save "P3510_ORIGINID" - saving same value: "7"
0.03: ...Session State:  Save "P3510_TYPEID" - saving same value: "1"
Debug Sample with ExtJs Tab: (error)
0.03: Session State: Save  form items and p_arg_values
0.03: ...Session State:  Saved Item "P3510_ACTIVETAB" New Value="3"
0.03: ...Session State:  Saved Item "P3510_ID" New Value="1"
0.03: ...Session State:  Saved Item "P3510_ROW_FETCHED" New Value="146"
0.03: ...Session State:  Saved Item "P3510_ADDRESSID" New Value="7"
0.03: ...Session State:  Saved Item "P3510_ORIGINID" New Value="1"
The item values are in the right order, but the apex items not.

My Page looks like ..

Page Html Header:
<script language="JavaScript" type="text/javascript">
Ext.onReady(function(){
       var tabs = new Ext.TabPanel({
           cls: 'prism',
           applyTo: 'TabPanel',
           plain: true,
           width: 1000,
           height: 600,
           //autoHeight:true,
           enableTabScroll:true,
           autoScroll:true,
           activeTab: 0,
           deferredRender: false,
           border: true,
           defaults: {layout:'fit', autoScroll:true},
           items:[
               {contentEl:'tab1', title:'test1'},
               {contentEl:'tab2', title:'test2'},
               {contentEl:'tab3', title:'test3'},
               {contentEl:'tab4', title:'test4'}
           ]
           });
    });
});
</script>
Region Template for each region with static ID:
<div id="#REGION_STATIC_ID#" class="tab-content">
<div class="x-fieldset-bwrap" style="padding:10px">
<div align="right" class="x-fieldset-tbar">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
<div class="x-fieldset-body">
#BODY#
</div>
</div>
</div>
I hope someone can help me.

Thx
Mario
Mark Lancaster

Posts: 66
Registered: 05/21/97
Re: ExtJS Tab Issue
Posted: Apr 29, 2009 5:28 AM   in response to: Maerio in response to: Maerio
 
Click to report abuse...   Click to reply to this thread Reply
Hi Maerio

I put that code up quite some time ago, so in some respects it is a little dated.

ExtJS can move DOM elements around when it is rendering, resulting in some of the form items being moved outside of the form.
To prevent this from happening use allowDomMove:false as shown in the code example below.

Also, if your using viewports, you can create a customised viewport to render into the form rather than the body element.
I'll post a solution on my blog shortly.

    Ext.onReady(function(){
 
        var s1 = '<iframe style="overflow:auto;width:100%;height:100%;" frameborder="0" ';
        var s2 = '></iframe>';
 
        var tabs = new Ext.TabPanel({
            cls: 'prism',
            applyTo: 'pageTabs',
            plain: true,
            width: 795,
            height: 450,
            //autoHeight:true,
            enableTabScroll:true,
            autoScroll:true,
            activeTab: 0,
            deferredRender: false,
            allowDomMove:false,
            border: true,
            defaults: {layout:'fit', autoScroll:true},
            items:[
                {contentEl:'tab1', title:'Daily Issues'},
                {contentEl:'tab2', title:'Daily Events'},
                {contentEl:'tab3', title:'Daily Weather Conditions'},
                {title:'Subcontractors',html: s1 + 'src="f?p=101:123:&SESSION.::NO::"' + s2},
                {title:'Staff',html: s1 + 'src="f?p=101:219:&SESSION.::NO::"' + s2},
                {title:'Plant & Equip',html: s1 + 'src="f?p=101:124:&SESSION.::NO::"' + s2},
                {title:'Materials',html: s1 + 'src="f?p=101:125:&SESSION.::NO::"' + s2}
            ]
            });
    });


Regards

Mark
Random Insights into Oracle | Marks Playpen
user6044915

Posts: 37
Registered: 11/17/08
Re: ExtJS Tab Issue
Posted: Jul 8, 2009 1:13 AM   in response to: Mark Lancaster in response to: Mark Lancaster
 
Click to report abuse...   Click to reply to this thread Reply
Hello Mark,

I use an Ext.Panel in an Ext.Window in APEX to show an APEX-region. The panel should be used as SearchQuery-Form.
But when I enter any search-keys in the text fields which are displayed in the ext.panel, the session of this text fields don't be saved after submitting the page.

At first I thought the reason is that the DOM-Tree is moved outside the APEX <form>-Tag when I open the panel. I added the parameter "allowDomMove:false" at the panel definition. But this parameter has no effect.

How can I save the state of these text fields on page submit?

Regards,
Michael
user6044915

Posts: 37
Registered: 11/17/08
Re: ExtJS Tab Issue
Posted: Jul 14, 2009 3:32 AM   in response to: user6044915 in response to: user6044915
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

has nobody an idea how I can use such a panel in APEX saving the session state on submit.

Greetings Michael
Mark Lancaster

Posts: 66
Registered: 05/21/97
Re: ExtJS Tab Issue
Posted: Jul 14, 2009 3:46 AM   in response to: user6044915 in response to: user6044915
 
Click to report abuse...   Click to reply to this thread Reply
Hi Michael

I would suggest you put an example up on apex.oracle.com so we can look at what your doing.

If you follow my template and also look at my customized viewport you should have no problems.

Regards

Mark
user6044915

Posts: 37
Registered: 11/17/08
Re: ExtJS Tab Issue
Posted: Jul 14, 2009 4:58 AM   in response to: Mark Lancaster in response to: Mark Lancaster
 
Click to report abuse...   Click to reply to this thread Reply
Hello Mark,

I have uploaded a sample application where you can see my problem. The name of the applicaton is "EXTJS - 36085".

http://apex.oracle.com/pls/otn
Workspace OBELIX007
Username: demo
Password: demo

When you click on the Button "Open Window", then an extJs modal window is opened. It displays an extjs panel with region "ExtJs_Region" as content.
The entered value of the Input-Field in the modal winow is not saved after clicking the submit-button.

I already use the option allowDomMove:false in the panel-declaration.

Greetings
Michael
Mark Lancaster

Posts: 66
Registered: 05/21/97
Re: ExtJS Tab Issue
Posted: Jul 15, 2009 4:16 AM   in response to: user6044915 in response to: user6044915
 
Click to report abuse...   Click to reply to this thread Reply
Hi Michael

I've fixed your example, and changed the references to Extjs to use cachefly

The issue was you were not applying the window to an existing dom element, so Extjs was creating a new div at the end of your html body outside the form.

This is very easy to see the Firefox Web Developer addon and view the generated source.

Regards

Mark
user6044915

Posts: 37
Registered: 11/17/08
Re: ExtJS Tab Issue
Posted: Jul 15, 2009 10:59 PM   in response to: Mark Lancaster in response to: Mark Lancaster
 
Click to report abuse...   Click to reply to this thread Reply
Hello Mark,

thank you very much.
I would never have found a solution without your help.

In Firebug I saw that the Dom-Element of the panel was moved outside the form-tag but I
didn't know that ExtJs do this because no dom-element was applied to the extjs-window.

Greetings
Michael
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums