Hi,
I'm facing some problems updation to 4.2.0 from 4.1.0
I've got an inputText with a customActionListener, when user leaves the field I perform a bb.bjsf.sync(this,'custom') to validate the field on server.
If user enters any value it works and the backing bean property is updated, this is the log:
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - param name/value: event / custom
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - custom action event
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - value event on tipExpRamo_L:p_cod_ramo
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - param name/value: value / 300
2008-05-09 11:56:34,250 DEBUG bjsf.context.BackbaseFacesContext - BackbaseFacesContext created
2008-05-09 11:56:34,328 ERROR bjsf.component.UIBackbaseLoadBundle - Resource bundle 'messages' could not be found.
2008-05-09 11:56:34,343 DEBUG bjsf.component.UIBackbaseComponentBase - client->server, attribute 'value' for tipExpRamo_L:p_cod_ramo changed in '300'
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - custom action event
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - value event on tipExpRamo_L:p_cod_ramo
2008-05-09 11:56:34,250 DEBUG bjsf.event.ClientEvent - param name/value: value / 300
2008-05-09 11:56:34,250 DEBUG bjsf.context.BackbaseFacesContext - BackbaseFacesContext created
2008-05-09 11:56:34,328 ERROR bjsf.component.UIBackbaseLoadBundle - Resource bundle 'messages' could not be found.
2008-05-09 11:56:34,343 DEBUG bjsf.component.UIBackbaseComponentBase - client->server, attribute 'value' for tipExpRamo_L:p_cod_ramo changed in '300'
where user has entered the value "300" for field "p_cod_ramo"
But now, if user enters a blank value, the backing bean prop is not updated and still keeping "300"
This is the log:
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - param name/value: event / custom
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - custom action event
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - value event on tipExpRamo_L:p_cod_ramo
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - param name/value: value /
2008-05-09 11:57:26,250 DEBUG bjsf.context.BackbaseFacesContext - BackbaseFacesContext created
2008-05-09 11:57:26,265 ERROR bjsf.component.UIBackbaseLoadBundle - Resource bundle 'messages' could not be found.
2008-05-09 11:57:26,281 DEBUG bjsf.component.UIBackbaseComponentBase - client->server, attribute 'value' for tipExpRamo_L:p_cod_ramo changed in ''
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - custom action event
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - value event on tipExpRamo_L:p_cod_ramo
2008-05-09 11:57:26,250 DEBUG bjsf.event.ClientEvent - param name/value: value /
2008-05-09 11:57:26,250 DEBUG bjsf.context.BackbaseFacesContext - BackbaseFacesContext created
2008-05-09 11:57:26,265 ERROR bjsf.component.UIBackbaseLoadBundle - Resource bundle 'messages' could not be found.
2008-05-09 11:57:26,281 DEBUG bjsf.component.UIBackbaseComponentBase - client->server, attribute 'value' for tipExpRamo_L:p_cod_ramo changed in ''
The same code is working properly on Backbase 4.1.0.
Please, check this issue as soon as possible and tell me if it's a problem of the new version (that will be fixed soon) or not. In this case we have to get back to the previous version of BB.
Thanks
David

