You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Kyle Schlosser (JIRA)" <ji...@apache.org> on 2010/11/02 22:25:07 UTC

[jira] Created: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

ActivePanel value in TabbedPanel always set to first panel
----------------------------------------------------------

                 Key: CLK-725
                 URL: https://issues.apache.org/jira/browse/CLK-725
             Project: Click
          Issue Type: Bug
          Components: extras
    Affects Versions: 2.2.0
            Reporter: Kyle Schlosser


I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 

The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 

    public Control insert(Control control, int index) {
           ....
            if (getPanels().size() == 1) {
                setActivePanel(panel);
            }

After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 

		Panel panel1 = new Panel1("Tab1");
		tabbedPanel.add(panel1);
		
		Panel panel2 = new Panel2("Tab2");
		tabbedPanel.add(panel2);

		tabbedPanel.setActivePanel(panel2);

I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

Posted by "Kyle Schlosser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLK-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928467#action_12928467 ] 

Kyle Schlosser commented on CLK-725:
------------------------------------

Hi Bob. Thanks for the explanation. I was able to get this working by saving the currently active tab in the session. 

> ActivePanel value in TabbedPanel always set to first panel
> ----------------------------------------------------------
>
>                 Key: CLK-725
>                 URL: https://issues.apache.org/jira/browse/CLK-725
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.2.0
>            Reporter: Kyle Schlosser
>
> I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 
> The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 
>     public Control insert(Control control, int index) {
>            ....
>             if (getPanels().size() == 1) {
>                 setActivePanel(panel);
>             }
> After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 
> 		Panel panel1 = new Panel1("Tab1");
> 		tabbedPanel.add(panel1);
> 		
> 		Panel panel2 = new Panel2("Tab2");
> 		tabbedPanel.add(panel2);
> 		tabbedPanel.setActivePanel(panel2);
> I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLK-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12927791#action_12927791 ] 

Bob Schellink edited comment on CLK-725 at 11/3/10 5:05 AM:
------------------------------------------------------------

Hi Kyle,

This is the expected behavior. Click uses stateless, loosely coupled architecture. Form doesn't know about TabbedPanel so won't generate Hidden Fields if it is added to a Panel.

TabbedPanel does however understand the request parameter "tabPanelIndex"[1], an integer, which indicates the active panel index.

. So you can add a HiddenField named "tabPanelIndex" to your Form.

Last night I've checked in some Stateful TabbedPanel helper methods that will save and restore the active Panel index in the session, which should be quite useful.

Regards

Bob

[1]: http://click.apache.org/docs/extras-api/org/apache/click/extras/panel/TabbedPanel.html#onInit%28%29

      was (Author: sabob):
    Hi Kyle,

This is the expected behavior. Click uses stateless, loosely coupled architecture. Form doesn't know about TabbedPanel so won't generate Hidden Fields if it is added to a Panel.

TabbedPanel does however understand the request parameter "tabPanelIndex"[1], an integer, which indicates the active panel index.

. So you can add a HiddenField named "tabPanelIndex" to your Form.

Last night I've checked in some Stateful TabbedPanel helper methods that will save and restore the active Panel index in the session, which.

Regards

Bob

[1]: http://click.apache.org/docs/extras-api/org/apache/click/extras/panel/TabbedPanel.html#onInit%28%29
  
> ActivePanel value in TabbedPanel always set to first panel
> ----------------------------------------------------------
>
>                 Key: CLK-725
>                 URL: https://issues.apache.org/jira/browse/CLK-725
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.2.0
>            Reporter: Kyle Schlosser
>
> I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 
> The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 
>     public Control insert(Control control, int index) {
>            ....
>             if (getPanels().size() == 1) {
>                 setActivePanel(panel);
>             }
> After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 
> 		Panel panel1 = new Panel1("Tab1");
> 		tabbedPanel.add(panel1);
> 		
> 		Panel panel2 = new Panel2("Tab2");
> 		tabbedPanel.add(panel2);
> 		tabbedPanel.setActivePanel(panel2);
> I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLK-725?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Schellink closed CLK-725.
-----------------------------

    Resolution: Not A Problem

Hi Kyle,

This is the expected behavior. Click uses stateless, loosely coupled architecture. Form doesn't know about TabbedPanel so won't generate Hidden Fields if it is added to a Panel.

TabbedPanel does however understand the request parameter "tabPanelIndex"[1], an integer, which indicates the active panel index.

. So you can add a HiddenField named "tabPanelIndex" to your Form.

Last night I've checked in some Stateful TabbedPanel helper methods that will save and restore the active Panel index in the session, which.

Regards

Bob

[1]: http://click.apache.org/docs/extras-api/org/apache/click/extras/panel/TabbedPanel.html#onInit%28%29

> ActivePanel value in TabbedPanel always set to first panel
> ----------------------------------------------------------
>
>                 Key: CLK-725
>                 URL: https://issues.apache.org/jira/browse/CLK-725
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.2.0
>            Reporter: Kyle Schlosser
>
> I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 
> The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 
>     public Control insert(Control control, int index) {
>            ....
>             if (getPanels().size() == 1) {
>                 setActivePanel(panel);
>             }
> After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 
> 		Panel panel1 = new Panel1("Tab1");
> 		tabbedPanel.add(panel1);
> 		
> 		Panel panel2 = new Panel2("Tab2");
> 		tabbedPanel.add(panel2);
> 		tabbedPanel.setActivePanel(panel2);
> I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLK-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928534#action_12928534 ] 

Bob Schellink commented on CLK-725:
-----------------------------------

Yeah that should work. Here is a link to the new example which doesn't use the session. 

https://fisheye6.atlassian.com/browse/click/trunk/click/examples/src/org/apache/click/examples/page/panel/TabbedPanelWithControls.java?r=HEAD

There are two "PLEASE NOTE" sections showing how the right tab can be activated for the incoming request.

> ActivePanel value in TabbedPanel always set to first panel
> ----------------------------------------------------------
>
>                 Key: CLK-725
>                 URL: https://issues.apache.org/jira/browse/CLK-725
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.2.0
>            Reporter: Kyle Schlosser
>
> I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 
> The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 
>     public Control insert(Control control, int index) {
>            ....
>             if (getPanels().size() == 1) {
>                 setActivePanel(panel);
>             }
> After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 
> 		Panel panel1 = new Panel1("Tab1");
> 		tabbedPanel.add(panel1);
> 		
> 		Panel panel2 = new Panel2("Tab2");
> 		tabbedPanel.add(panel2);
> 		tabbedPanel.setActivePanel(panel2);
> I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CLK-725) ActivePanel value in TabbedPanel always set to first panel

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLK-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12927820#action_12927820 ] 

Bob Schellink commented on CLK-725:
-----------------------------------

I've added two new TabbedPanel examples showing how to integrate a Form and Table in a stateless manner. The second example is the same but uses a Stateful TabbedPanel.

> ActivePanel value in TabbedPanel always set to first panel
> ----------------------------------------------------------
>
>                 Key: CLK-725
>                 URL: https://issues.apache.org/jira/browse/CLK-725
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.2.0
>            Reporter: Kyle Schlosser
>
> I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together. 
> The first tabbed panel works correctly -- clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active: 
>     public Control insert(Control control, int index) {
>            ....
>             if (getPanels().size() == 1) {
>                 setActivePanel(panel);
>             }
> After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked: 
> 		Panel panel1 = new Panel1("Tab1");
> 		tabbedPanel.add(panel1);
> 		
> 		Panel panel2 = new Panel2("Tab2");
> 		tabbedPanel.add(panel2);
> 		tabbedPanel.setActivePanel(panel2);
> I presume that the 2nd panel should be internally made active based upon which form was submitted? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.