The way that I would do this is to bind your property to a persistent page
property and just set that property before you call page.activate


MarriedQuestion mq = new MarriedQuestion();
mq.setAnswer("No);
QuestionPage qp = (QuestionPage) cycle.getPage("QuestionPage");
qp.setMarriedQuestion(mq);
cycle.activate(qp);

in your template:
 <span jwcid="[EMAIL PROTECTED]"
selected="ognl:page.marriedQuestion.answer" displayName="Married?"
validators="validators:required">
  <input type="radio" jwcid="@Radio" value="No"/> No
  <input type="radio" jwcid="@Radio" value="Yes"/> Yes
  <input type="radio" jwcid="@Radio" value="Maybe"/> Maybe
 </span>


> Am 07.06.2006 um 19:34 schrieb Phillip Rhodes:
>
>> I think that your radio group is bound to a property, in which
>> case, can
>> you just set your property and the radio group would automatically
>> reflect
>> this when it is rendered?
>
> Yes, I bound the select option to a property and I want to set this
> property to a default value that my application logic can determine
> before the component is rendered. But my question is: when do I
> set this value?In what method do I have to set this value so that the
> RadioButtons within the RadioGroup can see the value of the
> select property of the RadioGroup?
>
> Christian
>
>
>>
>>> Hello!
>>>
>>> I'm currently working on a RadioGroup which includes 1, 2 or 3
>>> RadioButtons.  The decision which Buttons will be shown is done at
>>> runtime. However, I'd like to select the first visible button of this
>>> group as the default selection.
>>>
>>> Can anybody give me a hint on how I could solve this problem?
>>>
>>> I've tried to use the pageBeginRender or renderComponent methods of
>>> the component embedding the RadioGroup. But that didn't solve my
>>> problem. The selection binding of the RadioGroup was set to my chosen
>>> default value, but the at that moment the RadioButtons have already
>>> been rendered and therefore no Button was selected.
>>>
>>> Christian
>>>
>>> P.S. JavaScript is a solution - I know - but I'd like to solve it
>>> without it ;-)
>>>
>>> ---------------------------------------------------------------------
>>> 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]
>


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

Reply via email to