Yura,

 

Thanks again for your sample.

 

This was also my first approach but I had to discard it.

 

My form has to be submitted when the value changes by using _javascript_.

Moreover there are many input fields on the corresponding screen and I don't want the page to be validated when the user

selects an other entry in the selectOneMenu because this makes no sense in my case.

So I set the immediate flag of my hidden commandButton to true.

The result of this was that my assignedValueChangeListener was not called at the "right" time for me.

Due to all these problems I decided to use a component binding there.

 

Michael

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 28. März 2006 18:58
To: 'MyFaces Discussion'
Subject: RE: HtmlSelectOneMenu not serializeable ?

 

As for me I prefer to create such mapping to SelectOneMenu:

 

               <h:selectOneMenu id="appCtrlSelect" value="#{dsDescription.componentName}" disabled="#{dsDescription.disAppCtrl}"

                                valueChangeListener="#{dsMap.appControlChange}" style="width:200px;">

                   <f:selectItem itemValue="Please select" />

                   <f:selectItems value="#{dsMap.appControls}" />

               </h:selectOneMenu>

 Instead of:

               <h:selectOneMenu id="appCtrlSelect" binding="#{dsDescription.DropDownCtrl}" valueChangeListener="#{dsMap.appControlChange}" style="width:200px;">

               </h:selectOneMenu>

 

I guess you will have some problems during Session replication in the cluster if you have whole binding to HtmlSelectOneMenu, because this bean which has mapping to HtmlSelectOneMenu won’t correctly deserializable this property, if you will use transient for this property you won’t desialize this at all.

 

Best regards,

Yura.


From: Michael Heinen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 28, 2006 7:46 PM
To: MyFaces Discussion
Subject: RE: HtmlSelectOneMenu not serializeable ?

 

Yura,

 

Thanks for clarification.

 

What do you exactly mean with “add a few mappings to SelectOneMenu”?

 

Do you see also any issues when I mark the field transient and check in the getter whether the instance is null and reinitialize it if necessary?

 

I found a hint in the WIKI regarding serialization and DataModels:

http://wiki.apache.org/myfaces/FAQ

 

I have a complex dynamic model in the background and some dependencies between my BackingBeans so I think requestScoped beans are currently not a real/performant alternative for me.

 

Michael

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 28. März 2006 18:34
To: 'MyFaces Discussion'
Subject: RE: HtmlSelectOneMenu not serializeable ?

 

Hi,

 

Well as JSF’s UIComponent isn’t Seriaizable so all others ui components also isn’t serializable. I recommended to use request beans instead of session. If you are using session beans, for example you can try to add a few mappings to SelectOneMenu, for example:

 

Value

selectItems

Disable

… etc.

 

All these elements are serializable even <f:selectItems> as SelectItem is Serializable.

Using transient to HtmlSelectOneMenu you will have some issues in future when you will try to deserializable this object.

 

Thanks,

Yura.


From: Michael Heinen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 28, 2006 7:26 PM
To: MyFaces Discussion
Subject: HtmlSelectOneMenu not serializeable ?

 

Hi,

 

I came across the following exception in my log file:

java.io.NotSerializableException: javax.faces.component.html.HtmlSelectOneMenu

 

The HtmlSelectOneMenu is a property in a session scoped managed bean.

Does this mean that I have to declare it transient in order to play it safe?

What about the implemented StateHolder interface?

What about other component bindings?

 

 

Thanks for clarification

Michael

Reply via email to