?
Solved

<bean:write> inside <html:textarea> tag

Posted on 2006-03-28
12
Medium Priority
?
1,001 Views
Last Modified: 2008-01-09
Hi

I need to display text in the text area which is stored as property of bean. The text can be in decimal/hexadecimal/normal text.

The below code isnt working for me:

<html:textarea property="sTranslatedText" style="width:300px" name="SessionDataBean"/>
The text is displayed as is.....i.e. if itz in decimal..then decimal...so on

<html:textarea property="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
</html:textarea>
It doesn't display anything in the text area.

Can anyone tell me how to go abt it??

Thanks a lot!!!
Regards,


0
Comment
Question by:dreams4ever
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 11

Accepted Solution

by:
fargo earned 1000 total points
ID: 16318927
Hi,

You can surely display the bean property in text area as follows
<html:textarea style="width:380" styleClass="textarea" property="sTranslatedText" rows="5" cols="30" ></html:textarea>

>> The text is displayed as is.....i.e. if itz in decimal..then decimal...so on
What do u mean by above sentence?

fargo

0
 
LVL 19

Expert Comment

by:actonwang
ID: 16325524

>><html:textarea property="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
     </html:textarea>

      <html:textarea > will ignore what you provide inside the tag, even you write it as

      <html:textarea>  some text explicitly </html:textarea>

      It only prints out property value specified in the <html:textarea>.

      So what you might need to do is as following:
    <textarea name="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
     </textarea>

      forgo's above method might prevent your phraseTranslatedText property from getting the value which is not your intention.

Acton
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16325551
     Other way to do it (might be better) is that in your reset(..) function of your form bean:

      You add:
      phraseTranslatedText = sTranslatedText;

      and in your jsp, simply write:

      <html:textarea property="phraseTranslatedText" style="width:300px" />

Enjoy :)
Acton      
         
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16348929

set what ever you want to display set it to var variable.

<html:textarea property='<% var %>'  style="width:300px" name="SessionDataBean"/>

try out.
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16348930
i am sorry tht was.

<html:textarea property='<%= var %>'  style="width:300px" name="SessionDataBean"/>

0
 
LVL 19

Expert Comment

by:actonwang
ID: 16349416
>><html:textarea property='<%= var %>'  style="width:300px" name="SessionDataBean"/>
     ??
    phraseTranslatedText is already there, why var? not necessary. ..
0
 

Author Comment

by:dreams4ever
ID: 16360113
Hey

I know that I can go with html tag textarea, but I was in the assumption that it can be done thru struts tag. I dont see any of the above will help me to go with struts tag.

Thanks a lot!!
Regards,
0
 
LVL 11

Expert Comment

by:fargo
ID: 16360143
hi,

<html:textarea.. /> is a struts tag.

Please see here
http://www.roseindia.net/struts/strutsHtmlTags.shtml

fargo
0
 

Author Comment

by:dreams4ever
ID: 16361143
Hi Fargo,

I meant that I can do it with html tag <textarea> using bean write but not with <html:textarea>.

Thanks a lot!!
Regards,
0
 
LVL 19

Assisted Solution

by:actonwang
actonwang earned 1000 total points
ID: 16361480
>>    Other way to do it (might be better) is that in your reset(..) function of your form bean:

      You add:
      phraseTranslatedText = sTranslatedText;

      and in your jsp, simply write:

      <html:textarea property="phraseTranslatedText" style="width:300px" />

       

       Haveyou tried this? It SHOULD work!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question