[jira] Created: (OFBIZ-1235) Widget Engine integrate with dojo

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

[jira] Created: (OFBIZ-1235) Widget Engine integrate with dojo

Nicolas Malin (Jira)
Widget Engine integrate with dojo
---------------------------------

                 Key: OFBIZ-1235
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
             Project: OFBiz
          Issue Type: New Feature
         Environment: all the platform
            Reporter: jack_guo


This is the AJAX featur for the widget egine, I'd like the widget engine can deal with the dojo like the struts2 integrate with dojo, when you want to use the AJAX function just add " theme='ajax' "  in the form elements. and then the form have the AJAX function like submit it without refresh all page, auto validation the input, make the table pages AJAXed and so on.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1235) Widget Engine integrate with dojo

Nicolas Malin (Jira)

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

Marco Risaliti updated OFBIZ-1235:
----------------------------------

          Component/s: framework
        Fix Version/s: SVN trunk
    Affects Version/s: SVN trunk

> Widget Engine integrate with dojo
> ---------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>
> This is the AJAX featur for the widget egine, I'd like the widget engine can deal with the dojo like the struts2 integrate with dojo, when you want to use the AJAX function just add " theme='ajax' "  in the form elements. and then the form have the AJAX function like submit it without refresh all page, auto validation the input, make the table pages AJAXed and so on.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1235) Widget Engine integrate with dojo

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

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

Jacques Le Roux closed OFBIZ-1235.
----------------------------------

    Resolution: Incomplete
      Assignee: Jacques Le Roux

> Widget Engine integrate with dojo
> ---------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> This is the AJAX featur for the widget egine, I'd like the widget engine can deal with the dojo like the struts2 integrate with dojo, when you want to use the AJAX function just add " theme='ajax' "  in the form elements. and then the form have the AJAX function like submit it without refresh all page, auto validation the input, make the table pages AJAXed and so on.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (OFBIZ-1235) Widget Engine integrate with dojo

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

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

WeizhanGuo reopened OFBIZ-1235:
-------------------------------


change this issue to create the theme for the form widget

> Widget Engine integrate with dojo
> ---------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> This is the AJAX featur for the widget egine, I'd like the widget engine can deal with the dojo like the struts2 integrate with dojo, when you want to use the AJAX function just add " theme='ajax' "  in the form elements. and then the form have the AJAX function like submit it without refresh all page, auto validation the input, make the table pages AJAXed and so on.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo updated OFBIZ-1235:
------------------------------

    Description:
We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
 
And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
 
So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
 
Those ftl files is responsible for the html code generation, like text.ftl:
<input type="text"<#rt/>
 name="${rp.name?default("")?html}"<#rt/>
<#include "class.ftl" />
<#if rp.value?exists>
<#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
</#if>
<#if rp.textSize?exists>
 size="${rp.textSize?html}"<#rt/>
</#if>
<#if rp.maxlength?exists>
 maxlength="${rp.maxlength?html}"<#rt/>
</#if>
<#if rp.textId?exists>
 id="${rp.textId?html}"<#rt/>
</#if>
<#if rp.event?exists && rp.action?exists>
 ${rp.event?html}="${rp.action?html}"<#rt/>
</#if>
<#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
  autocomplete="off"<#rt/>
</#if>
/>
Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
 
Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

  was:
This is the AJAX featur for the widget egine, I'd like the widget engine can deal with the dojo like the struts2 integrate with dojo, when you want to use the AJAX function just add " theme='ajax' "  in the form elements. and then the form have the AJAX function like submit it without refresh all page, auto validation the input, make the table pages AJAXed and so on.


        Summary: Create the theme for the form widget  (was: Widget Engine integrate with dojo)

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (OFBIZ-1235) Create the theme for the form widget

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

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

jack_guo edited comment on OFBIZ-1235 at 3/5/09 7:40 PM:
-----------------------------------------------------------

change this issue to create the theme for the form widget, I think they are the same issue

      was (Author: jack_guo):
    change this issue to create the theme for the form widget
 

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

Now, we have created the 19 files of macro for the 19 fied and can work. But there are some problems we need to discuss.

First, not all the applications want use the same theme; each application can set the default theme type, but where to add this type? Now we try to add this in webapp, like this:
 <webapp name="example"
        title="Example"
        menu-name="secondary"
        theme="dojo"
        server="default-server"
        location="webapp/example"
        base-permission="OFBTOOLS,EXAMPLE"
        mount-point="/example"/>

Second, each theme have they own css and js, how to avoid the css conflict with the system.

Any advise are welcome, thank you!


> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

David E. Jones commented on OFBIZ-1235:
---------------------------------------

You might want to wait until Jacopo posts his code related to this. He has solved the problems already (his early efforts were to establish the pattern), so it should be really helpful.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1235) Create the theme for the form widget

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

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

Jacques Le Roux reassigned OFBIZ-1235:
--------------------------------------

    Assignee:     (was: Jacques Le Roux)

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

ok, waiting for Jacopo...

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1235) Create the theme for the form widget

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

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

Jacopo Cappellato updated OFBIZ-1235:
-------------------------------------

    Attachment: ftlMacroRenderer.patch

Here is my work in progress. Feel free to work on it, ask questions etc...

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

