You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Scott Walter (JIRA)" <ta...@jakarta.apache.org> on 2005/07/15 14:33:12 UTC

[jira] Created: (TAPESTRY-403) Bean binding with contrib:tablerows

Bean binding with contrib:tablerows
-----------------------------------

         Key: TAPESTRY-403
         URL: http://issues.apache.org/jira/browse/TAPESTRY-403
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
    Reporter: Scott Walter


I have a contrib:tableRows component that binds the EvenOdd class like this:

    <component id="tableRows" type="contrib:TableRows">
	    <binding name="class" expression="beans.evenOdd.next"/>
        <binding name="row" expression="currentRow"/>
    </component> 

However the evenOdd class was never getting instantiated/processing on each row in the table.

I looked into my .html page and noticed that I had something like this:

<tr jwcid="tableRows" class="odd">

but when I took the class attribute out of my html the evenOdd bean got instantiated and processing.  So it looks like there is an issue of binding a bean to an attribute if it already exists in a .html page.  This page is part of an app I am migrating from 3.0, in which the evenOdd bean processed properly with the class attribute in the .html page.

Is this an issue with contrib:tableRows or bindings in general if you attempt to bind to an html attribute that is already set?

scott

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TAPESTRY-403) Bean binding with contrib:tablerows

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-403?page=all ]

Jesse Kuhnert updated TAPESTRY-403:
-----------------------------------

    Fix Version/s: 4.1.2

> Bean binding with contrib:tablerows
> -----------------------------------
>
>                 Key: TAPESTRY-403
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-403
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>            Reporter: Scott Walter
>             Fix For: 4.1.2
>
>
> I have a contrib:tableRows component that binds the EvenOdd class like this:
>     <component id="tableRows" type="contrib:TableRows">
> 	    <binding name="class" expression="beans.evenOdd.next"/>
>         <binding name="row" expression="currentRow"/>
>     </component> 
> However the evenOdd class was never getting instantiated/processing on each row in the table.
> I looked into my .html page and noticed that I had something like this:
> <tr jwcid="tableRows" class="odd">
> but when I took the class attribute out of my html the evenOdd bean got instantiated and processing.  So it looks like there is an issue of binding a bean to an attribute if it already exists in a .html page.  This page is part of an app I am migrating from 3.0, in which the evenOdd bean processed properly with the class attribute in the .html page.
> Is this an issue with contrib:tableRows or bindings in general if you attempt to bind to an html attribute that is already set?
> scott

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (TAPESTRY-403) Bean binding with contrib:tablerows

Posted by "Kent Tong (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-403?page=comments#action_12316611 ] 

Kent Tong commented on TAPESTRY-403:
------------------------------------

It is a bug with bindings in general. The problem should be in ComponentTemplateLoaderLogic. If a binding is specified in both the template and the specification, the validate() method should return false, but at the moment it is only checking conflicts between informal parameters in the template and formal/reserved parameters, so it is returning true.

public class ComponentTemplateLoaderLogic
{

    private boolean validate(IComponent component, IComponentSpecification spec, String name,
            IBinding binding)
    {
        // TODO: This is ugly! Need a better/smarter way, even if we have to extend BindingSource
        // to tell us.

        boolean literal = binding instanceof LiteralBinding;

        boolean isFormal = (spec.getParameter(name) != null);

        if (isFormal)
        {
            if (component.getBinding(name) != null)
            {
                // Literal bindings in the template that conflict with bound parameters
                // from the spec are silently ignored.

                if (literal)
                    return false;

                throw new ApplicationRuntimeException(ImplMessages.dupeTemplateBinding(
                        name,
                        component,
                        _loadComponent), component, binding.getLocation(), null);
            }

            return true;
        }

        if (!spec.getAllowInformalParameters())
        {
            // Again; if informal parameters are disallowed, ignore literal bindings, as they
            // are there as placeholders or for WYSIWYG.

            if (literal)
                return false;

            throw new ApplicationRuntimeException(ImplMessages.templateBindingForInformalParameter(
                    _loadComponent,
                    name,
                    component), component, binding.getLocation(), null);
        }

        // If the name is reserved (matches a formal parameter
        // or reserved name, caselessly), then skip it.

        if (spec.isReservedParameterName(name))
        {
            // Final case for literals: if they conflict with a reserved name, they are ignored.
            // Again, there for WYSIWYG.

            if (literal)
                return false;

            throw new ApplicationRuntimeException(ImplMessages.templateBindingForReservedParameter(
                    _loadComponent,
                    name,
                    component), component, binding.getLocation(), null);
        }

        return true;
    }
}

> Bean binding with contrib:tablerows
> -----------------------------------
>
>          Key: TAPESTRY-403
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-403
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Scott Walter

>
> I have a contrib:tableRows component that binds the EvenOdd class like this:
>     <component id="tableRows" type="contrib:TableRows">
> 	    <binding name="class" expression="beans.evenOdd.next"/>
>         <binding name="row" expression="currentRow"/>
>     </component> 
> However the evenOdd class was never getting instantiated/processing on each row in the table.
> I looked into my .html page and noticed that I had something like this:
> <tr jwcid="tableRows" class="odd">
> but when I took the class attribute out of my html the evenOdd bean got instantiated and processing.  So it looks like there is an issue of binding a bean to an attribute if it already exists in a .html page.  This page is part of an app I am migrating from 3.0, in which the evenOdd bean processed properly with the class attribute in the .html page.
> Is this an issue with contrib:tableRows or bindings in general if you attempt to bind to an html attribute that is already set?
> scott

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (TAPESTRY-403) Bean binding with contrib:tablerows

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert resolved TAPESTRY-403.
------------------------------------

    Resolution: Invalid
      Assignee: Jesse Kuhnert

I think this behavior is actually correct. That component probably has inherit-informal-parameters set to true, which is what you've done. Not allowing the informal parameter to be set would be an even bigger issue. I see no other way to  do this.

> Bean binding with contrib:tablerows
> -----------------------------------
>
>                 Key: TAPESTRY-403
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-403
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>            Reporter: Scott Walter
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.2
>
>
> I have a contrib:tableRows component that binds the EvenOdd class like this:
>     <component id="tableRows" type="contrib:TableRows">
> 	    <binding name="class" expression="beans.evenOdd.next"/>
>         <binding name="row" expression="currentRow"/>
>     </component> 
> However the evenOdd class was never getting instantiated/processing on each row in the table.
> I looked into my .html page and noticed that I had something like this:
> <tr jwcid="tableRows" class="odd">
> but when I took the class attribute out of my html the evenOdd bean got instantiated and processing.  So it looks like there is an issue of binding a bean to an attribute if it already exists in a .html page.  This page is part of an app I am migrating from 3.0, in which the evenOdd bean processed properly with the class attribute in the .html page.
> Is this an issue with contrib:tableRows or bindings in general if you attempt to bind to an html attribute that is already set?
> scott

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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