tapestry-user@jakarta.apache.org
[Top] [All Lists]

Re: @Message Component

Subject: Re: @Message Component
From: "Brian Long"
Date: Tue, 28 Feb 2006 10:28:00 +0000
Hi,

one of the reasons that this is such an infuriating problem is that I can
see the path to the javascript file on my generated html page, Message.js,
with the doSomething() function, which shows an alert.

<body>
<script type="text/javascript"
src="/productlink_webclient/assets/1f7008d3e65882519740d925d6c5a813/org/apache/tapestry/form/Form.js"></script>
<script type="text/javascript"
src="/productlink_webclient/assets/15dec4a922cd27ef36879f37b64035da/org/apache/tapestry/form/DatePicker.js"></script>
<script type="text/javascript" src="/myProject/WEB-INF/jwc/Message.js"
></script>

in the center of my page then are the TextFields with the attached
DatePicker and Message components

<tr>
<td>Choose Date</td>
<td><input type="text" name="DatePicker" value="" title="dd MMM yyyy"
id="DatePicker"/>&nbsp;<a href="javascript:calendar_DatePicker.toggle(
document.form.DatePicker);"><img
src="/productlink_webclient/assets/d1154f8b7bf653ba6128f8cb1f5c8e95/org/apache/tapestry/form/DatePickerIcon.png"
border="0"/></a></td>
</tr>
<tr>
<td>Enter Text</td>
<td><input type="text" name="Message" value="" id="Message"/>&nbsp;<a href=
"javascript:doSomething();"><img src="/myProject/images/keypad/Message.png"
border="0"/></a></td>
</tr>

As you can see here I'm calling this doSomething() method when I click on
the image button, but nothing happens, now after much head scratching, the
only possible explanation I can come up with is that it can't find the
javascript file Message.js, which by the way IS located in
"/myProject/WEB-INF/jwc/Message.js" .

Alternatives, well Message.script allows me to put javascript onto the page
itself, in the case of DatePicker, this was used to initialise the Calender
class. I can use this to put my doSomething() method directly onto the page,
where it will work as expected, press button, receive alert text.

The problem is that this message component isn't actually what I want, I've
actually written a very large and complex javascript component, I only
created Message.js when I found that I couldn't get the other one to work
and wanted something simple to re-assure me that what I was doing was right!

Now that I can't get something as simple as this to work, I'm seriously
considering giving up on tapestry components and just using an applet to
achieve the desired result.

Yours in despair, Brian.
<Prev in Thread] Current Thread [Next in Thread>