You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Gin" <Gi...@NielsenMedia.com> on 2003/05/02 20:49:25 UTC

RE: [Q] An interesting twist - a date picker for beans instead of forms?

Maybe I'm misreading your question. But..
Just because there is no form to update doesnt mean that you cant use
javascript to set the field you need to. However, because there is no form
how do you propose sending your bean change to the backend?
Javascript is clientside so it will set the value on the client's browser
but it is not going to save back to the bean unless that value was somehow
submitted.
-Tim

-----Original Message-----
From: Jeff Smith [mailto:jeffs@centralscheduling.net]
Sent: Friday, May 02, 2003 11:19 AM
To: Struts Users Mailing List
Subject: [Q] An interesting twist - a date picker for beans instead of
forms?


Hi Struts-o-philes,

I've already solved the usual question - you know the one - how do
I create a pop-up-calendar date picker for date fields on my forms?

But I have a slightly different situation which is not handled by my
chosen calendar tool.

I keep a bean in session that defines "today". (This is done
so that my users can review historical information on the site from any
date for which we have information without having to set a date field
on each query page.)

I'd like to be able to have a "quick date set" button on every page so
that the user can quickly modify that target date. But all the
calendar tools I've looked at seem hard coded to place their result
value into a form field via the Java-script document object. In my
situation, there is no form to update.

I was wondering if anybody had or knew of a calendar pop-up tool that
was more tightly struts-ified by creating a form of its own and then
forwarding (on submit) to a struts action.

I suspect I'm going to have to modify an existing solution to get
this, but thought I'd ask first.

-- 
Jefficus                        
mailto:jeffs@centralscheduling.net


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

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


Re[2]: [Q] An interesting twist - a date picker for beans instead of forms?

Posted by Jeff Smith <je...@centralscheduling.net>.
Hi Struts-o-philes,

Friday, May 2, 2003, 12:49:25 PM, you said:
CG> Maybe I'm misreading your question. But..
CG> Just because there is no form to update doesnt mean that you cant use
CG> javascript to set the field you need to. However, because there is no form
CG> how do you propose sending your bean change to the backend?
CG> Javascript is clientside so it will set the value on the client's browser
CG> but it is not going to save back to the bean unless that value was somehow
CG> submitted.
CG> -Tim

I wasn't particularly clear with my first posting. Yes. You need to
have a form in order to submit the bean value change. The question is
can I add this tool without having to write an essentially empty
transient form and then hack the implemenation to make it submit my form
automatically after populating the date field.

I was wondering if this was a problem somebody had already resolved, perhaps
by having the pop window create its own form, take an action and field name as
params, and submit directly to the action, rather than modifying a
transient form on my page.

It seems to me that a client-side tool for editing server-side beans
this way would be pretty useful. And I'd like to support an existing
solution (if there is one) before I go off and duplicate the effort.

-- 
Jefficus                     
mailto:jeffs@centralscheduling.net


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