Re: html:hidden as a collection not String

2008-02-08 Thread Laurie Harper

Shanna7463 wrote:

Is it possible to assign a collection to a html:hidden component, rather than
a string?  
Basically my webapp allows the user to select different options for access

control.  I would like to add these selections to a collection and pass that
to my Action class. 


A hidden input will submit a single string value. To submit a set of 
values you either need to use multiple hidden inputs (i.e. one per 
collection entry) or manually marshal the collection into a single 
string (e.g. a comma separated list of values) the unmarshal it again 
when it's submitted. Multiple hidden inputs is probably the 
easier/cleaner approach.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden

2007-06-10 Thread Nicolás Pace

On 6/10/07, john lee [EMAIL PROTECTED] wrote:

How to assaign value to html:hidden field?

  html:hidden property=loginid value=%= request.getAttribute(loginid)%

  but give me the error message, saying need double quote, after i put double quote before 
%.., cause jsp compile error,

Which error did it cause?


  any clue?

  tks in advance

  john


-
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden

2007-06-10 Thread Mike Baroukh

it's because setValue() for the taglib need a String.
try

html:hidden property=loginid value=%= 
(String)request.getAttribute(loginid)% 

Mike

john lee a écrit :

How to assaign value to html:hidden field?
   
  html:hidden property=loginid value=%= request.getAttribute(loginid)%
   
  but give me the error message, saying need double quote, after i put double quote before %.., cause jsp compile error,
   
  any clue?
   
  tks in advance
   
  john


 
-

Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden

2007-06-10 Thread Nuwan Chandrasoma

Hi,

Use plain told HTML and use your script tag.

Thanks,

Nuwan

- Original Message - 
From: john lee [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Sunday, June 10, 2007 3:49 PM
Subject: html:hidden



How to assaign value to html:hidden field?

 html:hidden property=loginid value=%= 
request.getAttribute(loginid)%


 but give me the error message, saying need double quote, after i put 
double quote before %.., cause jsp compile error,


 any clue?

 tks in advance

 john


-
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden query

2005-01-13 Thread Kishore Senji
html:hidden name=myBean property=myProperty/

Note that html:text property=myField/ is just enough to populate
the text box. The bean:write/ in the body of html:text/ doesn't do
anything.


On Wed, 12 Jan 2005 23:34:27 -0800 (PST), Manisha Sathe
[EMAIL PROTECTED] wrote:
 Following i could get it but now i want this inside html hidden form tag.
 
 html:text property=myField 
 bean:write name=myBean property=myProperty /
 /html:text
 
 But If i use hidden tag then gives me error saying hidden can not have value. 
 How can i put my bean data in  html:hidden ?
 
 regards
 Manisha
 
 Janarthan Sathiamurthy [EMAIL PROTECTED] wrote:
 Hi,
 
 If you have a bean by name myBean in request scope, a property of the bean by 
 name myProperty can be displayed in the jsp page by -
 
 Best Regards,
 Janarthan S
 
 Manisha Sathe wrote:
 I have Add/Edit/Delete for one database table.
 
 For Edit what i want is to get the values from database and display it on 
 form as default.
 
 What i am doing is -
 1)First calling one action handler getting the values from database and 
 putting inside one data bean. Putting that bean inside request scope then 
 forwarding to Edit Form
 2)Inside Edit form I want to get these values as by default for text box
 
 I tried something many different combination using cout / html:bean... etc 
 etc but i am not getting the values.
 
 Is there any good solution for getting default values inside Edit Form?
 
 regards
 Manisha
 
 
 -
 Do you Yahoo!?
 Meet the all-new My Yahoo!  Try it today!
 
 -
 Do you Yahoo!?
 Take Yahoo! Mail with you! Get it on your mobile phone.
 
 -
 Do you Yahoo!?
 All your favorites on one personal page  Try My Yahoo!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden values are null

2004-10-19 Thread Rosemary Philip
David,

same here. a long weary day. :)

the info you shared about onClick is new to me.

I discussed this problem with a developer and he said that this values
come null because there are more than one objects of the same kind.
i.e, in an employee list there are more than one employees and since I
have

 TD class=listbean:write name='empobj' property='name' //TD

in my jsp, it is getting confused and doesnt know which value ( of
which object) to carry across. Do you think this is the case? So how
he has implemented is by tagging an index onto the selected object in
the arraylist(which is being iterated) and comparing the original
arraylist that he sent in the request(to be displayed in the page) to
the one returned from the page.
I understood the concept but am yet to understand how he implemented it. 

All this problems has befallen me because I am using the valueobject
and it has a TimeValue attribute, which is very big.
bean:write name='empobj' property='joinTime' / always gives me
javascript errors saying  ;  is missing or something. the same with
hidden values.

Another idea that a friend gave me is to not use the value object
directlty to write to the page. rather create another object where all
the fields are String and pass that across the pages, so that it will
just be form.getAttribute() in my action.

I am confused. wading through code now. thanks for your input.

On Mon, 18 Oct 2004 23:31:24 -0400, David G. Friedman
[EMAIL PROTECTED] wrote:
 Rosemary,
 
 I had a long day at work so bear with me..
 
 Are you using the JavaScript 'onClick' event to go to the new form which is
 resulting in missing hidden fields?  If so, that is your problem:
 
 It isn't changing the action on the from (And then submitting the form) but
 changing the web page in the browser directly using window.location.  That
 ignores all forms on the page and acts as if you typed the URL in the
 browser's location text box/window.  I believe you would want to change the
 onClick to do something like this:
 
 onClick=javascript:this.form.action=\./empDetailPrepare.do\;this.form.sub
 mit();
 
 My javascript might be slightly off but I'm definitely about there.  This
 would result in the onClick event changing the form's submit location and
 then submitting the form.  Any variables, hidden or visible, would be
 submitted to the new Struts action.
 
 Regards,
 David
 
 -Original Message-
 From: Rosemary Philip [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 18, 2004 9:13 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: html:hidden values are null
 
 Yes, the html:hidden is within an html:form. Also when I do a view
 source on the page, I can see the values of the hidden variables
 correctly.
 but when I trace them to action class, they are null, all of them.
 
 another thing. this is what my html:form tag in my first jsp page says.
 html:form action=/showempList method=post
 
 but in the same page I have this TR class=command
  onclick='window.location=./empDetailPrepare.do'
,
 which goes to a different action. I dont know enough about Struts to
 know if this is a problem. There is a similar logic in another set of
 pages where , both are the same. I meant both actions are the same and
 that works.
 
 On Mon, 18 Oct 2004 00:01:51 -0400, David G. Friedman
 [EMAIL PROTECTED] wrote:
  Are you positive you have the html:hidden tag
  within the appropriate html:form tag?  What is
  your html:form tag for either JSP?
 
  Regards,
  David
 
 
 
  -Original Message-
  From: Rosemary Philip [mailto:[EMAIL PROTECTED]
  Sent: Sunday, October 17, 2004 10:48 PM
  To: [EMAIL PROTECTED]
  Subject: html:hidden values are null
 
  I am having a problem getting values to another page when I try to use
  html:hidden.
 
  I have a list of employee objects in a page. on clicking on an
  employee from the list, the next page should show me more details on
  the employee.
  for getting the values across, i am trying to use html:hidden. but for
  some reason i am getting null for the attributes.
 
  when i do a view source on the page with the list, this is what i see.
 
  TR class=command
 onclick='window.location=./empDetailPrepare.do'   
 
 input type=hidden name=empNmbr value=8423
 input type=hidden name=empSSN value=55315
 
 TD class=listHoward Austin/TD
TD class=listProgrammer/TD
 
  The employee list shows the name and job title of the employee and I
  am passing  empNmbr and empSSN as the hidden parameters.
 
  I have a EmplListForm (ActionForm)  which has empNmbr and empSSN as
  the attributes. I have a Value Object Employee , which has a bunch of
  attributes like empNmbr,empSSN,name,jobTitle etc.
  ---
  struts-config.xml
 
  !--*** emp list form bean, just used to pass some properties to the
  next page***--
  form-bean name=empListbean type=com.test.web.forms.empListForm
  /form-bean

RE: html:hidden values are null

2004-10-18 Thread David G. Friedman
Rosemary,

I had a long day at work so bear with me..

Are you using the JavaScript 'onClick' event to go to the new form which is
resulting in missing hidden fields?  If so, that is your problem:

It isn't changing the action on the from (And then submitting the form) but
changing the web page in the browser directly using window.location.  That
ignores all forms on the page and acts as if you typed the URL in the
browser's location text box/window.  I believe you would want to change the
onClick to do something like this:

onClick=javascript:this.form.action=\./empDetailPrepare.do\;this.form.sub
mit();

My javascript might be slightly off but I'm definitely about there.  This
would result in the onClick event changing the form's submit location and
then submitting the form.  Any variables, hidden or visible, would be
submitted to the new Struts action.

Regards,
David

-Original Message-
From: Rosemary Philip [mailto:[EMAIL PROTECTED]
Sent: Monday, October 18, 2004 9:13 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: html:hidden values are null


Yes, the html:hidden is within an html:form. Also when I do a view
source on the page, I can see the values of the hidden variables
correctly.
but when I trace them to action class, they are null, all of them.

another thing. this is what my html:form tag in my first jsp page says.
html:form action=/showempList method=post

but in the same page I have this TR class=command
  onclick='window.location=./empDetailPrepare.do'
,
which goes to a different action. I dont know enough about Struts to
know if this is a problem. There is a similar logic in another set of
pages where , both are the same. I meant both actions are the same and
that works.




On Mon, 18 Oct 2004 00:01:51 -0400, David G. Friedman
[EMAIL PROTECTED] wrote:
 Are you positive you have the html:hidden tag
 within the appropriate html:form tag?  What is
 your html:form tag for either JSP?

 Regards,
 David



 -Original Message-
 From: Rosemary Philip [mailto:[EMAIL PROTECTED]
 Sent: Sunday, October 17, 2004 10:48 PM
 To: [EMAIL PROTECTED]
 Subject: html:hidden values are null

 I am having a problem getting values to another page when I try to use
 html:hidden.

 I have a list of employee objects in a page. on clicking on an
 employee from the list, the next page should show me more details on
 the employee.
 for getting the values across, i am trying to use html:hidden. but for
 some reason i am getting null for the attributes.

 when i do a view source on the page with the list, this is what i see.

 TR class=command
onclick='window.location=./empDetailPrepare.do'   

input type=hidden name=empNmbr value=8423
input type=hidden name=empSSN value=55315

TD class=listHoward Austin/TD
   TD class=listProgrammer/TD

 The employee list shows the name and job title of the employee and I
 am passing  empNmbr and empSSN as the hidden parameters.

 I have a EmplListForm (ActionForm)  which has empNmbr and empSSN as
 the attributes. I have a Value Object Employee , which has a bunch of
 attributes like empNmbr,empSSN,name,jobTitle etc.
 ---
 struts-config.xml

 !--*** emp list form bean, just used to pass some properties to the
 next page***--
 form-bean name=empListbean type=com.test.web.forms.empListForm
 /form-bean

 !--*** show the emp list ***--
 action path=/showempList  type=com.test.web.actions.EmpListAction
 name=empListbean scope=request
forward name=empdetailprepare path=/empDetailPrepare.do/
 /action

 !--*** prepares the event detail screen for display ***--
 action path=/empDetailPrepare
 type=com.test.web.actions.EmpDetailsPrepareAction name=empListbean
 scope=request
forward name=continue path=/empDetail.jsp/
/action

 --
 empList.jsp

 html:hidden name='empobj' property='empNmbr'/
 html:hidden name='empobj' property='evntTm'/

 TD class=listbean:write name='empobj' property='name' //TD
 TD class=listbean:write name='empobj' property='jobTitle' //TD

 --
 in my action class

 EmplListForm emplListForm = (EmplListForm ) form;
 System.out.println(empNmbr = +request.getAttribute(empNmbr));

 
 I am at a loss at to what am I missing here. Can anyone point out
anything?
 Thanks,
 Rosemary

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:hidden values are null

2004-10-17 Thread David G. Friedman
Are you positive you have the html:hidden tag
within the appropriate html:form tag?  What is
your html:form tag for either JSP?

Regards,
David

-Original Message-
From: Rosemary Philip [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 17, 2004 10:48 PM
To: [EMAIL PROTECTED]
Subject: html:hidden values are null


I am having a problem getting values to another page when I try to use
html:hidden.

I have a list of employee objects in a page. on clicking on an
employee from the list, the next page should show me more details on
the employee.
for getting the values across, i am trying to use html:hidden. but for
some reason i am getting null for the attributes.

when i do a view source on the page with the list, this is what i see.

TR class=command 
onclick='window.location=./empDetailPrepare.do'   

input type=hidden name=empNmbr value=8423
input type=hidden name=empSSN value=55315

TD class=listHoward Austin/TD
   TD class=listProgrammer/TD


The employee list shows the name and job title of the employee and I
am passing  empNmbr and empSSN as the hidden parameters.

I have a EmplListForm (ActionForm)  which has empNmbr and empSSN as
the attributes. I have a Value Object Employee , which has a bunch of
attributes like empNmbr,empSSN,name,jobTitle etc.
---
struts-config.xml

!--*** emp list form bean, just used to pass some properties to the
next page***--
form-bean name=empListbean type=com.test.web.forms.empListForm
/form-bean

!--*** show the emp list ***--
action path=/showempList  type=com.test.web.actions.EmpListAction
name=empListbean scope=request
forward name=empdetailprepare path=/empDetailPrepare.do/
/action

!--*** prepares the event detail screen for display ***--
action path=/empDetailPrepare
type=com.test.web.actions.EmpDetailsPrepareAction name=empListbean
scope=request
forward name=continue path=/empDetail.jsp/
/action

--
empList.jsp

html:hidden name='empobj' property='empNmbr'/
html:hidden name='empobj' property='evntTm'/

TD class=listbean:write name='empobj' property='name' //TD
TD class=listbean:write name='empobj' property='jobTitle' //TD

--
in my action class

EmplListForm emplListForm = (EmplListForm ) form;
System.out.println(empNmbr = +request.getAttribute(empNmbr));


I am at a loss at to what am I missing here. Can anyone point out anything?
Thanks,
Rosemary

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden tag

2004-10-05 Thread Addy Kapur
Yes it is.


On Tue, 5 Oct 2004 10:47:17 +1000, Yakov Belov [EMAIL PROTECTED] wrote:
 I presume it is the struts tag for the standard html :
 input type=hidden ...
 
 
 
 - Original Message -
 From: Phani [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, October 05, 2004 10:36 AM
 Subject: html:hidden tag
 
  Anyone has any idea about this tag:
 
  html:hidden name=customForm property=mode/
 
  Please let me know.
 
  Thanks.
 
 
 
 
  __
  Do you Yahoo!?
  New and Improved Yahoo! Mail - 100MB free storage!
  http://promotions.yahoo.com/new_mail
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden tag

2004-10-04 Thread Niall Pemberton
The User Guide is always a good place to start...

http://struts.apache.org/userGuide/struts-html.html#hidden

Niall

- Original Message - 
From: Phani [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 1:36 AM
Subject: html:hidden tag


 Anyone has any idea about this tag:
 
 html:hidden name=customForm property=mode/
 
 Please let me know.
 
 Thanks.
 
 
 
 
 __
 Do you Yahoo!?
 New and Improved Yahoo! Mail - 100MB free storage!
 http://promotions.yahoo.com/new_mail 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:hidden tag

2004-10-04 Thread Yakov Belov
I presume it is the struts tag for the standard html :
input type=hidden ...
- Original Message - 
From: Phani [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 10:36 AM
Subject: html:hidden tag


Anyone has any idea about this tag:
html:hidden name=customForm property=mode/
Please let me know.
Thanks.

__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]