You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by zaxeer <za...@gmail.com> on 2007/10/29 16:41:15 UTC

non-Session Object for From Submission

hi devs,

I have a from which contains some fields: Whole form is reterived by a bean
class say USERINFO if i persist this USERINFO getter setter in session,

 @Persist("session")
    public abstract USERINFO getUSERINFO ();
    public abstract void setUSERINFO (USERINFO USERINFO );

 it works ok. 

but if don't persist USERINFO in session , like this

    public abstract USERINFO getUSERINFO ();
    public abstract void setUSERINFO (USERINFO USERINFO );

on submitting form (@tacos:AjaxForm) the error occurs like 

"target is null for setProperty(null, "zip", 2)"

 (which is USERINFO.zip) i think main class object set to null on
submitting.

plz help me 
-- 
View this message in context: http://www.nabble.com/non-Session-Object-for-From-Submission-tf4712531.html#a13470271
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: non-Session Object for From Submission

Posted by Ulrich Stärk <ul...@spielviel.de>.
zaxeer schrieb:
> Hi devs,
> thanks for your replies
> i am already doing some thing like this in pageBeginRender
> 
>  
> public void pageBeginRender(PageEvent event) {
>  
> 	if (event.getRequestCycle().isRewinding()) {
> 	    return;
> 	}
> 	
> 	if(getUSERINFO () == null){
> 	    setUSERINFO (new USERINFO("1","ABC","XYZ"));
> 	}
> }
> 
> but error:
> 
> "target is null for setProperty(null, "zip", null)"
> 
> remians  there if i persist USERINFO in session its OK, but i think in
> normal JSP application we need not to persist Whole form content in session,
> session just need to use for some long retainable info.
> 
> any idea from you will be helpfull for me.
> 
> 

I don't know exactly how AjaxForm works but it might be that it rewinds 
the form on submission so with that code your USERINFO object won't be 
set to a non-null value.
Also have a look at the client:page persistence scope. That way you can 
persist the object on the client side as long as the user stays on the 
same page.

Uli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: non-Session Object for From Submission

Posted by zaxeer <za...@gmail.com>.
Hi devs,
thanks for your replies
i am already doing some thing like this in pageBeginRender

 
public void pageBeginRender(PageEvent event) {
 
	if (event.getRequestCycle().isRewinding()) {
	    return;
	}
	
	if(getUSERINFO () == null){
	    setUSERINFO (new USERINFO("1","ABC","XYZ"));
	}
}

but error:

"target is null for setProperty(null, "zip", null)"

remians  there if i persist USERINFO in session its OK, but i think in
normal JSP application we need not to persist Whole form content in session,
session just need to use for some long retainable info.

any idea from you will be helpfull for me.


-- 
View this message in context: http://www.nabble.com/non-Session-Object-for-From-Submission-tf4712531.html#a13487603
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: non-Session Object for From Submission

Posted by Norman Franke <no...@myasd.com>.
Similarly, I use an @InitialValue annotation to set it to a function  
call, like this:

@InitialValue("myDefault")
public abstract String getFoo();

public String getMyDefault() { return "Hello"; }

-Norman Franke
ASD, Inc.

On Oct 29, 2007, at 11:53 AM, Andreas Andreou wrote:

> Well, you can initialize it to a non-null value during pageBeginRender
>
> On 10/29/07, zaxeer <za...@gmail.com> wrote:
>>
>> hi devs,
>>
>> I have a from which contains some fields: Whole form is reterived  
>> by a bean
>> class say USERINFO if i persist this USERINFO getter setter in  
>> session,
>>
>>  @Persist("session")
>>     public abstract USERINFO getUSERINFO ();
>>     public abstract void setUSERINFO (USERINFO USERINFO );
>>
>>  it works ok.
>>
>> but if don't persist USERINFO in session , like this
>>
>>     public abstract USERINFO getUSERINFO ();
>>     public abstract void setUSERINFO (USERINFO USERINFO );
>>
>> on submitting form (@tacos:AjaxForm) the error occurs like
>>
>> "target is null for setProperty(null, "zip", 2)"
>>
>>  (which is USERINFO.zip) i think main class object set to null on
>> submitting.
>>
>> plz help me
>> --
>> View this message in context: http://www.nabble.com/non-Session- 
>> Object-for-From-Submission-tf4712531.html#a13470271
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>
>
> -- 
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: non-Session Object for From Submission

Posted by Andreas Andreou <an...@gmail.com>.
Well, you can initialize it to a non-null value during pageBeginRender

On 10/29/07, zaxeer <za...@gmail.com> wrote:
>
> hi devs,
>
> I have a from which contains some fields: Whole form is reterived by a bean
> class say USERINFO if i persist this USERINFO getter setter in session,
>
>  @Persist("session")
>     public abstract USERINFO getUSERINFO ();
>     public abstract void setUSERINFO (USERINFO USERINFO );
>
>  it works ok.
>
> but if don't persist USERINFO in session , like this
>
>     public abstract USERINFO getUSERINFO ();
>     public abstract void setUSERINFO (USERINFO USERINFO );
>
> on submitting form (@tacos:AjaxForm) the error occurs like
>
> "target is null for setProperty(null, "zip", 2)"
>
>  (which is USERINFO.zip) i think main class object set to null on
> submitting.
>
> plz help me
> --
> View this message in context: http://www.nabble.com/non-Session-Object-for-From-Submission-tf4712531.html#a13470271
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>


-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org