You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Emi Lu <em...@encs.concordia.ca> on 2009/03/05 17:17:52 UTC

struts1 - html:hidden tag

Good morning,

A question about struts1 <html:hidden> tag.

May I know the differences between (1) vs. (2) please?
(1)<html:hidden property="field1" />
(2)<html:hidden property="field1" value="" />


When I load value from popup windows, it seems that default value will 
be setup on (1); while (2) always return value="".

Could someone let me know why? I am lost why default value will cause 
"problem".

Thanks a lot
---
Lu Ying

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1 - html:hidden tag

Posted by Dave Newton <ne...@yahoo.com>.
Emi Lu wrote:
>> 2) actually assigns the value ""
>> 1) gets the value of the property from the formbean if it has been 
>> assigned in the formbean.
>> You may have an action that populates the form by hitting a database, 
>> loading the data in the form
>> and the forwarding to your current page ie before editing a record.
> 
> If I'd like to load value from datasources into , in my jsp file, (1) 
> should always be used; otherwise, (2) will rewritten the form value to "" ?

Yes, in (2) you're explicitly setting the value--if you're setting it to 
what's contained in field1 then leave off the "value" attribute, which 
it seems like you were doing, or use something besides a blank for the 
value.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1 - html:hidden tag

Posted by Emi Lu <em...@encs.concordia.ca>.
Hi Mas,

> 2) actually assigns the value ""
> 1) gets the value of the property from the formbean if it has been assigned in the formbean.
> You may have an action that populates the form by hitting a database, loading the data in the form
> and the forwarding to your current page ie before editing a record.

If I'd like to load value from datasources into , in my jsp file, (1) 
should always be used; otherwise, (2) will rewritten the form value to "" ?

Thanks,
--
Lu Ying


>> (1)<html:hidden property="field1" />
>> (2)<html:hidden property="field1" value="" />
>>
>>
>> When I load value from popup windows, it seems that default value will
>> be setup on (1); while (2) always return value="".




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1 - html:hidden tag

Posted by Mark Shifman <ma...@yale.edu>.
2) actually assigns the value ""
1) gets the value of the property from the formbean if it has been assigned in the formbean.
You may have an action that populates the form by hitting a database, loading the data in the form
and the forwarding to your current page ie before editing a record.

mas
Emi Lu wrote:
> Good morning,
> 
> A question about struts1 <html:hidden> tag.
> 
> May I know the differences between (1) vs. (2) please?
> (1)<html:hidden property="field1" />
> (2)<html:hidden property="field1" value="" />
> 
> 
> When I load value from popup windows, it seems that default value will
> be setup on (1); while (2) always return value="".
> 
> Could someone let me know why? I am lost why default value will cause
> "problem".
> 
> Thanks a lot
> ---
> Lu Ying
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: struts1 - html:hidden tag

Posted by Alvaro Gomez <ag...@ss.sertracen.com.sv>.
It's while return value in operation en ActionStrust y parameter in IN

-----Mensaje original-----
De: Emi Lu [mailto:emilu@encs.concordia.ca] 
Enviado el: Jueves, 05 de Marzo de 2009 10:18 a.m.
Para: Struts Users Mailing List
Asunto: struts1 - html:hidden tag

Good morning,

A question about struts1 <html:hidden> tag.

May I know the differences between (1) vs. (2) please?
(1)<html:hidden property="field1" />
(2)<html:hidden property="field1" value="" />


When I load value from popup windows, it seems that default value will 
be setup on (1); while (2) always return value="".

Could someone let me know why? I am lost why default value will cause 
"problem".

Thanks a lot
---
Lu Ying

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org