[jira] [Created] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
Chatree Srichart created OFBIZ-4926:
---------------------------------------

             Summary: renderLookupField macro: get a form element by "ID" instead of "Name"
                 Key: OFBIZ-4926
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
    Affects Versions: SVN trunk
         Environment: Ubuntu 10.04
            Reporter: Chatree Srichart
             Fix For: SVN trunk


Hello all,

We have a problem to render a lookup field in a form element without a "name" attribute.
We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.

Regards,
Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chatree Srichart updated OFBIZ-4926:
------------------------------------

    Attachment: lookup.patch
   

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290009#comment-13290009 ]

Jacques Le Roux commented on OFBIZ-4926:
----------------------------------------

Reading your description (did not look at code) it does not make sense to me: there is no id attribute to a form element http://www.w3.org/TR/html401/interact/forms.html#h-17.3
And why would we change that OOTB? There are already a lot of lookups working that way.
               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290724#comment-13290724 ]

Chatree Srichart commented on OFBIZ-4926:
-----------------------------------------

Hello Jacques,

I am sorry to make you confuse. I think I make confusing with my description. Let me correct myself.

What I would like to change the renderLookupField macro is changing the reference to the lookup element:

from: document.${formName}.${fieldName}
to: document.getElementById("${id}") which "id" is an id attribute of the lookup element.

because sometimes I want to render the lookup field without form element.
To change this will not cause a problem with the lookup fields which already used in the system because there always be "id" for the lookup fields.

Regards,
Chatree Srichart
               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290842#comment-13290842 ]

Jacques Le Roux commented on OFBIZ-4926:
----------------------------------------

Hi Chatree,

After reading the patch and your explanation, I have still a concern. The lookup mechanism needs a form name in order to render the description besides the lookup. You removed the check which else shows <<alert("Developer: for lookups to work you must provide a form name!")>>. I think we should still keep it. You could remove it in your custom application if you want. You will just lose the description but this is not a blocked.

Apart that I agree that it should works OOTB and my few tests where positive. So I think I will commit your patch but will keep the form name check OOTB.
               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290849#comment-13290849 ]

Jacopo Cappellato commented on OFBIZ-4926:
------------------------------------------

Jacques,

please do extensive testing if you are planning to commit this; if you do not have time then ask the review/tests from others and wait until the test reports are successful.

Thanks

               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290851#comment-13290851 ]

Chatree Srichart commented on OFBIZ-4926:
-----------------------------------------

Better do not commit the patch yet because it will not help for me if the alert() still show. Let me find another solution. However, if you think it will be useful for the framework that is fine.

Regards,
Chatree Srichart
               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4926) renderLookupField macro: get a form element by "ID" instead of "Name"

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290858#comment-13290858 ]

Jacques Le Roux commented on OFBIZ-4926:
----------------------------------------

Jacopo,

Actually, I'm still reluctant to commit. That's why I did not this morning. After an hour of review and test, I'm convinced that it will continue to work well with this patch, if we keep the form name check OOTB. Chatree could then remove it from his appplications. Reviews and tests are always welcome.

Chatree,

As Japoco outlined, it introduces a risk and for now I prefer to put this aside because it adds not much benefits. In which cases do you need to have a loopud field outside of a form? Can't you then use a dummy form?
               

> renderLookupField macro: get a form element by "ID" instead of "Name"
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-4926
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4926
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Ubuntu 10.04
>            Reporter: Chatree Srichart
>             Fix For: SVN trunk
>
>         Attachments: lookup.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Hello all,
> We have a problem to render a lookup field in a form element without a "name" attribute.
> We need to improve a lookup field because if we render the field without form or different form then the lookup field doesn't work, so we will change the lookup field by not get a from element by a "name" attribute but get by an "id" attribute.
> Regards,
> Chatree Srichart

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira