List Info

Thread: RE: ui:include, ui:param and postback




RE: ui:include, ui:param and postback
user name
2007-10-24 11:44:49
Something's up with the state saving then.

Facelets assigns a
ValueExpression("${reportBean.parameters.dateFrom}"
;..) with an internal VariableMapper that says reportBean =
$

I don't even know why MyFaces code is parsing/evaluating the
expression-- it should be internal to the expression
Facelets assigned.

==

Hi!

Now a something trivial question.

I have the following piece of code:

                <ui:include
src="/content/OPSJ/xhtml/DataSourceReportingCriteria.xh
tml">
                    <ui:param
name="reportBean"
value="#" />
                </ui:include>

The include create a form with bindings like
#{reportBean.parameters.dateFrom} etc.
Now, on postback the variable reportBean is not bound and I
get an
exception like this:

|Caused by: javax.faces.el.PropertyNotFoundException: Base
is null: reportBean
	at 
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope
rty(ValueBindingImpl
.java:463)
	at
org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBinding
Impl.java:251)
	at
javax.faces.component.UIInput.updateModel(UIInput.java:278)
|


Which seems rather clear to me as the ui:param is just a
TagHandler
which is called only on buildView which is called only in
renderView 

It seems that setting facelets.BUILD_BEFORE_RESTORE=true
fixed this. Is
this the proposed way how to deal with that scenario?

Thanks!
Ciao,
Mario


-- 
Mario

------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribefacelets.dev.java.net
For additional commands, e-mail: users-helpfacelets.dev.java.net

------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribefacelets.dev.java.net
For additional commands, e-mail: users-helpfacelets.dev.java.net


Re: ui:include, ui:param and postback
user name
2007-10-24 14:17:53
Hi!
> Something's up with the state saving then.
>
> Facelets assigns a 
>
ValueExpression("${reportBean.parameters.dateFrom}"
;..) with an 
> internal VariableMapper that says reportBean =
$
>
> I don't even know why MyFaces code is
parsing/evaluating the 
> expression-- it should be internal to the expression
Facelets assigned.
>   
Looks like I've found .... well .... something.

I have a component which creates a set of components using
the JSF API.

Basically it works that way:

HtmlInputText cmp = (HtmlInputText) 
context.getApplication().createComponent("javax.faces.H
tmlInputText");
cmp.setValueBinding("value", 
context.getApplication().createValueBinding(createValueBindi
ngString(field))); 


This is a JSF 1.1 component running in a JSF 1.1
environment.

Unfortunately context.getApplication().createValueBinding()
returns a 
plain old myfaces ValueBindingImpl instead of a Facelets
enhanced one.
Any chance to get this working?

Ciao,
Mario

------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribefacelets.dev.java.net
For additional commands, e-mail: users-helpfacelets.dev.java.net


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )