maybe using pageBeginRender for init is a viable solution:

.... extends BasePage implements PageBeginRenderListener{
...
    public void pageBeginRender(PageEvent event) {
        if(getFirstObject() == null)
      setFirstObject(new Object());
    }
..

regards,
kris


                                                                           
             Sebastiaan van                                                
             Erk                                                           
             <[EMAIL PROTECTED]                                          An 
             com>                       Tapestry users                     
                                        <tapestry-user@jakarta.apache.org> 
             28.03.2006 11:04                                        Kopie 
                                                                           
                                                                     Thema 
              Bitte antworten           Re: Condition to handle null in    
                    an                  forms                              
             "Tapestry users"                                              
             <[EMAIL PROTECTED]                                             
             karta.apache.org>                                             
                                                                           
                                                                           
                                                                           




That is one way to do it, however make sure you use the right attributes.

<span jwcid="@If" condition="ognl:firstObject">
  <!-- your stuff goes here -->
</span>

Regards,
Sebastiaan

Marc Ende wrote:
> Hi,
>
> I'm currently looking for a solution for the following problem:
>
> I've got some @Input, @Text and @TextArea Fields in a Form.
> These are filled with a value="ognl:firstObject.title" for example.
> If the firstObject is null it causes an exception (source is null for
> getProperty(null, "title"))
>
> I've tried to do something like an @If with condition ognl:firstObject
> and conditionValue="null" to detect the null and avoid parsing the
> statements wich causes the exceptions.
> But this way wasn't successful.
>
> So, my question: wich is the common way to handle this cases?
>
> Thanks for your help.
>
> marc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to