I am loading a page with a tr:inputNumberSpinbox component, whose disabled
attribute is intially set to true.
With a tr:selectOneRadio I trigger the disabled flag and the value 1 will set
it to false.
This is done with PPR and autoSubmit in the tr:selectOneRadio.
This part of xhtml page on the server side looks like this:
<tr:form id="MainForm" usesUpload="true">
<tr:selectOneRadio id="selection" value="#{backingBean.selection}"
layout="horizontal" autoSubmit="true">
<f:selectItem id="item1" itemLabel="And" itemValue="0" />
<f:selectItem id="item2" itemLabel="Or" itemValue="1" />
</tr:selectOneRadio>
<tr:inputNumberSpinbox id="SpinThreshold"
disabled="#{backingBean.selection == 0}" partialTriggers="selection"
label="#{msgs.threshold}" minimum="1" maximum="10"
value="#{BackingBean.threshold}" />
<tr:commandButton id="uploadButton" text="#{msgs.startSearch}"
action="#{backingBean.action}" />
</tr:form>
1. When the value of backingBean.selection is 0 on first initialization, then
the spin box is disabled and on pressing the "Or" Radio Button the following
happens:
The tr:inputNumberSpinBox on the client is correctly set to enabled by removing
the disabled attribute from the HTML and the control can get the input focus.
But the value of the spin control is never send back to the server, i.e.
backingBean.threshold always stays 1, regardiccdless of the value one sets in
the UI.
2. When the value of backingBean.selection is 1 on first initialization, then
the spin box is enabled at first.
Now one can change the value of tr:inputNumberSpinBox and the value of
backingBean.selection changes accordingly.
When the "And" button is pressed the disabled flag is included for
tr:inputNumberSpinBox in the HTML code and the values are no longer passed to
backingBean.threshold.
On pressing the "Or" button the tr:inputNumberSpinBox is enabled again and
passes the values to backingBean.threshold.
That is only the 1st case is not working. I assume that this is a bug? Or am I
overlooking something here?