You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Skip Hollowell <sk...@skipdaddy.com> on 2007/04/10 21:36:56 UTC

[S2] Adding Calendar function to a form.

I tried the s:datetimepicker to work on things, but since I am not using 
AJAX, I believe that is a dead end, no?  There'd be no point in bringing 
in the ajax theme if I wasn't using AJAX.

So how do I incorporate a standard js calendar routine into a field on 
my form?

What I want to add:
<a href="javascript:NewCal('demo1','ddmmmyyyy',true,24)"><img 
src="images/cal.gif" width="16" height="16" border="0" alt="Pick a 
date"></a>

Where I want to add it:
<s:textfield key="p.datePaid"  />

I am just missing the concept here on how to plug custom code into the 
s: tags.  I am trying very hard not to hack this thing to bits with 
tricks and cheats.

Skip Hollowell



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


Re: [S2] Adding Calendar function to a form.

Posted by cilquirm <aa...@gmail.com>.
Struts 2 tags support pretty much all the attributes that their html
counterparts do.
I haven't used NewCal ( seen it, but not used it )

but you can try something like this :

<s:textfield id="myfield" key="p.datePaid"/>
javascript:NewCal('myfield','ddmmmyyyy',true,24)  images/cal.gif  


Skip Hollowell wrote:
> 
> I tried the s:datetimepicker to work on things, but since I am not using 
> AJAX, I believe that is a dead end, no?  There'd be no point in bringing 
> in the ajax theme if I wasn't using AJAX.
> 
> So how do I incorporate a standard js calendar routine into a field on 
> my form?
> 
> What I want to add:
>  javascript:NewCal('demo1','ddmmmyyyy',true,24)  images/cal.gif  
> 
> Where I want to add it:
> <s:textfield key="p.datePaid"  />
> 
> I am just missing the concept here on how to plug custom code into the 
> s: tags.  I am trying very hard not to hack this thing to bits with 
> tricks and cheats.
> 
> Skip Hollowell
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Adding-Calendar-function-to-a-form.-tf3555209.html#a9929125
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Adding Calendar function to a form.

Posted by cilquirm <aa...@gmail.com>.
it is possible, if you extend and modify whatever theme you're using.

Then you can put that code wherever you want it to show up right inside the
freemarker template that renders it.
http://struts.apache.org/2.x/docs/extending-themes.html

hth,
-a


Skip Hollowell wrote:
> 
> Trying again, due to bad formatting on Nabble...
> I saw cilquirms reply, but I don't think I phrased my problems 
> correctly.  I understand that the tag libraries are very accomodating, 
> but I am at a loss as to how to insert this code.  This little calendar 
> image and the associated href for clickability would need to go 
> somewhere inside the generated code that the tag outputs.  Is that even 
> possible?  I want to have the little calendar icon be next to the field 
> input, so user's can use it instead of typing in a date by hand. 
> 
> Hopefully that is a bit more clear on my issues.
> 
> Any ideas?
> 
> -------------------------------------------------------
> 
> I tried the s:datetimepicker to work on things, but since I am not using 
> AJAX, I believe that is a dead end, no?  There'd be no point in bringing 
> in the ajax theme if I wasn't using AJAX.
> 
> So how do I incorporate a standard js calendar routine into a field on 
> my form?
> 
> What I want to add is this calendar clickable icon that brings up a date 
> picker:
> <pre>
>  javascript:NewCal('demo1','ddmmmyyyy',true,24)  images/cal.gif  
> </pre>
> 
> Where I want to add it is next to my input box on my form for the 
> datePaid field:
> <s:textfield key="p.datePaid"  />
> 
> I am just missing the concept here on how to plug custom code into the 
> s: tags.  I am trying very hard not to hack this thing to bits with 
> tricks and cheats.
> 
> Skip Hollowell
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Adding-Calendar-function-to-a-form.-tf3555209.html#a9946512
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Adding Calendar function to a form.

Posted by Skip Hollowell <sk...@skipdaddy.com>.
Trying again, due to bad formatting on Nabble...
I saw cilquirms reply, but I don't think I phrased my problems 
correctly.  I understand that the tag libraries are very accomodating, 
but I am at a loss as to how to insert this code.  This little calendar 
image and the associated href for clickability would need to go 
somewhere inside the generated code that the tag outputs.  Is that even 
possible?  I want to have the little calendar icon be next to the field 
input, so user's can use it instead of typing in a date by hand. 

Hopefully that is a bit more clear on my issues.

Any ideas?

-------------------------------------------------------

I tried the s:datetimepicker to work on things, but since I am not using 
AJAX, I believe that is a dead end, no?  There'd be no point in bringing 
in the ajax theme if I wasn't using AJAX.

So how do I incorporate a standard js calendar routine into a field on 
my form?

What I want to add is this calendar clickable icon that brings up a date 
picker:
<pre>
<a href="javascript:NewCal('demo1','ddmmmyyyy',true,24)"><img 
src="images/cal.gif" width="16" height="16" border="0" alt="Pick a 
date"></a>
</pre>

Where I want to add it is next to my input box on my form for the 
datePaid field:
<s:textfield key="p.datePaid"  />

I am just missing the concept here on how to plug custom code into the 
s: tags.  I am trying very hard not to hack this thing to bits with 
tricks and cheats.

Skip Hollowell



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