Ciao ragazzi,
ho realizzato una semplice JSF:
E sua relativa pagina di codice java:Codice PHP:<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Page1
Created on : 24-mar-2009, 11.34.29
Author : Magnus
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page id="page1">
<webuijsf:html id="html1">
<webuijsf:head id="head1">
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<webuijsf:textField id="textField1" style="position: absolute; left: 72px; top: 24px" text="ssss" valueChangeListenerExpression="#{TipiSoggetto.textField1_processValueChange}"/>
<webuijsf:button actionExpression="#{TipiSoggetto.button1_action}" id="button1" style="position: absolute; left: 24px; top: 24px" text="Button"/>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>
Mi domando: come posso recuperare ( e quindi gestire ) all'interno del metodo button1_action il valore del textField1 prima creato?Codice PHP:public class TipiSoggetto extends AbstractPageBean {
public void init() {
super.init();
try {
_init();
} catch (Exception e) {
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e : new FacesException(e);
}
}
public void preprocess() {
}
public void prerender() {
}
public void destroy() {
}
private void _init() {
}
public String button1_action() {
return null;
}
}
![]()

Rispondi quotando