I was thinking more about this and you would also have to implement the
setApproved().  In there you would have to check if you "serachCriteria" was
null and if not create it.  You would have to do that on all three
parameters in this example case.  All of which you normally get for free
with stripes.

On Tue, Jul 14, 2009 at 12:39 AM, Morten Matras <[email protected]>wrote:

> The hack could be to create a new set of get and set methods in the
> actionbean that "hides" the boolean
>
> public String getApproved(){
>    if (this.getSearchCriteria() == null){
>      return "";
>   }
>   else if(this.getSearchCriteria().getApproved() == null){
>      return "";
>  }
> else return ""+ this.getSearchCriteria().getApproved(); //returns "true" or
> "false".
> }
>
> Then you can shift your html to:
>
> <td><s:radio name="approved" value=""/>Both</td>
> <td><s:radio name="approved" value="true"/>yes</td>
> <td><s:radio name="approved" value="false"/>no</td>
>
> Regards
>
> Morten Matras
> http://www.blobcom.com
>
>
> 2009/7/13 Nathan Maves <[email protected]>
>
>>  Give the html below
>>
>> <td><s:radio name="searchCriteria.approved" value=""/>Both</td>
>> <td><s:radio name="searchCriteria.approved" value="true"/>yes</td>
>> <td><s:radio name="searchCriteria.approved" value="false"/>no</td>
>>
>> n my action bean I have a property and the get/set methods for the
>> searchCriteria object.  In that object there is a Boolean property called
>> approved with valid get/set methods.  Every thing works fine save for the
>> time when that property is null.  I would expect that the "Both" radio
>> button would match the null value and select it.
>>
>> By the way I am also using this configuration.
>>
>> <init-param>
>> <param-name>PopulationStrategy.Class</param-name>
>>
>> <param-value>net.sourceforge.stripes.tag.BeanFirstPopulationStrategy</param-value>
>> </init-param>
>>
>> As a side not I am also experiencing this same situation when using
>> enumerated types.
>>
>> Nathan
>>
>>
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge
>> This is your chance to win up to $100,000 in prizes! For a limited time,
>> vendors submitting new applications to BlackBerry App World(TM) will have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> Stripes-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>>
>
>
> --
>  Morten Matras
>  Consultant
>  Blob Communication ApS
>  Svendsagervej 42
>  DK-5240 Odense NĂ˜
>  P: (+45) 76 6-5-4-3-2-1
>  W: www.blobcom.com
>  E: [email protected]
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to