1
votes

I have a radio button group with 2 values: Protected and Public. I want to add the option that if protected selected: a field(laben:hidden) to be invisible, and if is public to be visible.

I have this code at the field visible property:

var protectie = getComponent("protect").getValue();

if(protect == "Public")
    { return true; }
if(protect == "Protected")
    { return false; }

and I have a partial refresh on the radio button goup, on onChange method.

It is working fine, but if I switch 2 times from protected to public I get the following error:

No element to submit with id view:_id1:_id2:_id31:hidden.

Thank you,

Florin

1

1 Answers

2
votes

The error occurs because you want to refresh id "hidden" but it is not rendered at this time.

Frame your field/label with a panel. Partial refresh this panel ("panel1") but let the visible property in field/label.

<xp:panel id="panel1">
    ... your field/label ...
</xp:panel>