• 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: How to determine what component the action came from?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to determine what component the action came from?


  • Subject: Re: How to determine what component the action came from?
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 2 Mar 2009 20:47:13 -0800

Hi Amiel,

On Mar 2, 2009, at 8:18 PM, amiel montecillo wrote:

So I tried to do the Chuck way and he was right,

"There are two ways to do things, the Chuck way and the wrong way". :-P


I did get to keep the pieces. Most notably a stacktrace :)

I was not really expecting that. I've had that happen to me before, but I don't recall what caused it.


Why do you need to process the action in Main? Why can't EMRecipientAjaxGridCell handle the action itself? Is it missing some information? Is the action too specific and this component too general? Supply some more details and I will see if I can find a solution for you.


Chuck




Mar 03 12:07:57 EMManager[5555] DEBUG com .ods .marketing.app.emmanager.components.email.EMRecipientAjaxGridCell - parent binding value: delete
Mar 03 12:07:57 EMManager[5555] DEBUG com.ods.marketing.app.emmanager.components.Main - DeleteAction called. <-- parent was indeed called!
Mar 03 12:07:57 EMManager[5555] WARN NSLog - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
java.lang.NullPointerException
[2009-3-3 12:7:57 CST] <WorkerThread8> java.lang.NullPointerException
at com .webobjects .appserver ._private .WOComponentReference ._popComponentFromContext(WOComponentReference.java:108)
at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:128)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at er .extensions .components.conditionals.ERXElse.invokeAction(ERXElse.java:43)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at er.ajax.AjaxDynamicElement.invokeAction(AjaxDynamicElement.java:98)
at er.ajax.AjaxUpdateContainer.invokeAction(AjaxUpdateContainer.java:62)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92)
at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:127)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at er .extensions .components .ERXWOComponentContent.invokeAction(ERXWOComponentContent.java:217)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92)
at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:127)
at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
at com .webobjects.appserver.WOApplication.invokeAction(WOApplication.java: 1745)
at er .extensions .appserver .ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:49)
at er .extensions .appserver.ERXApplication.invokeAction(ERXApplication.java:1622)
at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedPage(WOComponentRequestHandler.java:206)
at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedSession(WOComponentRequestHandler.java:298)
at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
at com .webobjects .appserver ._private .WOComponentRequestHandler ._handleRequest(WOComponentRequestHandler.java:369)
at com .webobjects .appserver ._private .WOComponentRequestHandler .handleRequest(WOComponentRequestHandler.java:442)
at com .webobjects .appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er .extensions .appserver .ERXApplication.dispatchRequestImmediately(ERXApplication.java:1737)
at er .extensions .appserver.ERXApplication.dispatchRequest(ERXApplication.java:1702)
at com .webobjects .appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com .webobjects .appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:595)




On Tue, Mar 3, 2009 at 11:49 AM, Chuck Hill <chill@global- village.net> wrote:

On Mar 2, 2009, at 7:40 PM, Andrew Lindesay wrote:

Hello Amiel;

I think I understand your question; you have a component in which you want the action to be fired on the parent component? Try to use the "^" as in;

       ^goDelete

This will invoke the method "goDelete" in the parent component.

The problem here is that components are inserted into AjaxGrid cells via WOSwitchComponent and the only bindings are:

ColumnValue: WOSwitchComponent {
       WOComponentName = columnComponentName;
       value = columnValue;
       grid = thisComponent;
}

This situations requires a little trickery or a different design. grid.parent should return the component that holds the grid. So you can do grid().parent().performActionNamed("foo"), but it if breaks you get to keep the pieces. :-)


Chuck





cheers.

The reason I asked this is that I wanted to embed the CRUD component to one of the cells in an AjaxGrid. and needed the "Delete" and "Update" action to be fired in the parent component of the AjaxGrid instead of the CRUD component. So the CRUD can be reusable.

___
Andrew Lindesay
www.lindesay.co.nz



--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects










--
socket error: unable to connect to 127.0.0.1

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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
  • Follow-Ups:
    • Re: How to determine what component the action came from?
      • From: Lachlan Deck <email@hidden>
    • Re: How to determine what component the action came from?
      • From: amiel montecillo <email@hidden>
References: 
 >Re: How to determine what component the action came from? (From: Chuck Hill <email@hidden>)
 >Re: How to determine what component the action came from? (From: amiel montecillo <email@hidden>)
 >Re: How to determine what component the action came from? (From: Andrew Lindesay <email@hidden>)
 >Re: How to determine what component the action came from? (From: Chuck Hill <email@hidden>)
 >Re: How to determine what component the action came from? (From: amiel montecillo <email@hidden>)

  • Prev by Date: Re: How to determine what component the action came from?
  • Next by Date: Re: Posting to WebObject-List;
  • Previous by thread: Re: How to determine what component the action came from?
  • Next by thread: Re: How to determine what component the action came from?
  • Index(es):
    • Date
    • Thread