Hi Igor,

Igor Marakov wrote:
There seems to be a problem while trying to use automatically generated subview id in myfaces1.1.1

According to TLD file ID attribute is created automatically when omitted. At the same time ID attribute is defined as

<required>true</required>

This causes compile time error when id is omitted on the <f:subview> tag.

Here is the situation:

   1. If I hardwire subview id on the inner subview – only the last row
      component shows up on the screen
   2. If I put EL expression into the id – it does not get interpreted
      and I get error saying that ID must not start with #
   3. If I put JSP expression into the id – like
      id=”row<=%String.valueOf(section_num)%> it does not get
      interpreted either resulting in the same error as #2
   4. If I don’t use ID attribute – I get compile time error.
   5. If I “doctor” tld file changing ID attribute description from
      <required>true</required> to <required>false</required> -
      everything works beautifully and ID does get generated properly.

Am I missing something here or does TLD file need to be corrected?


The TLD is correct: the JSF spec declares the "id" attribute of the f:subview component to be mandatory. As far as I know, id is optional for all other components.

No component allows EL expressions for ids; if specified it *must* be a literal string. JSF components need to have the same id over their lifetimes; dynamic ids are a really bad idea for several reasons.

JSP expressions don't get evaluated in JSF tag attributes. This might change in JSF 1.2, but even then I suspect it will be forbidden within the "id" attribute.

So you'll need to look more deeply into why your option (1) doesn't work. That should be the correct approach.

Regards,

Simon

Reply via email to