You can test it easily with
12 May, 2008 - 17:06 — DavidYou can test it easily with this simple snippet:
<bjsf:outputLabel value="#{myBean.testValue}"></bjsf:outputLabel>
<bjsf:commandButton actionListener="#{myBean.testIt}">Dale</bjsf:commandButton>
If you change the inputText with a not-null value, the outputText is updated as well.
If you change the inputText with a null value, the oupputText is not updated and keeps the last value.
This changes hasan important in our application and we have to fix it as soon as possible.
Regards
David
Workaround
14 May, 2008 - 15:32 — SenakaHi David,
It appears that the value change event dose not trigger on a inputText component if the value is null. I will submit the issue into our issue tracking system to get fixed.
For now you can implement this simple workaround using a customActionListner on the . The write() method checks the entered value in the inputText component. If the returned value is null the bound String is then updated with a null value manually.
Hope this helps,
Index.jsp
<f:verbatim>
<e:handler event="blur" type="application/javascript">
var inputComp = bb.document.getElementById('input001');
var inputCompVal = inputComp.viewNode.value;
bb.bjsf.sync(this, 'custom', 'param2', inputCompVal);
</e:handler>
</f:verbatim>
</bjsf:inputText>
<bjsf:outputLabel value="#{myBean.testValue}" /><br/>
<bjsf:commandButton actionListener="#{myBean.testIt}" value="Submit" />
myBean.java
* ***********************************
*
* Generated by backbase plugin
*
* ***********************************
*/
package com.yourcompany;
import javax.faces.event.ActionEvent;
import com.backbase.bjsf.event.CustomActionEvent;
/**
*
* @author $author$
* @version 1.0
*/
public class MyBean {
private String testValue;
private String newTestValue;
public MyBean() {
super();
}
public void testIt(ActionEvent event) {
}
public void write(CustomActionEvent event) {
newTestValue = (String) event.getAtts().get("param2");
if (newTestValue == "") {
System.out.println("null");
testValue = "";
} else {
}
}
public String getTestValue() {
return testValue;
}
public void setTestValue(String testValue) {
this.testValue = testValue;
}
}
inputText component with null value
2 July, 2008 - 17:06 — lucavargettoHi,
Are there any news concerning this issue? Is this bug fixed in 4.2.1 Client Edition?
Regards
Luca
Too many InputTexts
7 July, 2008 - 09:12 — lucavargettoI have several houndred of InputTexts, it's technically impossible to apply your workaround.
Regards,
Luca
inputText
7 July, 2008 - 10:47 — andysHi lucavargetto,
The inputText problem has not been fixed in Backbase JSF version 4.2.0
It is aimed to be fixed in the next release.
Andys
Here you are a possible quick solution
7 July, 2008 - 14:53 — lucavargettoSince our project cannot wait for your next release, we have analyzed the source code provided with BackBase JSF version 4.2.0 and we hope to have found a quick solution to the issue.
In our opinion the problem could be in the validate(FacesContext context) method of com.backbase.bjsf.component.UIBackbaseInput Class:
...
Object convertedValue = (submittedValue != null) ? getConvertedValue(context, submittedValue) : getValue();
...
}
In fact, after having changed the line
with the following:
our forms now work properly.
Hope that this solution does not lead to other drawbacks...
Regards
Luca.
validate method
8 July, 2008 - 07:43 — DavidFirst of all, thank you Luca.
I think you're right, this must the problem but I don't know how you have modified the method validate.
Have you create a new UIInputText component and overwrite this method? I've tried so but I got some compiling errors caused by parent's methods and variables visibility.
And other question for Backbase guys, have you planned (more or less) the new release?
There are more bugs that i'd like to be fixed, I posted them here:
http://bdn.backbase.com/node/5041
Please, if you have some info let us know, it's very important for us.
Thanks again
David
Hi David, I have modified
8 July, 2008 - 09:29 — lucavargettoHi David,
I have modified the source code of the com.backbase.bjsf.component.UIBackbaseInput class (see jsf_4_2_0_components.zip file). The original source code has a wrong import: it's also necessary to change the java import for MessageUtils class, the correct one is "org.apache.myfaces.shared_impl.util.MessageUtils".
Put the compiled class into the backbase-jsf-4.2.0 jar file. It could be very helpful if you could give us some feedback! If you have problems I can send you our modified jar.
Here you can find the modified source code:
* ***********************************
* COPYRIGHT BACKBASE BV.
*
* All righs reserved, no warranties.
*
* $Id: UIBackbaseInput.java,v 1.2 2007/07/19 09:47:41 kees Exp $
* ***********************************
*/
package com.backbase.bjsf.component;
import java.util.ArrayList;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import javax.faces.event.FacesEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.event.ValueChangeListener;
import javax.faces.render.Renderer;
import javax.faces.validator.Validator;
import org.apache.myfaces.shared_impl.util.MessageUtils;
import com.backbase.bjsf.util.ComponentUtils;
import com.backbase.bjsf.util.RendererUtils;
/**
*
* Base class for Backbase input components.
*
*/
public class UIBackbaseInput extends UIBackbaseOutput implements EditableValueHolder {
// private static final Log log = LogFactory.getLog(UIBackbaseInput.class);
public static final String CONVERSION_MESSAGE_ID = "javax.faces.component.UIInput.CONVERSION";
public static final String REQUIRED_MESSAGE_ID = "javax.faces.component.UIInput.REQUIRED";
private static final Validator[] EMPTY_VALIDATOR_ARRAY = new Validator[0];
private Object _submittedValue = null;
private boolean _localValueSet = false;
private boolean _valid = true;
private boolean _submitted;
private MethodBinding _validator = null;
private MethodBinding _valueChangeListener = null;
private List _validatorList = null;
/**
* Getter for the submitted value property. The submitted value contains
* the value of the input control as supplied by the client before conversion
* and validation.
* @return submitted value
*/
public Object getSubmittedValue() {
return _submittedValue;
}
/**
* Setter for the submitted value property. The submitted value contains
* the value of the input control as supplied by the client before conversion
* and validation.
* @param submittedValue submitted value
*/
public void setSubmittedValue(Object submittedValue) {
_submittedValue = submittedValue;
_submitted = true;
}
/**
* Setter for the value property that contains the value supplied by the client after conversion
* and validation.
* @param value value
*/
public void setValue(Object value) {
// when you call this method in the invoke application phase from a backing bean
// you get side-effects when setting localvalueset to true. Because this boolean
// is preserved over requests the next request it will assign the 'value'
// to the bounded property (apply model phase) which should not happen
if (getValueBinding("value") == null) {
setLocalValueSet(true);
}
// normally _submittedValue will be set to null during validation phase
// but if you have skipped validation or you set the value by the backing bean
// this will not happen
_submittedValue = null;
super.setValue(value);
}
/**
* Getter for the property to indicate that the value is converted and validated but the model
* is not yet updated.
* @return flag to indicate we have a valid value
*/
public boolean isLocalValueSet() {
return _localValueSet;
}
/**
* Setter for the property to indicate that the value is converted and validated but the model
* is not yet updated.
* @param localValueSet flag to indicate we have a valid value
*/
public void setLocalValueSet(boolean localValueSet) {
_localValueSet = localValueSet;
}
private UIBackbaseForm findForm() {
UIComponent parent = this.getParent();
while (parent != null && !(parent instanceof UIBackbaseForm)) {
parent = parent.getParent();
}
if (parent instanceof UIBackbaseForm) {
return (UIBackbaseForm) parent;
}
return null;
}
/**
* Getter for the property to indicate that the component is succesfully validated.
* @return true if component is valid
*/
public boolean isValid() {
return _valid;
}
/**
* Setter for the property to indicate that the component is succesfully validated.
* @param valid set to true if component is valid
*/
public void setValid(boolean valid) {
_valid = valid;
if (!valid) {
UIBackbaseForm form = findForm();
if (form != null) {
form.setValid(false);
}
}
}
/**
* Getter for the validator property which corresponds with the validator tag attribute.
* It points to a custom method that implements validation logic and raises a ValidatorException
* if the value is invalid.
* @return validator property
*/
public MethodBinding getValidator() {
return _validator;
}
/**
* Setter for the validator property which corresponds with the validator tag attribute.
* It points to a custom method that implements validation logic and raises a ValidatorException
* if the value is invalid.
* @param validator method binding
*/
public void setValidator(MethodBinding validator) {
_validator = validator;
}
/**
* Getter for the valueChangeListener property which corresponds with the valueChangeListener tag attribute.
* It points to a custom method that receives the ValueChangeEvent as input parameter.
* @return value change listener method binding
*/
public MethodBinding getValueChangeListener() {
return _valueChangeListener;
}
/**
* Setter for the valueChangeListener property which corresponds with the valueChangeListener tag attribute.
* It points to a custom method that receives the ValueChangeEvent as input parameter.
* @param valueChangeListener value change listener method binding
*/
public void setValueChangeListener(MethodBinding valueChangeListener) {
_valueChangeListener = valueChangeListener;
}
/**
* Decodes the client request for this component and its children (Apply Request Values phase).
* Also processes validation if the component is immediate.
*
* @param context faces context
*
*/
public void processDecodes(FacesContext context) {
super.processDecodes(context);
if (!isRendered()) {
return;
}
if (isImmediate()) {
try {
validate(context);
} catch (RuntimeException e) {
context.renderResponse();
throw e;
}
if (!isValid()) {
context.renderResponse();
}
}
}
/**
* Decodes the client request for this component and its children (Apply Request Values phase).
* Does not process validation if the components is immediate.
*
* @param context faces context
*
*/
public void processDecodesWithoutValidation(FacesContext context) {
if (!isRendered()) {
return;
}
super.processDecodes(context);
}
/**
* Validates the data of the value property for this component and its children (Process Validation phase).
*
* @param context faces context
*
*/
public void processValidators(FacesContext context) {
if (!isRendered()) {
return;
}
super.processValidators(context);
if (!isImmediate()) {
try {
validate(context);
} catch (RuntimeException e) {
context.renderResponse();
throw e;
}
if (!isValid()) {
context.renderResponse();
}
}
}
/**
* Updates the model (Update Model Values phase).
*
* @param context faces context
*
*/
public void processUpdates(FacesContext context) {
super.processUpdates(context);
updateModelValueField(context);
}
/**
* Decodes the client request only for this component (Apply Request Values phase).
* Does not process validation if the components is immediate.
*
* @param context faces context
*
*/
public void decode(FacesContext context) {
// We (re)set to valid, so that component automatically gets (re)validated
setValid(true);
super.decode(context);
}
protected MethodBinding getListenerBinding( FacesEvent event) {
if (event instanceof ValueChangeEvent) {
return getValueChangeListener();
}
return super.getListenerBinding(event);
}
protected void updateModelValueField(FacesContext context) {
if (!isValid()) {
context.renderResponse();
return;
}
if (!isLocalValueSet()) {
return;
}
ValueBinding vb = getValueBinding("value");
if (vb == null) {
return;
}
try {
vb.setValue(context, getLocalValue());
// we have a new value that should be the starting point for dirty mngmt
setLastValue(getLocalValue());
setValue(null);
setLocalValueSet(false);
} catch (RuntimeException e) {
// Object[] args = {getId()};
context.getExternalContext().log(e.getMessage(), e);
MessageUtils.addMessage( FacesMessage.SEVERITY_ERROR, CONVERSION_MESSAGE_ID,
new Object[] { getId() }, this.getClientId(FacesContext.getCurrentInstance()));
setValid(false);
context.renderResponse();
}
}
protected void validateValue(FacesContext context, Object convertedValue) {
boolean empty = convertedValue == null
|| (convertedValue instanceof String && ((String) convertedValue)
.length() == 0);
if (isRequired() && empty) {
MessageUtils.addMessage( FacesMessage.SEVERITY_ERROR, REQUIRED_MESSAGE_ID,
new Object[] { getId() }, this.getClientId(FacesContext.getCurrentInstance()));
setValid(false);
return;
}
if (!empty) {
ComponentUtils.callValidators(context, this, convertedValue);
}
}
private boolean isEmpty(Object val) {
if (val == null) {
return true;
}
if (val instanceof String) {
String s = (String)val;
if (s.trim().length()==0) {
return true;
}
}
return false;
}
/**
* Validates the data of the value property only for this component (Process Validation phase).
*
* @param context faces context
*
*/
public void validate(FacesContext context) {
if (context == null) {
throw new NullPointerException("context");
}
Object submittedValue = getSubmittedValue();
if (submittedValue == null) {
// if the user has supplied null we should not validate, to make the field empty we use empty string
if (_submitted) {
return;
}
// we still want error messages on required fields the first time (no value yet or value cleaned in the previous request)
if (!isRequired()
|| (!isEmpty(getValue())
&& !((Boolean) getAttributes().get("revalidate")).booleanValue())) {
return;
}
} else if (isEmpty(submittedValue)) {
submittedValue = null; // needed for the validation methods
}
Object convertedValue = getConvertedValue(context, submittedValue);
if (!isValid())
return;
validateValue(context, convertedValue);
if (!isValid())
return;
Object previousValue = getValue();
setValue(convertedValue);
// we have a new value that should be the starting point for dirty mngmt
setLastValue(convertedValue);
setLocalValueSet(true);
setSubmittedValue(null);
if (compareValues(previousValue, convertedValue)) {
queueEvent( getValueChangeEvent( context, previousValue, convertedValue));
}
}
protected ValueChangeEvent getValueChangeEvent(FacesContext context, Object previousValue, Object newValue) {
// find the first client event
//pass in the attributes of the client (future: custom value change handlers)
return new ValueChangeEvent(this, previousValue, newValue);
}
protected Object getConvertedValue(FacesContext context, Object submittedValue) {
try {
Renderer renderer = getRenderer(context);
if (renderer != null) {
return renderer.getConvertedValue(context, this, submittedValue);
} else if (submittedValue instanceof String) {
Converter converter = RendererUtils.findUIOutputConverter( this);
if (converter != null) {
return converter.getAsObject(context, this, (String) submittedValue);
}
}
} catch (ConverterException e) {
FacesMessage facesMessage = e.getFacesMessage();
if (facesMessage != null) {
context.addMessage(getClientId(context), facesMessage);
} else {
MessageUtils.addMessage( FacesMessage.SEVERITY_ERROR, CONVERSION_MESSAGE_ID,
new Object[] { getId() }, this.getClientId(FacesContext.getCurrentInstance()));
}
setValid(false);
}
return submittedValue;
}
protected boolean compareValues(Object previous, Object value) {
return !((previous == null && value == null) || (previous != null
&& value != null && previous.equals(value)));
}
/**
* Add a child validator which corresponds to the <f:validator> tag.
* @param validator Validator object
*/
public void addValidator(Validator validator) {
if (validator == null)
throw new NullPointerException("validator");
if (_validatorList == null) {
_validatorList = new ArrayList();
}
_validatorList.add(validator);
}
/**
* Get the list of a child validators which corresponds to the <f:validator> tags.
* @return array of Validator objects
*/
public Validator[] getValidators() {
return _validatorList != null ? (Validator[]) _validatorList
.toArray(new Validator[_validatorList.size()]) : EMPTY_VALIDATOR_ARRAY;
}
/**
* Remove a child validator which corresponds to the <f:validator> tag.
* @param validator Validator object
*/
public void removeValidator(Validator validator) {
if (validator == null)
throw new NullPointerException("validator");
if (_validatorList != null) {
_validatorList.remove(validator);
}
}
/**
* Add a child validator which corresponds to the <f:valueChangeListener> tag.
* @param listener ValueChangeListener object
*/
public void addValueChangeListener(ValueChangeListener listener) {
addFacesListener(listener);
}
/**
* Get the list of child validators which corresponds to the <f:valueChangeListener> tags.
* @return array of ValueChangeListener object
*/
public ValueChangeListener[] getValueChangeListeners() {
return (ValueChangeListener[]) getFacesListeners(ValueChangeListener.class);
}
/**
* Remove a child validator which corresponds to the <f:valueChangeListener> tag.
* @param listener ValueChangeListener object
*/
public void removeValueChangeListener(ValueChangeListener listener) {
removeFacesListener(listener);
}
/**
* Save the component state.
* @param context faces context
* @return state object
*/
public Object saveState(FacesContext context) {
Object values[] = new Object[14];
values[0] = super.saveState(context);
values[1] = Boolean.valueOf(_localValueSet);
values[2] = _required;
values[3] = _submittedValue;
values[4] = Boolean.valueOf(_valid);
values[5] = saveAttachedState(context, _validator);
values[6] = saveAttachedState(context, _valueChangeListener);
values[7] = saveAttachedState(context, _validatorList);
values[8] = Boolean.valueOf(_submitted);
values[9] = _immediate;
values[10] = _clientValidators;
values[11] = _clientValidationEvent;
values[12] = _disabled;
values[13] = _revalidate;
return ((Object) (values));
}
/**
* Restore the component state.
* @param context faces context
* @param state state object
*/
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
_localValueSet = ((Boolean) values[1]).booleanValue();
_required = (Boolean) values[2];
_submittedValue = (Object) values[3];
_valid = ((Boolean) values[4]).booleanValue();
_validator = (MethodBinding) restoreAttachedState(context, values[5]);
_valueChangeListener = (MethodBinding) restoreAttachedState(context, values[6]);
_validatorList = (List) restoreAttachedState(context, values[7]);
_submitted = ((Boolean) values[8]).booleanValue();
_immediate = (Boolean) values[9];
_clientValidators = (String) values[10];
_clientValidationEvent = (String) values[11];
_disabled = (Boolean) values[12];
_revalidate = (Boolean) values[13];
}
// ------------------ GENERATED_CODE_BEGIN_MARKER (do not modify!) --------------------
public static final String COMPONENT_TYPE = "com.backbase.bjsf.component.Input";
public static final String COMPONENT_FAMILY = "com.backbase.bjsf.component.Input";
private static final boolean DEFAULT_DISABLED = false;
private static final boolean DEFAULT_IMMEDIATE = false;
private static final boolean DEFAULT_REQUIRED = false;
private static final String DEFAULT_CLIENTVALIDATIONEVENT = "change";
private static final boolean DEFAULT_REVALIDATE = false;
private Boolean _disabled = null;
private Boolean _immediate = null;
private Boolean _required = null;
private String _clientValidators = null;
private String _clientValidationEvent = null;
private Boolean _revalidate = null;
// this variables store the old values read from bindings
private Object _disabled__lastValue = null;
public UIBackbaseInput() {
putFieldInfo("disabled", new ComponentField(true, "disabled", "disabled", java.lang.Boolean.FALSE, false, 3));
putFieldInfo("valueChangeListener", new ComponentField(false, "valueChangeListener", "valueChangeListener", null, false, 1));
putFieldInfo("validator", new ComponentField(false, "validator", "validator", null, false, 1));
putFieldInfo("immediate", new ComponentField(false, "immediate", "immediate", null, false, 1));
putFieldInfo("required", new ComponentField(false, "required", "required", null, false, 1));
putFieldInfo("clientValidators", new ComponentField(false, "clientValidators", "clientValidators", null, false, 1));
putFieldInfo("clientValidationEvent", new ComponentField(false, "clientValidationEvent", "clientValidationEvent", null, false, 1));
putFieldInfo("revalidate", new ComponentField(false, "revalidate", "revalidate", null, false, 1));
}
/**
* Return logical component family name. Together with the logical component name
* it is used in faces config to associate an external renderer.
* @return component family name
*/
public String getFamily() {
return COMPONENT_FAMILY;
}
public void initProperties () {
super.initProperties();
ValueBinding vb = null;
vb = getValueBinding("disabled");
if (vb != null) {
_disabled = (Boolean) vb.getValue(getFacesContext());
}
}
protected void initDirtyProperties () {
super.initDirtyProperties();
_disabled__lastValue = _disabled;
}
protected void checkDirtyProperties () {
super.checkDirtyProperties();
ValueBinding vb = null;
Object newValue = null;
Object oldValue = null;
vb = getValueBinding("disabled");
if (vb != null) {
newValue = vb.getValue(getFacesContext());
_disabled = (Boolean) newValue;
} else {
newValue = getAttributes().get("disabled");
}
oldValue = _disabled__lastValue;
if (oldValue != null && newValue == null) {
setPropertyDirty("disabled");
} else if (newValue != null){
if (oldValue == null) {
oldValue = Boolean.valueOf( DEFAULT_DISABLED );
}
if (!newValue.equals(oldValue)) {
setPropertyDirty("disabled");
}
}
}
/**
* Setter for property 'disabled'.
* Specify false to disable the state of an input element or button
* @param __disabled disabled
*/
public void setDisabled(boolean __disabled) {
Boolean newValue = Boolean.valueOf(__disabled);
_disabled = newValue;
}
/**
* Setter for property 'disabled'.
* This method will set the given property _without_ making
* the component 'dirty'.
* Specify false to disable the state of an input element or button
* @param __disabled disabled
*/
public void setDisabledNoDirty (boolean __disabled) {
Boolean newValue = Boolean.valueOf(__disabled);
_disabled__lastValue = newValue;
_disabled = newValue;
}
/**
* Getter for property 'disabled'.
* Specify false to disable the state of an input element or button
* @return the value of the property
*/
public boolean isDisabled() {
if (_disabled != null) return _disabled.booleanValue();
ValueBinding vb = getValueBinding("disabled");
Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v.booleanValue();
} else {
return DEFAULT_DISABLED;
}
}
/**
* Setter for property 'immediate'.
* Specifies whether the ValueChangeEvent is processed in the Apply Request Values phase (true),
or in the Invoke Application phase (false). The default is false. (Standard JSF)
* @param __immediate immediate
*/
public void setImmediate(boolean __immediate) {
Boolean newValue = Boolean.valueOf(__immediate);
_immediate = newValue;
}
/**
* Getter for property 'immediate'.
* Specifies whether the ValueChangeEvent is processed in the Apply Request Values phase (true),
or in the Invoke Application phase (false). The default is false. (Standard JSF)
* @return the value of the property
*/
public boolean isImmediate() {
if (_immediate != null) return _immediate.booleanValue();
ValueBinding vb = getValueBinding("immediate");
Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v.booleanValue();
} else {
return DEFAULT_IMMEDIATE;
}
}
/**
* Setter for property 'required'.
* Specify if the field should contain data (used during validation). The default is false. (Standard JSF)
* @param __required required
*/
public void setRequired(boolean __required) {
Boolean newValue = Boolean.valueOf(__required);
_required = newValue;
}
/**
* Getter for property 'required'.
* Specify if the field should contain data (used during validation). The default is false. (Standard JSF)
* @return the value of the property
*/
public boolean isRequired() {
if (_required != null) return _required.booleanValue();
ValueBinding vb = getValueBinding("required");
Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v.booleanValue();
} else {
return DEFAULT_REQUIRED;
}
}
/**
* Setter for property 'clientValidators'.
* A comma separated list of validator ids for which client side validation will be enabled. Examples of ids: required, ... If you specify 'all' than all defined validators are used.
* @param __clientValidators clientValidators
*/
public void setClientValidators(String __clientValidators) {
_clientValidators = __clientValidators;
}
/**
* Getter for property 'clientValidators'.
* A comma separated list of validator ids for which client side validation will be enabled. Examples of ids: required, ... If you specify 'all' than all defined validators are used.
* @return the value of the property
*/
public String getClientValidators() {
if (_clientValidators != null) return _clientValidators;
ValueBinding vb = getValueBinding("clientValidators");
String v = vb != null ? (String)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v;
} else {
return null;
}
}
/**
* Setter for property 'clientValidationEvent'.
* The client event on which the client validation should be executed. By default the client event 'change' is used.
If you want to postpone client validation to the moment of clicking the submit button you can define the event as empty string.
* @param __clientValidationEvent clientValidationEvent
*/
public void setClientValidationEvent(String __clientValidationEvent) {
_clientValidationEvent = __clientValidationEvent;
}
/**
* Getter for property 'clientValidationEvent'.
* The client event on which the client validation should be executed. By default the client event 'change' is used.
If you want to postpone client validation to the moment of clicking the submit button you can define the event as empty string.
* @return the value of the property
*/
public String getClientValidationEvent() {
if (_clientValidationEvent != null) return _clientValidationEvent;
ValueBinding vb = getValueBinding("clientValidationEvent");
String v = vb != null ? (String)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v;
} else {
return DEFAULT_CLIENTVALIDATIONEVENT;
}
}
/**
* Setter for property 'revalidate'.
* Setting to true will revalidate on each request. Default value is 'false'
* @param __revalidate revalidate
*/
public void setRevalidate(boolean __revalidate) {
Boolean newValue = Boolean.valueOf(__revalidate);
_revalidate = newValue;
}
/**
* Getter for property 'revalidate'.
* Setting to true will revalidate on each request. Default value is 'false'
* @return the value of the property
*/
public boolean isRevalidate() {
if (_revalidate != null) return _revalidate.booleanValue();
ValueBinding vb = getValueBinding("revalidate");
Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
if (v != null) {
return v.booleanValue();
} else {
return DEFAULT_REVALIDATE;
}
}
// ------------------ GENERATED_CODE_END_MARKER ---------------------------------------
}
Hope this helps,
Luca
in next release but meanwhile workarround generalized
8 July, 2008 - 12:02 — dimitraThis bug has been fixed and will be included in the next JSF Edition release.
The workarround proposed by senaka, regarding having an f:verbatim and a e:handler with a small effort could be implemented in a generalized way by extending the input client element that the jsf component is rendering.
You will need to see how elements can be defined using Backbase TDL and use a unique feature of the extends attribute to do input extends from input.
This extension can be defined in the common config file that defines your bindings and is included in all your pages.
This way you wounldn't need to change your application and when the new release will be available you would only need to remove that fix from the config file.
The client 4.2.1 does not include this fix.
Hi Dimitra, thanks for your
8 July, 2008 - 12:49 — DavidHi Dimitra, thanks for your reply.
Maybe I haven't got enough knowledges about Backbase, but I don't understand your solution. The inputText JSF component hasn't got any client component associated, is simply a plain HTML input tag.
Any way, I could wait a little more for the next release, in fact, I want to know if the other bugs I posted before are fixed or not. This is the reason why I asked to you for an estimated date for the new release of JSF Edition.
David, If you have a
9 July, 2008 - 11:34 — SenakaDavid,
If you have a significant amount of inputText components, it would be more efficient if you define the suggested workaround in a global behavior.
Steps needed:
#1. create a behavior.xml file in the root folder
#2. Define a behavior and include the suggested workaround.
behavior.xml
<d:namespace name="http://www.backbase.com/2008/bdn4821">
<d:behavior name="clearInputText">
<d:handler event="blur" type="application/javascript">
console.dir(this);
var inputComp = this.viewNode.id;
var inputCompVal = this.viewNode.value;
bb.bjsf.sync(this, 'custom', 'param1', inputComp, 'param2', inputCompVal);
</d:handler>
</d:behavior>
</d:namespace>
</d:tdl>
#3. Include the behavior.xml within tags in your index.jsp
#4. Add the custom namespace and prefix on the tag.
</bjsf:application>
#5 To implement the custom behavior in a component, you need to add the behavior attribute and the assign the required behavior name and namespace prefix.
Hope this helps,
-Senaka
server-side bug
8 July, 2008 - 16:16 — lucavargettoHi Dimitra,
What about senaka's BackingBean code?
newTestValue = (String) event.getAtts().get("param2");
if (newTestValue == "") {
System.out.println("null");
testValue = "";
} else {}
}
Is it still necessary?
Regards, Luca
Hi Luca, Once this is
9 July, 2008 - 11:26 — SenakaHi Luca,
Once this is fixed, the workaround will not be necessary.
-Senaka
Just an opinion
10 July, 2008 - 11:47 — lucavargettoHi Senaka,
What's your opinion about our solution (http://bdn.backbase.com/node/4821#comment-11151)? In what circumstances could it generate errors or strange behaviors?
Regards,
Luca
the new fix
10 July, 2008 - 14:56 — andysHi lucavargetto,
Your solution is really nice! You change the source code by extending it.
But I am wondering, what will happen if the submitted value is null? Will it return null exception?
Isn't better to have an extra check for this submitted value?
Andys
not extended just replaced
11 July, 2008 - 08:32 — lucavargettoI have not extended the source code, Andys, because the instruction:
is from source code version 4.1.
So, I have just replaced the source code version 4.2:
with the source code version 4.1.
Q: What will happen if the submitted value is null?
A: you can discover it in version 4.1.
Regards,
Luca.
Hi Luca, The original
11 July, 2008 - 08:50 — DavidHi Luca,
The original source code has a wrong import: it's also necessary to change the java import for MessageUtils class, the correct one is "org.apache.myfaces.shared_impl.util.MessageUtils".
Why did you say this? Has The BB MessageUtils some kind of bug?
Thanks and regards
David
BB MessageUtils
11 July, 2008 - 09:23 — lucavargettoHi David,
BB MessageUtils has no errors or bugs: it simply doesn't exist.
Check the file backbase-jsf-4.2.0.jar
Hope this helps.
Luca
OK Luca, forget my latest
11 July, 2008 - 09:24 — DavidOK Luca, forget my latest post.
I've seen that MessageUtil from BB is obfuscated and this is the reason why you cannot use it.
My doubt is: if we change this import... could we have some unexpected behavior??
unexpected behaviors
11 July, 2008 - 09:50 — lucavargettoI don't know, David, it's possible.
But I prefer unexpected behaviors instead of backingbean fields not properly updated (blank values).
Regards,
Luca