OpenLaszlo recuperation valeur attribute

Fermé
batoune Messages postés 538 Date d'inscription jeudi 20 septembre 2007 Statut Membre Dernière intervention 4 avril 2017 - 14 janv. 2012 à 14:13
Bonjour,

Je dois réaliser une application en OpenLaszlo pour un TP et j'ai un problème pour passer un datapath en paramètre avec une valeur captée dynamiquement.

J'arrive bien a récupérer la bonne valeur, mais impossible de trouver comment la passer correctement dans la méthode setDatapath() (cf code si dessous a la ligne" problème ici!!!").
Je précise que en rentrant une des valeur possible en dur (par exemple : ....[@id='p1']");) tout marche correctement.

Aurriez vous une solution pour m'aider a résoudre mon problème?
Merci d'avance

<class name="contacts">
    <attribute name="idSel" value="p1" />//attribut pour stocker la valeur de l'id
	<method name="afficherDetail">
	    this.main.vueDetail.setVisible(true);//on rend visible la vue a afficher
	    this.idSel = this.main.grid.listePers.getSelection()[0].getNodeAttribute('id');
            //on passe le datapath avec le bon id
	    this.main.vueDetail.setDatapath("lesContacts:/contacts/personne[@id='this.idSel']");//<===probleme ici!!! 
	    </method>
		<window title="Les Personnes" name="main" width="350" height="250">
		    <view name="grid" x="5" y="5">
			<grid onselect="parent.parent.parent.afficherDetail()" datapath="lesContacts:/contacts/" align="center" name="listePers">
				<gridtext datapath="@id">ID</gridtext>
				<gridtext datapath="@nom">NOM</gridtext>
			</grid>
		    </view>
			<view name="vueDetail" datapath="" x="150" y="5" visible="false">
			    <simplelayout axis="y" spacing="1" />
			    <view datapath=".">
				<simplelayout axis="x" spacing="4" />
                                <text><b>Id</b></text>
				<text datapath="." text="$path{'@id'}"/>
			    </view>
			    <view datapath=".">
				<simplelayout axis="x" spacing="4" />
                                <text><b>Nom</b></text>
				<text datapath="." text="$path{'@nom'}"/>
			    </view>
			    <view datapath=".">
				<simplelayout axis="x" spacing="4" />
				<text><b>Prenom</b></text>
				<text datapath="." text="$path{'@prenom'}"/>
			    </view>
			    <view datapath=".">
				<simplelayout axis="x" spacing="4" />
                                <text><b>Email</b></text>
				<text datapath="." text="$path{'@email'}"/>
			    </view>
			</view>
		</window>
</class>
<contacts/>