• 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: Trying to create a dynamic url with the components action?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to create a dynamic url with the components action?


  • Subject: Re: Trying to create a dynamic url with the components action?
  • From: Jean-François Veillette <email@hidden>
  • Date: Mon, 7 May 2007 13:54:49 -0400

If I understand correctly, the code provided down bellow was from the 'FileDownload' component.
If you want me to help you more than this, I would need to see more code, .java, .wo and _javascript_.  It look like you don't want to show it up though.
I might be blind, but I need to see more code, to pin-point what is going wrong.
But not knowing anymore, I would say ... either :
- you trap (implement) invokeAction and return a value without calling super in one of : Page, DocumentTree Component, Node Component, NXDowloadComponent or NXHyperlink.
- the url generated in appendToResponse is not recognized in invokeAction once user click on it.  I mean that a nxhyperlink have an element id of 1.2.3.4.5 when in appendToResponse, but when you click on it, the server side object doesn't render the same elementid (only 1.2.3 maybe).  This can be the side effects of playing with conditional values before invokeAction. This can also be the side effects of having Ajax modifying your components hierarchy.  This can also be the side effects of updating list values in 'awake' or any methods before invokeAction (setters for example).

- jfv

Le 07-05-07 à 13:34, James Cicenia a écrit :

The delete action does work in all cases.

Here is the code in documentTree:

<webobject name = "TreeNodeRepetition">
  <webobject name="IsFile">
<webobject name="TreeNode">
    <webobject name="CanViewDocs">
    <webobject name="FileDownload"><webobject name="ItemTitle"></webobject></webobject>
    </webobject>
    <webobject name="CanNotViewDocs">
    <webobject name="ItemTitle"></webobject>
    </webobject>
</webobject>
  </webobject>
  <webobject name="IsFolder">
<webobject name="TreeNode"></webobject>
<webobject name="DocumentsTree1"></webobject>
  </webobject>
  <webobject name="IsURL">
<webobject name="TreeNode"></webobject>
  </webobject>
</webobject>


See the FileDownload above? Well that is the part that doesn't work... yet its appendToResponse is always firing so I know it is getting rendered
and of course the link show up too so the it does its Hyperlink correctly.

So hard to debug this type of problem.

- James



On May 7, 2007, at 12:23 PM, Jean-François Veillette wrote:

The code bellow, is in NXHyperlink or in Node Component ?

When you say that the "...delete action works in all cases...", that led me to beleive that the "generateDeleteURL(...)" is working as expected.
But then I read : "It is that last else which does in fact render seemingly correct. It even runs the NXComponents appendToResponse... it just won't fire its bound action."
I'm a bit confused, I thought that delete action was working in all cases.

I would need to see the "generateDeleteURL" method, and a little bit of it's context (which file are we looking at), how have you defined the bindings (if you think it would help to know that).

- jfv


Le 07-05-07 à 12:58, James Cicenia a écrit :

Actually what is I do is this:


All those components I listed get rendered. However, the Node component may or may not render the
NXDownloadComponent as not all are files, some are directories, and some are URLs. They all have a
delete action too. That delete action works in all cases, with a confirmation, etc., however, it is rendered by
the NodeComponent

So, in my appendToResponse, I check if it is a file or not and if it is I just do:

public void appendToResponse(WOResponse aResponse, WOContext aContext) {
String obj;
if("FOLDER".equals(item.documentType())){
obj =  "\r var o"+item.rowid().toString()+" = {label:'"+item.title()+"', columnString:'<td>"+item.addDate()+"</td><td>"+item.addUser().fullName()+"</td><td>"+generateDeleteURL(item)+"</td>'};";
aResponse.appendContentString(obj);
aResponse.appendContentString(link());

}else if("URL".equals(item.documentType())){
obj =  "\r var o"+item.rowid().toString()+" = {html:'<a href="" target=\"_blank\">"+item.title()+"</a>', columnString:'<td>"+item.addDate()+"</td><td>"+item.addUser().fullName()+"</td><td>"+generateDeleteURL(item)+"</td>'};";
aResponse.appendContentString(obj);
aResponse.appendContentString(link());

}else{
//Documennt
WOResponse content = new WOResponse();
    super.appendToResponse(content, aContext);
obj =  "\r var o"+item.rowid().toString()+" = {html:'"+content.contentString().trim()+"', columnString:'<td>"+item.addDate()+"</td><td>"+item.addUser().fullName()+"</td><td>"+generateDeleteURL(item)+"</td>'};";
aResponse.appendContentString(obj);
aResponse.appendContentString(link());
}

}


It is that last else which does in fact render seemingly correct. It even runs the NXComponents appendToResponse... it just won't fire its bound action.

- James



On May 7, 2007, at 10:43 AM, Chuck Hill wrote:


On May 7, 2007, at 6:50 AM, Jean-François Veillette wrote:


Le 07-05-07 à 09:32, James Cicenia a écrit :
So after refactoring my code, I figured out how to use that component, get the url from it, and embed
it in my _javascript_ YUI Treeview.  Everything seems to work great except for one big confusing problem.
My link's action binding isn't being fired.

When you say the action is not fired, do you mean that the browser send a request, the application respond, but somehow the action is not fired ?


Here is the scenario:

Page
DocumentTree Component
Node Component
NXDowloadComponent
NXHyperlink

So it all renders correctly and even the href that is generated sure looks correct. However, when I
click the hyperlink, it just won't fire its action method.

I doubled checked all the bindings.  Is it because it is being rendered dynamically via _javascript_
at the browser level?

How  do you dynamically render the hyperlink at the _javascript_ level ?

Its context / element id numbers must match an objet on the server side.
It's probably that the hyperlink component doesn't recognize the context id as itself, and so doesn't invoke it's action binding.

Please, explain in more details what you have done in the nxhyperlink component and how you play with the url on the _javascript_ side.

I think that Jean-François has identified your problem here.  WO won't fire an action that _it_ did not generate a component for.  Like he said, more information please.

Chuck



 _______________________________________________
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:
    • SOLVED: Trying to create a dynamic url with the components action?
      • From: James Cicenia <email@hidden>
References: 
 >Trying to create a dynamic url with the components action? (From: James Cicenia <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Lachlan Deck <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: James Cicenia <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Chuck Hill <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Jean-François Veillette <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: James Cicenia <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Jean-François Veillette <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Chuck Hill <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: James Cicenia <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: Jean-François Veillette <email@hidden>)
 >Re: Trying to create a dynamic url with the components action? (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: Fetchspec of average related field
  • Next by Date: Re: Apple's Support of WebObjects
  • Previous by thread: Re: Trying to create a dynamic url with the components action?
  • Next by thread: SOLVED: Trying to create a dynamic url with the components action?
  • Index(es):
    • Date
    • Thread