Wowo! Greate job. It's smart way to use the handler to implement this. I will add my macro later according to your way.

Thank you!

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

Jacopo Cappellato commented on OFBIZ-1235:
------------------------------------------

Hi Guo,

just to be sure I understand your plans (I don't want to duplicate efforts): are you completing the macros in htmlScreenMacroLibrary.ftl and htmlFormMacroLibrary.ftl? If the answer is "yes", this would be great... also keep in mind that we will also have to complete the work in the classes MacroScreenViewHandler.java and MacroScreenRenderer.java (the code that calls the macros).

PS: what if I try to commit part of this patch so that we can work in the trunk? Of course the code will not be used until it is completed and working properly.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

The answer is yes.
I'm completing the ftl macro and also try to complete those two java files. Are you still doing this?

It would be great if you commit the patch to the trunk, but I'm not the committer and have not commit permission. Anyway, it's still a good thing, and I can get the latest version that you changed and continue to submit the patch.

Here is one question, do we separate the Ajax function from the htmlFormMacroLibrary.ftl and create ajaxFormMacroLibrary.ftl or just mix them in the htmlScreenMacroLibrary.ftl?  And I like to separate them.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

Jacopo Cappellato commented on OFBIZ-1235:
------------------------------------------

Ok,

I have committed the work with rev. 756369
This is exactly the patch attached to this task, except for the changes to the common-controller.xml that I have not committed to leave everything disabled for now.

Guo, please feel free to send me often you patches, I will be more than happy to review and commit them... don't wait to complete all the work before sending it... it will be easier for everyone to work in little steps.

As regards your question about keeping ajax macros separated from html ones... I don't know... I think that we should have one macro library for html (where Ajax calls are disabled if the browser doesn't support Javascript) but maybe, at least initially, keeping them separate will be easier... what other think about this?

Jacopo



> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo updated OFBIZ-1235:
------------------------------

    Attachment: widget.patch

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, widget.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

Anil K Patel commented on OFBIZ-1235:
-------------------------------------

Good to see progress on this Jira issue.
I wish of Ofbiz Java code had EL integration like in JBoss Seam, lot of code like following will be simple
+        StringWriter sr = new StringWriter();
+        sr.append("<@renderDisplayField ");
+        sr.append("idName=\"");
+        sr.append(idName);
+        sr.append("\" description=\"");
+        sr.append(description);

as
+        StringWriter sr = new StringWriter();
+        sr.append("<@renderDisplayField ";
+        sr.append("idName=#{idName} description= #{description}");

Nice little thing.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, widget.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

That's nice, I will update the code later.
Thanks.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, widget.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

WeizhanGuo commented on OFBIZ-1235:
-----------------------------------

Hi Anil,

I try to use the EL, but the Macro did not parse correctly. I have not idea how to use EL in this context. Any advise?

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, widget.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1235) Create the theme for the form widget

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

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

Anil K Patel commented on OFBIZ-1235:
-------------------------------------

Oops, I did not write it clear enough.

I wish Ofbiz Java abilities were like JBoss SEAM has. In JBoss Seam you can use EL in Strings. If we had similar abilities in Ofbiz then the code you are writing for this issue will be lot simple.

> Create the theme for the form widget
> ------------------------------------
>
>                 Key: OFBIZ-1235
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1235
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: all the platform
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, widget.patch
>
>
> We are creating the "theme" for the ofbiz widget form, why we create this? We found it's very difficultty to extend the current form widget, all the widget generation code is hard code in HtmlFormRenderer or others, we need to change those file if we want to add some function to the form, like ajax.
>  
> And yes, we have some ajax function in ofbiz now, but the code of HtmlFormRenderer with ajax is much harder for understanding. like the code: "if(ajaxEnabled)". In fact , we want to implement the dojo function in ofbiz without mess.
>  
> So we decide to extract the hard code is responsible for the html form generation  to the ftl files, like the struts2 does. If you know well about struts2, then you will also know the form theme we are creating.
>  
> Those ftl files is responsible for the html code generation, like text.ftl:
> <input type="text"<#rt/>
>  name="${rp.name?default("")?html}"<#rt/>
> <#include "class.ftl" />
> <#if rp.value?exists>
> <#escape x as x?html> value="${rp.value}" </#escape> <#rt/>
> </#if>
> <#if rp.textSize?exists>
>  size="${rp.textSize?html}"<#rt/>
> </#if>
> <#if rp.maxlength?exists>
>  maxlength="${rp.maxlength?html}"<#rt/>
> </#if>
> <#if rp.textId?exists>
>  id="${rp.textId?html}"<#rt/>
> </#if>
> <#if rp.event?exists && rp.action?exists>
>  ${rp.event?html}="${rp.action?html}"<#rt/>
> </#if>
> <#if rp.clientAutocomplete?exists && !rp.clientAutocomplete>
>   autocomplete="off"<#rt/>
> </#if>
> />
> Then, in the renderTextField method, we use the ftl file to generate the html text instand of the hard code.
>  
> Finally,we can have different themes like simple/text.ftl  ajax/text.ftl  and dojo/text.ftl. By setting the theme with code "theme=simple/ajax/dojo " , the corresponding theme file like text.ftl will be loaded. The attachment is the dojo theme capture.

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

12