• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: performing actions in subcomponent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performing actions in subcomponent


  • Subject: Re: performing actions in subcomponent
  • From: Timmy <email@hidden>
  • Date: Fri, 25 May 2007 07:53:43 -0700

Daniele:

Thanks for the response. No, I'm not really sure what is better and you're probably right that it is best to put the form buttons on CalendarComponent itself. I was searching for a solution that would allow me not to do that so that I could simply leave the component clean. I suppose I could also implement some kind of state variable that designates whether some of those control elements are visible or not. That would likely be much simpler than what I am attempting to do now.

Thanks for your input.

Tim


On May 25, 2007, at 12:22 AM, Daniele Corti wrote:



2007/5/25, Timmy <email@hidden>:
WO List:

My project has a large monolithic WOComponent that draws a calendar
(WOTable) with the ability to select checkboxes in each day to effect
a change on that day. This has functioned very well for some time now.
But I've decided to try and split this component into multiple
subcomponents in order to address some feature requests that would
make it useful for a plain calendar to be presented alone (without
widgets, buttons, etc.) - for printing for instance.

So, I've created the following 3 subcomponents:

1. DayComponent - presentation of a day with appropriate widgets and
checkbox for selection. Logic is driven by an inner class
CalendarComponent.DayCell

2. CalendarComponent - full month display of DayComponents built using
a WOTable iterated over an array of DayComponent.DayCell objects

3. CalendarPage - user functional page with widgets to interact with
calendar, select individual days on the calendar, and execute actions.

In testing, if I display CalendarComponent and have all my actions
take place there, they work just as they did in the monolithic
approach. So, one level of subcomponent (DayComponent) appears to work
well nested inside CalendarComponent.

However, I don't want all the buttons, etc. on this component - just
an abstraction of the plain calendar. Instead, I want users to be
directed to the CalendarPage (with CalendarComponent embedded) where
all of the buttons etc are presented to take actions on the calendar.
The problem is that I can't figure out how to execute the working
actions in CalendarComponent from this perspective. In one approach to
fixing the problem I moved some of my action methods to the top-level
component and made sure there was a binding for the collection of
DayCells to there (which seems redundant to me). But under that
scenario, those actions continually think that I haven't selected any
day checkboxes.

this is probably because form values are passed to the componente in witch the WOCheckBox are defined.
Are you sure it's not better to put the buttons inside the CalendarComponent ? I mean, usually it's not better to put the action in the subcomponent then, at the end of the action method, call performParentAction(), to change the page, saveChanges in editing context, etc. ?


Mostly, I recognize that my project's best interests are not served
well by my knowledge level so I need that "a-ha" moment to stretch. :-)


It seems to me that ideally I want to be able to do the opposite of
performParentAction() which I have used elsewhere in the project. It
seems to me that I want to be able to execute actions in
CalendarComponent from the parent CalendarPage but it isn't apparent
to me that any solution I've found in my searches fits this design.

Am I approaching this the wrong way or is there a simple way for me to
address actions in a child component using an enclosing form and
widgets that are both resident on the parent?

regards,

Tim
Programmer/Analyst
UCLA GSE&IS
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >performing actions in subcomponent (From: Timmy <email@hidden>)
 >Re: performing actions in subcomponent (From: "Daniele Corti" <email@hidden>)

  • Prev by Date: Re: Slow Batch Utility
  • Next by Date: Re: performing actions in subcomponent
  • Previous by thread: Re: performing actions in subcomponent
  • Next by thread: Re: performing actions in subcomponent
  • Index(es):
    • Date
    • Thread