You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christian Kölle <ko...@gmx.de> on 2008/04/21 21:03:58 UTC
panelTabbedPane > submit on serverside tab-switching
Hello everyone,
I have a form containing a tomahawk panelTabbedPane which contains 4 tabbed
panels. All tabbed panels contain a lot of input-fields.
The problem is, as someone mentioned before 2 years ago, that the data
entered in the form on TAB_A will be lost, when I switch to TAB_B, provided
that server-side-tab-switching is activated. What I would like to have is a
feature which writes the data entered into JSF-bound-bean-properties before
the actual tabswitching is done (in other words, I need a submit before
tab-switching).
Please note that I would really like to use server-side tabb-switching, as
the tabs contain lots of data and the bandwidth is very limited.
Please also note, that I do not like to add a onvalueChange-JScript to all
input fields. (Somehow autoscroll does not work (to be investigated).)
Any ideas: What about a phase listener, which does this work manually?
Regards and thanks in advance.
Christian Kölle
Re: panelTabbedPane > submit on serverside tab-switching
Posted by Christian Koelle <ko...@gmx.de>.
Hello,
the bug is already tracked. See:
https://issues.apache.org/jira/browse/TOMAHAWK-717
I have extended the description.
Regards
Christian
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
Re: panelTabbedPane > submit on serverside tab-switching
Posted by Christian Koelle <ko...@gmx.de>.
> What kind of scope does your bean have?
Currently I am using the session scope, but I would like to use request scope in combination with <t:saveState> to save the dialgue state in the future. I use preserveDataModel=false everywhere on the tomahawk tables.
Nevertheless: I think that's not the problem. The behaviour I describe can be reproduced with demo application, if I add a Test Bean like
private class TestBean implements Serializable{
private String _s1;
private String _s2;
// + getter and setter
}
and add a list of TestBeans to the TabbedPaneBean of the Tomahawk example like
List<TestBean>
and insert a data table to the demo like:
<t:panelTab id="tab1" label="#{example_messages['tabbed_tab1']}" rendered="#{tabbedPaneBean.tab1Visible}">
<t:dataTable
headerClass="myTableHeader"
rowClasses="myTableRow1,myTableRow2"
var="r"
preserveDataModel="false"
preserveRowStates="false"
preserveSort="false"
value="#{tabbedPaneBean.testBeans}">
<h:column>
<f:facet name="header">
<h:outputText
value="--Header 1 --" />
</f:facet>
<t:inputText
id="inputField002"
value="#{r.s1}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText
value="--Header 2 --" />
</f:facet>
<t:inputText
id="inputField001"
value="#{r.s2}" />
</h:column>
</t:dataTable>
then input made in the input table will not be written into the backing beans, unless you hit the demo's "Common submit button" before you switch the tabs. Or in other words, if you switch the tabs directly, the entered information will be lost.
I am going to check whether a bug for this issue is already open. I am will ing to open a bug report, unless you oppose.
Regards,
Christian
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
Re: panelTabbedPane > submit on serverside tab-switching
Posted by Gerald Müllan <gm...@apache.org>.
Hi,
> Now I can say the entered
> values are not written into the bound properties, if the input fields is
> nested inside a <t:dataTable>. I am not sure where to go on now. Any ideas?
What kind of scope does your bean have?
You can use the attribute preserveDataModel="true" on your dataTable
(does only exist on tomahawks dataTable).
This would be something like pageScope only for the list. Maybe this
would solve it.
This is a nice introduction to preserveDataModel:
http://wiki.apache.org/myfaces/Working_With_DataTable_And_PreserveDataModel
cheers,
Gerald
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
AW: panelTabbedPane > submit on serverside tab-switching
Posted by Christian Kölle <ko...@gmx.de>.
Hi Gerald,
thanks for your quick response and your hint. I have just investigated the
differences between my application and the demo. Now I can say the entered
values are not written into the bound properties, if the input fields is
nested inside a <t:dataTable>. I am not sure where to go on now. Any ideas?
Regards
Christian Kölle
Re: panelTabbedPane > submit on serverside tab-switching
Posted by Gerald Müllan <gm...@apache.org>.
Hi,
well, i remember the discussions about tabbedPane and its retained (or
not) state a little bit.
But if you have a look at the actual example of it
http://www.irian.at/myfacesexamples/tabbedPane.jsf
The server-side tab switching works with remembering the submitted values.
cheers,
Gerald
On Mon, Apr 21, 2008 at 9:03 PM, Christian Kölle <ko...@gmx.de> wrote:
> Hello everyone,
>
> I have a form containing a tomahawk panelTabbedPane which contains 4 tabbed
> panels. All tabbed panels contain a lot of input-fields.
>
> The problem is, as someone mentioned before 2 years ago, that the data
> entered in the form on TAB_A will be lost, when I switch to TAB_B, provided
> that server-side-tab-switching is activated. What I would like to have is a
> feature which writes the data entered into JSF-bound-bean-properties before
> the actual tabswitching is done (in other words, I need a submit before
> tab-switching).
>
> Please note that I would really like to use server-side tabb-switching, as
> the tabs contain lots of data and the bandwidth is very limited.
>
> Please also note, that I do not like to add a onvalueChange-JScript to all
> input fields. (Somehow autoscroll does not work (to be investigated).)
>
> Any ideas: What about a phase listener, which does this work manually?
>
> Regards and thanks in advance.
> Christian Kölle
>
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
AW: panelTabbedPane > submit on serverside tab-switching
Posted by Christian Kölle <ko...@gmx.de>.
Sorry, I forgot to mention this:
I also would really like to use server-side tab switching, because the
various tabs show different views on the same data, i.e. if I enter a
address on TAB_C and then switch to TAB_A the value entered should be shown
in a different way. So the TABS represent different views on the same model.
Regards
Christian
Christian Kölle wrote:
| Hello everyone,
|
| I have a form containing a tomahawk panelTabbedPane which contains 4
| tabbed panels. All tabbed panels contain a lot of input-fields.
|
| The problem is, as someone mentioned before 2 years ago, that the
| data entered in the form on TAB_A will be lost, when I switch to
| TAB_B, provided that server-side-tab-switching is activated. What I
| would like to have is a feature which writes the data entered into
| JSF-bound-bean-properties before the actual tabswitching is done (in
| other words, I need a submit before tab-switching).
|
| Please note that I would really like to use server-side
| tabb-switching, as the tabs contain lots of data and the bandwidth is
| very limited.
|
| Please also note, that I do not like to add a onvalueChange-JScript
| to all input fields. (Somehow autoscroll does not work (to be
| investigated).)
|
| Any ideas: What about a phase listener, which does this work manually?
|
| Regards and thanks in advance.
| Christian Kölle