Add a <t:parameter> block for the cell you want to have non-editable and just output its value. Something along

<t:beaneditform value="foo">
  <t:parameter name="barCell">
    <t:if test="hasEditRights">
      <t:label for="barField" />
      <t:textfield t:id="barField" value="foo.bar" />
      <p:else>
        ${foo.bar}
      </p:else>
    </t:if>
  <t:parameter>
</t:beaneditform>

public boolean isHasEditRights()
{
  return user.inRole(FOO_ROLE) || user.inRole(BAR_ROLE);
}

HTH,

Uli

manuel aldana schrieb:
Hi,

I am using the BeanEditor Form for editing users. For that I would like to have a "partial" editing form, i.e. I want to protect certain columns from being edited.

Example is the id of the object: Once it is created I want to have it visible but not editable. Using the @NonVisual flag or exlude parameter of BeanEdit-Form component wouldn't do this, it would just remove the column from the frontend completely. I had a look at <t:parameter> overrides but it does not seem to support a read-only flag.

Generally I would need something more flexible how to tell whether a parameter is read-only or editable inside the form. For my current problem the read-only vs. editable depends on roles (i.e. different roles have different access rights to edit certain fields).

thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to