Data Binding problem

Hi All,

New to JSF and Portlets.

I am trying to create a portlet which has a input text field and a submit button.

<f:view>

<ui:form binding="#{Page1.form1}" id="form1">

<ui:textField binding="#{Page1.textField1}" id="textField1" text="#{RequestBean1.fullName}"/>

<ui:button action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1" text="Button"/>

</ui:form>

Once the form is submitted the text entered in the field is modified as:

//Method in Page1.java

public String button1_action(){

// TODO: Process the button click action. Return value is a navigation

// case name where null will return to the same page.

getRequestBean1().setFullName("Welcome "+getRequestBean1().getFullName());

return"success";

}

and is then displayed in page2.jsp

<ui:staticText binding="#{page2.staticText1}" id="staticText1" text="#{RequestBean1.fullName}"/>[

This code works absolutely fine while its a simple JSF web project.

But does not work if its a portlet.

The output in the page2.jsp,( after submitting the page1.jsp) Shows nothing.why so?

Works fine if I use session scoped bean , SessionBean1.java

It seems the Request bean is lost, but in simple JSF it works. why only in portal it is lost? Am I missing something?

[1979 byte] By [binb9a] at [2007-11-26 16:40:14]
# 1

According to the article in portal applications we can not use Request scoped beans to pass information from one page to another.

Some how i have a feeling not to trust this.

Can any one comment please.

http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/app_ model.html#15

binb9a at 2007-7-8 23:07:10 > top of Java-index,Development Tools,Java Tools...
# 2
You could try putting staticText1.setText((String)getValue("#{RequestBean1.fullName}"));in the prerender() or preprocess() method (or somewhere similar), instead of binding the textfield to the value directly. Might work, you never know.
sd4139a at 2007-7-8 23:07:10 > top of Java-index,Development Tools,Java Tools...
# 3
This won't work because according to the article, the request object is not the old one in the second page. will give a try though..
binb9a at 2007-7-8 23:07:10 > top of Java-index,Development Tools,Java Tools...
# 4
no
binb9a at 2007-7-8 23:07:10 > top of Java-index,Development Tools,Java Tools...
# 5
DataBean implementing Serializable does the magic
binb9a at 2007-7-8 23:07:10 > top of Java-index,Development Tools,Java Tools...