
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Linux, Windows
|
|
|
The following illustrates a use case for 2 pass symbol replacement.
Client.html
<span id="id1" jsfid="clay" clayJsfid="Template.html" name="#{person.name}" email="#{person.address.email"} />
Template.html
<body>
Name: <span id="id2" jsfid="tree" value="@name"/>
Email: <span id="id3" jsfid="tree" value="@email"/>
</body>
Custom component
<component jsfid="tree" extends="panelGroup">
<element renderId="1" jsfid="outputText">
<attributes>
<set name="value" value="@value"/>
</attributes>
</element>
<validator jsfid="lengthValidator">
...
</validator>
</component>
Currently the nested attribute [value] inside of the 1st child of tree does not realize symbol replacement because the symbol
@value actually points to another symbol, either @name or @email depending on the context.
With 2-pass symbol replacement this attribute would ultimately get the value #{person.name} or #{person.address.email}
Span (id1) - > clay
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} }
Span (id2) -> tree
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}
tree Child 1
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}
Such that EvalSymbol(@value) -> EvalSymbol(@name) -> #{person.name} , instead of @name
|
|
Description
|
The following illustrates a use case for 2 pass symbol replacement.
Client.html
<span id="id1" jsfid="clay" clayJsfid="Template.html" name="#{person.name}" email="#{person.address.email"} />
Template.html
<body>
Name: <span id="id2" jsfid="tree" value="@name"/>
Email: <span id="id3" jsfid="tree" value="@email"/>
</body>
Custom component
<component jsfid="tree" extends="panelGroup">
<element renderId="1" jsfid="outputText">
<attributes>
<set name="value" value="@value"/>
</attributes>
</element>
<validator jsfid="lengthValidator">
...
</validator>
</component>
Currently the nested attribute [value] inside of the 1st child of tree does not realize symbol replacement because the symbol
@value actually points to another symbol, either @name or @email depending on the context.
With 2-pass symbol replacement this attribute would ultimately get the value #{person.name} or #{person.address.email}
Span (id1) - > clay
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} }
Span (id2) -> tree
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}
tree Child 1
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}
Such that EvalSymbol(@value) -> EvalSymbol(@name) -> #{person.name} , instead of @name
|
Show » |
|