What is the JSF behaviour, if you bind the same backing bean property to two input fields in the same form? -


Is a defined behavior in JSF, if two input fields are bound for the same session, then scanning the backing bean property has given.

Here is my code snippet

  & lt; H: form id = "myForm" & gt; & Lt; H: Input Text id = "field1" value = "# {The bankingBanHeproperty}" /> & Lt; H: Input Text id = "field2" value = "# {The bankingBanHeproperty}" /> & Lt; H: command button id = "release button" verb = "# {the backingban.odgroup}" /> & Lt; / H: form & gt;  

My question: If field 1 and field 2 get different values, then what will be the effect of Bean property? Is this also allowed?

I know that this is a raw scenario. My motivation is, we have HTMLunit tests running for our application. In our JSF application we want to use a cool ajaxified custom component. It works very well with the htmlunit, so my idea was, I just put in a hidden area which is connected to the same property unit test then fills the hidden field instead of the "real" thing.

I think such codes are allowed, but I'm not submissions After ensuring the value of theProperty , do I feel that JSF should do the following Interpretation:

  The Bakingbanksetthiporti (field Lkvlyue); TheBackingBean.setTheProperty (field2.value);  

However, as far as I know - nothing - specify the order of the setter call, thus, after the update value JSF step, you Will not ensure that theProperty field1.value or will be equal to field2. Value .

Regarding your scenario, you say that you want to attach the same property to the input text and a hidden text. Since the value in the hidden text will not accrue, this problem will not arise, unlike the input text. Actually, if you have such a JSF code:

   & Lt; H: InputHide ID = "Field2" value = "# {the bankingBanHeproperty}" />  

Then only JSF will be:

  The backingban .setthiporty (field1.value);  

during the submission phase.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -