struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignacio Enriquez <nach...@gmail.com>
Subject Re: how to get the result of a form inside of a sx:tabbedpanel div?
Date Wed, 09 Sep 2009 04:09:31 GMT
I could run the project with maven and I am looking here
http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html
and trying to something similar.

I show a list of files (each one with a id) in a table.
also each one has a EDIT button, which is supposed to show more
detailed info and capabilties to edit it.
all this edit stuff should be shown in a div

But When I press the button edit I have a UNDEFINED message in the div.
What I am doing wrong?
I have confirmed that I am get correct data into my action class so my
guess is that the mistake should be in struts.xml? or maybe inside
jsp?

This is part of my jsp, struts.xml, and the java class used.
/****************************************************************************/
UserFilesView.jsp
<s:url action="ShowSingleFile" id="descrsUrl"/>

    <div style="width: 500px;border-style: solid">
		<div style="text-align: right;">
    		<sx:a notifyTopics="/refresh">Refresh</sx:a>
    	</div>
    	<sx:div id="singleFileDiv" href="%{descrsUrl}"
loadingText="Loading..." listenTopics="/refresh"/>
    </div>

<table border="1">
    <tr class="headRow"><td>Name</td><td>Edit</td></tr>
    <s:iterator value="filesList" status="status">

        <tr>
       	<td><s:property value="name"/></td>
	<td>
		<s:url id="EditSingleFileURL" action="EditSingleFile">
		<s:param name="id" value="id" />
		</s:url>
		<sx:a href="%{EditSingleFileURL}" targets="singleFileDiv">Edit</sx:a>
	</td>
	</tr>

    </s:iterator>
</table>
/****************************************************************************/
from struts.xml :
<action name="ShowSingleFile" class="userPackage.ShowFileDetailsAction">
        	<result>/jsp/UserFilesView.jsp</result>
   </action>
   <action name="EditSingleFile"
class="userPackage.ShowFileDetailsAction" method="edit">
        	<result>/jsp/FileDetail.jsp</result>
   </action>
/****************************************************************************/
ShowFileDetailsAction.java:
package userPackage;
import com.opensymphony.xwork2.ActionSupport;
public class ShowFileDetailsAction extends ActionSupport{
private String something;
	private int id;
	public String execute(){
		System.out.println("execute from ShowFileDetailsAction");
		setSomething("A String");
		return SUCCESS;     }
	public String edit(){
		System.out.println("edit from ShowFileDetailsAction");
		setSomething("A String 2");
		System.out.println("id : " + getId());
		return SUCCESS;	}
	public String getSomething(){return something;}
	public void setSomething(String s){this.something = s;}
	public int getId() {return id;}
	public void setId(int id) {this.id = id;}

/****************************************************************************/
from .jsp (the file I want to render inside the div)

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html><head></head><body>
	File Id : <s:property value="id"/>
	Something string value: <s:property value="something"/>
</body></html>
/****************************************************************************/
Help please!



On Wed, Sep 9, 2009 at 1:46 AM, Martin Gainty<mgainty@hotmail.com> wrote:
> see if the project has suppplied a pom.xml
>
> mvn -e compiler:compiler will compile
>
> mvn -e install:install-file will install
> mvn -e deploy:deploy-file will deploy to repository
>
> to use maven in eclipse you will need install the eclipse-maven plugin
> http://maven.apache.org/guides/mini/guide-ide-eclipse.html
>
> Buena Suerte
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Wed, 9 Sep 2009 00:54:12 +0900
>> Subject: Re: how to get the result of a form inside of a sx:tabbedpanel
>> div?
>> From: nacho4d@gmail.com
>> To: user@struts.apache.org
>>
>> Thanks
>> Dave
>> I actually found a very useful sample project from here
>> http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html or
>> http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html
>>
>> There, the apache people seems to be using s:a tag "targets" attribute
>> to put the result in the same div. (see list.jsp and index.jsp)
>>
>> But for some reason I am not able to compile this project. (in eclipse)
>> I suppose because is old. Or maybe the transaction library jar was not
>> the correct one.
>> I am still trying.
>>
>> Regards
>>
>> BTW: I have not tried StrutsBuilder yet, but I wish it gets popular. I
>> never liked that much Eclipse and maven in windows xp cmd is so
>> frustrating!
>>
>> On Tue, Sep 8, 2009 at 11:06 PM, Dave Newton<newton.dave@yahoo.com> wrote:
>> > Ignacio Enriquez wrote:
>> >>
>> >> Martin, Could you be more specific?
>> >
>> > *sigh*
>> >
>> >> I think that what I need is not update is actually reload a new
>> >> content inside the div. (this content is not static, it depends
>> >
>> >> on the initial form input)
>> >
>> > You don't show the form at all. Did you try using the form submit that
>> > uses
>> > the "targets" attribute to define a div (or divs) where the results of
>> > the
>> > submission should be?
>> >
>> >> but I don't know ajax calls and I am in kind of a hurry. (So no time
>> >> to learn very difficult ajax stuff)
>> >
>> > There are no shortcuts.
>> >
>> > Dave
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>>
>>
>> --
>> ________________________________
>> 慶應義塾大学大学院 理工学研究科
>> 開放環境科学専攻 斎藤英雄研究室
>> 修士1年 Guillermo Ignacio Enriquez G.
>> e-mail :  nacho4d@hvrl.ics.keio.ac.jp
>> ________________________________
>> _____________________________________________
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> ________________________________
> Hotmail® is up to 70% faster. Now good news travels really fast. Try it now.



-- 
________________________________
慶應義塾大学大学院 理工学研究科
開放環境科学専攻 斎藤英雄研究室
修士1年 Guillermo Ignacio Enriquez G.
e-mail :  nacho4d@hvrl.ics.keio.ac.jp
________________________________
_____________________________________________

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


Mime
View raw message