struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Moacir Cardoso <moac...@yahoo.com.br>
Subject Re: Ajax forms not working - Problem with scriptaculous and dojo
Date Sat, 06 Oct 2007 00:12:08 GMT
Hello people,

I was unable to make my ajax s:form submit to work.
Then I tried to create a simple application from struts2-blank-2.0.9.war 
like this:

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello Jsp</title>
<s:head debug="true" theme="ajax"/>
</head>
<body>
    <s:form action="HelloAjax_Table">  
        <s:textfield name="txtNome"></s:textfield>      
        <s:submit value="Send Ajax" theme="ajax" 
targets="div1"></s:submit>  
    </s:form>  <br/>
    Div1: <br/>
    <div id="div1"></div>
</body>
</html>

The result was fine, but if I add scriptaculous and prototype.js an 
error occurs.

<head>
<script src="<%= request.getContextPath() 
%>/js/scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="<%= request.getContextPath() 
%>/js/scriptaculous/src/scriptaculous.js" type="text/javascript"></script>
...

FATAL exception raised: Could not load 'struts.widget.Bind'; last tried 
'__package__.js'

So, probably dojo have some problems with scriptaculous or prototype.js.
Note that the tag <s:head debug="true" theme="ajax"/> will output some 
dojo scripts.

Becouse that I will not use dojo anymore and  start with scriptaculous 
and prototype.js.

Bye.


Dave Newton escreveu:
> If you set the debug flag do you get any error
> messages?
>
> --- Moacir Cardoso <moacsjr@yahoo.com.br> wrote:
>
>   
>> Yes I do.
>>
>>
>>
>> Dave Newton wrote:
>>     
>>> Do you have an <s:head theme="ajax"/> tag?
>>>
>>> --- Moacir Cardoso <moacsjr@yahoo.com.br> wrote:
>>>
>>>   
>>>       
>>>> Hi,
>>>> I'm unable to make my ajax form work
>>>>
>>>> <body>
>>>>
>>>> <div id='two' style="border: 1px solid
>>>> yellow;"><b>initial content</b></div>
>>>>  <s:form
>>>>       id="theForm2"
>>>>         cssStyle="border: 1px solid green;"
>>>>         
>>>> action="cadastro/pessoa_salvarEndereco.action"
>>>>          method="post"
>>>>          theme="ajax">
>>>>  
>>>>      <input type='text' name='data' value='Struts
>>>> User'>
>>>>  
>>>>      <s:submit value="GO2" theme="ajax"
>>>> targets="two"/>
>>>>  
>>>>  </s:form>
>>>>
>>>> </body>
>>>>
>>>>
>>>>
>>>> It's making a normal http request and not using
>>>>         
>> ajax
>>     
>>>> calls.
>>>>
>>>>
>>>>
>>>>
>>>>     
>>>>         
> ---------------------------------------------------------------------
>   
>>>   
>>>       
>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>>
>>>>
>>>>     
>>>>         
>>>
>>>       
> ---------------------------------------------------------------------
>   
>>> To unsubscribe, e-mail:
>>>       
>> user-unsubscribe@struts.apache.org
>>     
>>> For additional commands, e-mail:
>>>       
>> user-help@struts.apache.org
>>     
>>>
>>>   
>>>       
>>
>>     
> ---------------------------------------------------------------------
>   
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message