You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by maxthesecond <ma...@yahoo.com> on 2008/06/01 11:20:02 UTC

T5 OnActivate

I have a page with (for the moment) three components a layout, a tree
component and a tree navigator.The tree navigator displays the path to your
current displayed categories ex categories/cars/pickups, the tree component
shows as a list, the elements of the current category ex(nisan,ford,toyota)
wich can be selected to go deep in the category tree.

Now, to move arround the categories the navigator is build with pagelinks
and context containing the id of the category, in the page I have the
onActivate(int category) function to change current category and to call the
tree component for loading it with the selected category childs.

On the tree I've implemented an event also containing the id, in the handler
I set the current category and also call the component tree to fill with
it's new id.

The issue is that 1)everithing is ok throug the tree component event
                       2)the onActivate handler works apparently ok (all
elements are well formed and consistent) but looking at the console I found
an exception that tells me that cannot coerce "images" to string....

I've see several post concerning this cast issue,If I remove the call to the
tree component to fill then I get no more console exception, but of course
the tree is no longer filled.

BTW there are no "images" anywhere....

Thanks
 
-- 
View this message in context: http://www.nabble.com/T5-OnActivate-tp17583640p17583640.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 OnActivate

Posted by maxthesecond <ma...@yahoo.com>.
Solved

The isue was that images where build up on the client side and where asigned
the baseURI+imagedirectory, as the baseURI now contains many more items the
result points far away where the images are .

to solve it I just write

String
s=img.baseURI.substring(0,img.baseURI.indexOf("app")+4)+"/images/"+plusImage;
img.src=s;

So the trick is to remove the part of the URI that gets out of the scope.
-- 
View this message in context: http://www.nabble.com/T5-OnActivate-tp17583640p17597422.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 OnActivate

Posted by maxthesecond <ma...@yahoo.com>.
Yes there was an image....

I use the tree component found in 

http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents


In it, there is a javascript in which two icons are used the tipical + and -
icons to represent opened and closed folders, those icons are aded on the
window.onload event, it creates in img object and ataches it's src to a
string holding the path to images (in my case images/)


In another page wich also uses the tree component the
baseUri="http//localhost:8080/app/testtree"
and the generated src="http//localhost:8080/app/images/dhtmlgoodies.gif"

and indeed my images are in webapp/images      so everithing goes fine.


On the new page Im building the
baseUri="http//localhost:8080/app/admin/page/0"
and the generated source is
src="http//localhost:8080/app/admin/page/images/dhtmlgoodies.gif

So the problem seems not to be related at all to the onActivate method but
rather to jscript, in the first case as my page was just one level above the
root level, the constructed src matched the image, but if the page is
further levels depth the src only removes the last one and tapestry
interprets it as a call to the correct page with a weird context.

How to solve it? don't know I'll try tomorrow!
thanks


 













-- 
View this message in context: http://www.nabble.com/T5-OnActivate-tp17583640p17590070.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org