<fzlists <at> omnytex.com> writes:

> Sure, I understand completely now.  You aren't doing anything unusual at 
> all :)
> 
> I think because you came from an ASP.Net background, you have some 
> expectations that don't apply with Struts (I too came from an MS background,
> although before .Net appeared, so > I've fought the "why doesn't it work 
> THIS way?!?" syndrome too).

Exactly! :-)

> With Struts, there is no separation of page prep and control events.  In 
> other words, if you want to submit to the server to update your calendar, 
> you will be responsible for rendering the rest of the page, including
> any input the user might have made since the last trip to the server.  

Does it mean that a control needs to be aware of other possible controls when 
being rendered? It seems it is not quite OO.

> So, in your case, you really have two options...
> 
> (1) Do the calendar work client-side.  I do this with my calendar controls, 
> which look, feel and work very much like the celendar widget you get in 
> Windows.  However, when you change the month or year, there is no
> trip to the server... The calendar is regenerated on the client-side.  This
> is of course Javascript/dHTML-based work.

I want to go for this approach. I'm thinking of creating such a control. Let's 
take the Calendar in Windows as an example.

1. Create the control layout by using JavaScript
2. Store the day selected by a user in a hidden input
3. Submit the page to the server, where the hidden input value can be 
retrieved and process
 
> As for specifically submitting the calendar values, what you said in the 
> first place is the right answer...
> Your <calendar> tag should render some hidden form fields, then you'll have
> to still do some scripting to populate them when the calendar is clicked, 
> then call submit() on the form, then like I said rebuild the entire page and
> render it to the client.

Can I do it like this?

<calendar>
<html:hidden property=selectedDate/>
</calendar>

Can I use the tags like above? Can the ActionForm *see* the selectedDate 
hidden input in its validate() method? 

> FYI, from the little bit I know of it, JSF deals with the problem much like 
> ASP.Net does, but separating out page prep and event handling.  It is my 
> understanding that much of the "extra" work you'll have to do here in
> re-rendering the page is handled by JSF for you.
 
I'll give JSF a try as well. Thanks a lot, Frank!


Peter




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

Reply via email to