File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes bean:write Vs html:text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:write Vs html:text " Watch "bean:write Vs html:text " New topic

bean:write Vs html:text

madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
I am facing strange problem with bean:write,

I have the requirement like below

User clicks one "search"button on parent.jsp one popup will come i.e child.jsp.

In parent.jsp i have 3 fields, those are name, age,division

here name is one textfield after name textfield "search"button willbe there.Remaining are bean:write's not html:text

when user click on search button child.jsp will open, user selects one row and click "ok" then child window closes and the corresponding values ..i.e name, age & division values have to sit in parent.jsp.

For me only name field is setting up, age & divison are not setting up.

If i replace the code with html:text values are setting.. but the client requirement is only bean :write not html:text,,

How i implemented the code sofar is ..i am getting the corresponding values what user selects in javascript and setting for the fields of parent window in javascript only. but for html:text the formbean setter methods are caling but not for bean:write..

Could you any one comeup with soultions


Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

i guess, using html:hidden along with bean:write properties will solve your problem

// for displaying to the user
<bean:write name="className" propery="formBeanProperty" />
// for setting the value in formBean
<html:hidden name="className" propery="formBeanProery" />
madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
Hi Rahul,

ThanksFor your reply,It did n't work without refreshing the page,,

Is there anyway ,without refreshing the page we can call setter method with bean:writes

I did same as above example, It did n't call setter method of parent window property unless untill i explicitly call forms[0].submit in javascript, User doesn't want the load page again which will take time and have somany parameters.

Could anyone please come with solution

I agree. Here's the link:
subject: bean:write Vs html:text
It's not a secret anymore!