You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Vicente de Rivera III <th...@gmail.com> on 2009/10/05 12:56:07 UTC

Form

Hi, how do you clear the contents of a Form?

Re: Form

Posted by Todd Volkert <tv...@gmail.com>.
FYI, Greg just checked in an update that adds a clear() method to
Component.  You can now call this on your form to clear it, which will
probably be easier than the aforementioned "clear bind context".

Cheers,
-T

On Mon, Oct 5, 2009 at 11:51 AM, Greg Brown <gk...@mac.com> wrote:

> You could wrap your bean in a "decorator" dictionary that converts
> totalPrice to an empty string when it is 0. The Stock Tracker tutorial does
> something similar.
>
> On Oct 5, 2009, at 11:46 AM, Vicente de Rivera III wrote:
>
> Only one very small prob, I have a double totalPrice in my java bean. Some
> other parts of the app, I need it to show 0.00 and now I need to show it
> blank
>
> On Mon, Oct 5, 2009 at 7:10 PM, Todd Volkert <tv...@gmail.com> wrote:
>
>> I'd do it via data binding -- call form.load() and pass a dictionary that
>> contained data binding key/value pairs whose values would clear your
>> components.
>>
>> -T
>>
>>
>> On Mon, Oct 5, 2009 at 6:56 AM, Vicente de Rivera III <
>> thirdy.derivera@gmail.com> wrote:
>>
>>> Hi, how do you clear the contents of a Form?
>>
>>
>>
>
>

Re: Form

Posted by Greg Brown <gk...@mac.com>.
You could wrap your bean in a "decorator" dictionary that converts  
totalPrice to an empty string when it is 0. The Stock Tracker tutorial  
does something similar.

On Oct 5, 2009, at 11:46 AM, Vicente de Rivera III wrote:

> Only one very small prob, I have a double totalPrice in my java  
> bean. Some other parts of the app, I need it to show 0.00 and now I  
> need to show it blank
>
> On Mon, Oct 5, 2009 at 7:10 PM, Todd Volkert <tv...@gmail.com>  
> wrote:
> I'd do it via data binding -- call form.load() and pass a dictionary  
> that contained data binding key/value pairs whose values would clear  
> your components.
>
> -T
>
>
> On Mon, Oct 5, 2009 at 6:56 AM, Vicente de Rivera III <thirdy.derivera@gmail.com 
> > wrote:
> Hi, how do you clear the contents of a Form?
>
>


Re: Form

Posted by Todd Volkert <tv...@gmail.com>.
Could you decorate the bind context dictionary in this call to load() such
that it detects 0D and returns ""?

On Mon, Oct 5, 2009 at 11:46 AM, Vicente de Rivera III <
thirdy.derivera@gmail.com> wrote:

> Only one very small prob, I have a double totalPrice in my java bean. Some
> other parts of the app, I need it to show 0.00 and now I need to show it
> blank
>
>
> On Mon, Oct 5, 2009 at 7:10 PM, Todd Volkert <tv...@gmail.com> wrote:
>
>> I'd do it via data binding -- call form.load() and pass a dictionary that
>> contained data binding key/value pairs whose values would clear your
>> components.
>>
>> -T
>>
>>
>> On Mon, Oct 5, 2009 at 6:56 AM, Vicente de Rivera III <
>> thirdy.derivera@gmail.com> wrote:
>>
>>> Hi, how do you clear the contents of a Form?
>>
>>
>>
>

Re: Form

Posted by Vicente de Rivera III <th...@gmail.com>.
Only one very small prob, I have a double totalPrice in my java bean. Some
other parts of the app, I need it to show 0.00 and now I need to show it
blank

On Mon, Oct 5, 2009 at 7:10 PM, Todd Volkert <tv...@gmail.com> wrote:

> I'd do it via data binding -- call form.load() and pass a dictionary that
> contained data binding key/value pairs whose values would clear your
> components.
>
> -T
>
>
> On Mon, Oct 5, 2009 at 6:56 AM, Vicente de Rivera III <
> thirdy.derivera@gmail.com> wrote:
>
>> Hi, how do you clear the contents of a Form?
>
>
>

Re: Form

Posted by Todd Volkert <tv...@gmail.com>.
I'd do it via data binding -- call form.load() and pass a dictionary that
contained data binding key/value pairs whose values would clear your
components.

-T

On Mon, Oct 5, 2009 at 6:56 AM, Vicente de Rivera III <
thirdy.derivera@gmail.com> wrote:

> Hi, how do you clear the contents of a Form?