You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Madhavan Thirumalai <ma...@letsgaggle.com> on 2005/08/22 02:28:03 UTC

Extracting form from Radio element

I have a radio box in a form and I would like to ultimately disable certain
fields of the form when the user selects a particular radio button. Right
now, I am just trying to do the plumbing.

Here is what the script looks like:

<script>

<input-symbol 
    key="repeat_radiobutton_component" 
    class="org.apache.tapestry.form.Radio" 
    required="yes"/>
<let key="basename">	
    document.${repeat_radiobutton_component.form.name}
</let>
<let key="repeat_radiobutton">	
    ${basename}.${repeat_component.name}
</let>

<body>
<![CDATA[ 
function display() 
{
    alert("How now");
}
]]>
</body>

<initialization>
    ${repeat_radiobutton}.onclick=function() {
        display();
    }
</initialization>
</script>

-----------------------------
But when the page is loaded, I get a runtime error

Unable to read expression '<parsed expression>' of
{repeat_radiobutton_component=org.apache.tapestry.form.Radio$Enhance_25@904f
75[MakePosting/Repeat]}. 
   
ognl.NoSuchPropertyException 
org.apache.tapestry.form.Radio$Enhance_25.form 
name: form 
target: org.apache.tapestry.form.Radio$Enhance_25@904f75[MakePosting/Repeat]
----------------------------

Note - I can extract the form from the enclosing RadioGroup without a
problem. However, in the case, I am then unable to specify the radio button
to register the onclick event handler.

I would appreciate any tips or pointers to sample code.
Thanks,
Madhavan


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


Re: Extracting form from Radio element

Posted by Geoff Longman <gl...@gmail.com>.
The Radio class extends AbstractComponent and not AbstractFormComponent, 
which is why you can't do the ognl equiv of getForm() on one.

(This is in Tap 3.0.3, don't have Tap 4.0 src handy right now).

Geoff


On 8/21/05, Madhavan Thirumalai <ma...@letsgaggle.com> wrote:
> 
> I have a radio box in a form and I would like to ultimately disable 
> certain
> fields of the form when the user selects a particular radio button. Right
> now, I am just trying to do the plumbing.
> 
> Here is what the script looks like:
> 
> <script>
> 
> <input-symbol
> key="repeat_radiobutton_component"
> class="org.apache.tapestry.form.Radio"
> required="yes"/>
> <let key="basename">
> document.${repeat_radiobutton_component.form.name}
> </let>
> <let key="repeat_radiobutton">
> ${basename}.${repeat_component.name}
> </let>
> 
> <body>
> <![CDATA[
> function display()
> {
> alert("How now");
> }
> ]]>
> </body>
> 
> <initialization>
> ${repeat_radiobutton}.onclick=function() {
> display();
> }
> </initialization>
> </script>
> 
> -----------------------------
> But when the page is loaded, I get a runtime error
> 
> Unable to read expression '<parsed expression>' of
> {repeat_radiobutton_component=
> org.apache.tapestry.form.Radio$Enhance_25@904f
> 75[MakePosting/Repeat]}.
> 
> ognl.NoSuchPropertyException
> org.apache.tapestry.form.Radio$Enhance_25.form
> name: form
> target: org.apache.tapestry.form.Radio$Enhance_25@904f75
> [MakePosting/Repeat]
> ----------------------------
> 
> Note - I can extract the form from the enclosing RadioGroup without a
> problem. However, in the case, I am then unable to specify the radio 
> button
> to register the onclick event handler.
> 
> I would appreciate any tips or pointers to sample code.
> Thanks,
> Madhavan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
> 
> 


-- 
The Spindle guy. http://spindle.sf.net
Get help with Spindle: 
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed: 
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates