You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by neusars <ne...@yahoo.com.br> on 2009/02/05 17:57:01 UTC

Textfield + method

Hi,
as I put the value in Textfield, when the class this field is not an
attribute. value comes from a method.

thank,
Neusa.
<code>

public class MovimentoProntuario {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="id_prontuario",nullable=false)
	private Prontuario prontuario;
	private Date timestampMovimento;
	private String codinomeMovimento;

		
		
	/*
	 *  Get e Set
	 */
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Date getTimestampMovimento() {
		return timestampMovimento;
	}
	public void setTimestampMovimento(Date timestampMovimento) {
		this.timestampMovimento = timestampMovimento;
	}
	public Prontuario getProntuario() {
		return prontuario;
	}
	public void setProntuario(Prontuario prontuario) {
		this.prontuario = prontuario;
	}
	public String getCodinomeMovimento() {
		return codinomeMovimento;
	}

	public String getNomeCliente(){
		return getRepositorio().getNomeClienteMovimento( id );
		
	}
}
</code>
<code>
public class MovimentoProntuarioForm extends Form {
	
	private TextField  NomeCliente = new TextField("NomeCliente");
	private TextField timestampMovimento = new TextField("timestampMovimento");
	private TextField codinomeMovimento = new TextField("codinomeMovimento");
	

    public MovimentoProntuarioForm(Page page){
    	
		FieldSet set = new FieldSet("Detalhe");
		set.setColumns(2);
		add(set);
			 
		set.add(NomeCliente);
		set.add(timestampMovimento);
		set.add(codinomeMovimento);
   	
    }
	
	
}

</code>

<code>
public class MovimentoProntuarioDetalhePage extends ProntuarioPage {
	
	public MovimentoProntuarioForm form = new MovimentoProntuarioForm(this);
	public TextField  NomeCliente = new TextField("NomeCliente");
	public Long id;
	
	
	@Override
	public void onInit() {

	}
	public MovimentoProntuarioDetalhePage(){
	
		 form.setMethod("get");
		
	}
	

	public void setId(Long id) {
		this.id = id;
	}
	
	public void onGet() {
        if (id != null) {
        	 MovimentoProntuarioRepositorio repositorio =
MovimentoProntuario.getRepositorio();
    		 MovimentoProntuario movimento =
(MovimentoProntuario)repositorio.get(id);
 		     		  	 
            if (movimento != null) {
                form.copyFrom(movimento);
                               
            }
        }
    }

}

</code>
-- 
View this message in context: http://n2.nabble.com/Textfield-%2B-method-tp2275870p2275870.html
Sent from the click-user mailing list archive at Nabble.com.


Re: Textfield + method

Posted by Bob Schellink <sa...@gmail.com>.
Hi,

neusars wrote:
> Hi,
> as I put the value in Textfield, when the class this field is not an
> attribute. value comes from a method.


Could you rephrase the question, I don't quite understand the problem. 
  Are you referring to a specific TextField in your code?


bob

Re: Textfield + method

Posted by neusars <ne...@yahoo.com.br>.
problem solved,
thanks.
Neusa
 

 


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
-- 
View this message in context: http://n2.nabble.com/Textfield-%2B-method-tp2275870p2285681.html
Sent from the click-user mailing list archive at Nabble.com.


Re: Textfield + method

Posted by Ricardo Lecheta <rl...@gmail.com>.
Hi Neusa,

If you class MovimentoProntuario has some field "nomeCliente"..

You should use "nomeCliente" as the TextField name, not "NomeCliente",

this is a good java best practices and convention.

In Portuguese: Use 'n' com minúsculo. Isto é padrão, boa sorte.

Ricardo

2009/2/6 neusars <ne...@yahoo.com.br>

>
> Hi Gilberto,
>
> Very good to ask in Portuguese, I know some java and click it until the
> questions become difficult to develop.
> Muito bom poder perguntar em português, conheço pouco de click e java aí
> até as perguntas se tornam difícil de elaborar.
>
>
>
>
>
>
>
>
> What I tried to say is:
> How to inherit the form I am thinking in using the fields to change the
> data later.
>    O que tentei dizer é o seguinte:
> Quanto a herdar do form estou pensado em usar o campos para alteração dos
> dados posteriormente.
>
>
>
>
>
>
> _SetupBidi('source');
>
>
>
> The problem is that I am not getting the value in setar Textfield
> "NomeCliente. I have a method in class MovimentoProntuario.java
> "getNomeCliente" with value that should appear in the Textfield NomeCliente.
>    O problema é que não estou conseguindo setar o valor no textfield
> "NomeCliente". tenho um método na classe MovimentoProntuario.java
> "getNomeCliente" com valor que deve aparecer no  textField NomeCliente.
>
> thank,
>  Neusa.
>
>
>
>      Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
> --
> View this message in context:
> http://n2.nabble.com/Textfield-%2B-method-tp2275870p2285157.html
> Sent from the click-user mailing list archive at Nabble.com.
>
>


-- 
Ricardo Lecheta

Re: Textfield + method

Posted by neusars <ne...@yahoo.com.br>.
Hi Gilberto,
 
Very good to ask in Portuguese, I know some java and click it until the questions become difficult to develop.
Muito bom poder perguntar em português, conheço pouco de click e java aí até as perguntas se tornam difícil de elaborar. 
 





 

What I tried to say is: 
How to inherit the form I am thinking in using the fields to change the data later. 
   O que tentei dizer é o seguinte:
Quanto a herdar do form estou pensado em usar o campos para alteração dos dados posteriormente.
 





_SetupBidi('source');
 
 

The problem is that I am not getting the value in setar Textfield "NomeCliente. I have a method in class MovimentoProntuario.java "getNomeCliente" with value that should appear in the Textfield NomeCliente.
   O problema é que não estou conseguindo setar o valor no textfield "NomeCliente". tenho um método na classe MovimentoProntuario.java "getNomeCliente" com valor que deve aparecer no  textField NomeCliente.
 
thank, 
 Neusa. 
 


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
-- 
View this message in context: http://n2.nabble.com/Textfield-%2B-method-tp2275870p2285157.html
Sent from the click-user mailing list archive at Nabble.com.


Re: Textfield + method

Posted by "Gilberto C. Andrade" <gi...@gmail.com>.
2009/2/5 neusars <ne...@yahoo.com.br>:
>
> Hi,
> as I put the value in Textfield, when the class this field is not an
> attribute. value comes from a method.
>
> thank,
> Neusa.
> <code>
>

Hi Neusa, we didn't understand you question!
Oi Neusa, nós não entendemos sua dúvida!

Other thing, why did you extend from Form class directly?
Outra coisa, por que vc estendeu (herdou) diretamente da classe Form?

Feel free to ask on Portuguese and I will try to translate to the list.
Sinta-se a vontade em perguntar em português e Eu tentarei traduzir
para a lista.
(Meu inglês tb não é grande coisa, rs rs, mas dá para sobreviver.)

Gilberto C. Andrade
Analista de Sistemas/DBA
www.secad.to.gov.br
www.jroller.com/gilbertoca