java - JSF a4j:commandButton not working when 'disabled' is set -
When I include an 'disabled' attribute on the a4j: commandButton, the action of the button is not taken. Removing the 'inefficient' feature causes it to work properly. I'm not doing any special verification (which I know) and I do not see a verification error message.
Here's a part of my page:
& lt; T: DataTable id = "myTable" var = "region" value = "# {MyPageBackingBean.regions}" width = "100%" & gt; ... & lt; A4j: Command button value = "update" action = "# {region.doUpdate}" incomplete = "alert ('done');" Disabled = "# {empty area and area. Message alight}" instant = "true" /> ... & lt; / T: Datatable & gt;
Any ideas? Thanks!
Edit:
I tried to preserve Data Metal = "True" on T: Data not usable.
I did not have any test with an A4J: command button and text box with no data table, but the action of backing bean is still not being removed:
< Pre> & lt; H: form & gt; & Lt; A4j: area & gt; & Lt; A4j: OutputPanel ID = "TerrapRian" & gt; & Lt; H: message id = "message" /> & Lt; A4j: Status & gt; & Lt; F: Aspect Name = "Start" & gt; & Lt; H: graphic image value = "/ images / progress_indicator.gif" /> & Lt; / Ch: Aspect & gt; & Lt; / A4j: Status & gt; & Lt; H: InputTextesta rows = "5" value = "# {MyPaybackBackingBeanMalew}" style = "width: 100%; limit: 1px solid # 99ccff;" & Gt; & Lt; A4j: support event = "onkip" render = "tester" events quinn = "message editing qi" ignoredipspace = "true" request delay = "500" /> & Lt; / H: inputTextarea> & Lt; A4j: Command button object = "doDelete" value = "Delete" action = "# {MyPageBackingBean.dummy}" render = "terrestrihan" disabled = "# {MyPageBackingBean.myValue}" /> & Lt; H: output text value = "# {MyPageBackingBean.myValue}" /> & Lt; / A4j: outputPanel & gt; & Lt; / A4j: area & gt; & Lt; / H: form & gt;
The new backing bean code used for testing is:
private string m_myValue = null; Public string millwell val () {return m_myValue; } Public Zero Set Value (string value) {m_myValue = value; } Private string mystr2 = Faucet; Public string dummy () {mystr2 = "hello"; Return tap; }
Thanks!
In the HTML world, any HTML input element due to the disabled
attribute Adds name
- value
attribute ( input
, select
, textarea
and Button
) is not being sent to the server side
In the world of JSF, the name Attribute is used. However, JSF also checks that the component's
disabled
(and rendered
) attribtue true
attribute Evaluates before # {MyPageBackingBean.regions}
whose
# {region}
Here is a running table row object code> Better Default Returns by true
. Submit the # {MyPageBackingBean.regions}
to the new request of the form, which is apparently empty which makes the button disabled
. JSF will not then call related operations.
At this point, you need to make sure that # {MyPageBackingBean.regions}
comes back to the exact same data module in the subsequent request. In order to make the easiest to set, the MyPageBackingBean
bean is in the area of the session so that it can not be resumed in the subsequent request, but there may be more negative side effects along with it. The second fix is to reorganize the modell loading so that it is in Bean Constructor. As you already have from Tomahawk's & lt; T: dataTable & gt;
, you have to preserve the true
in the true
for more signals about the use of the datatables, Can also find useful.
Comments
Post a Comment