[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] Assigned: (OFBIZ-1235) Create the theme for the form widget

Nicolas Malin (Jira)

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

Jacopo Cappellato reassigned OFBIZ-1235:
----------------------------------------

    Assignee: Jacopo Cappellato

> 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: Jacopo Cappellato
>             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=12688233#action_12688233 ]

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

Guo,

thanks for your hard work.
I am reviewing your patch and hopefully I will commit your work asap.
Please see the following minor points:
1) there are two patches for framework/widget/templates/htmlFormMacroLibrary.ftl in your file; which one should I use?
2) I have noticed that you have added the request and response objects as input parameters for the MacroFormRenderer class; if I am not wrong they are only needed to render hiperlinks for html; this is ok for now but we should find a better way of handling this because I would like to make the MacroFormRenderer as much  webapp independent as possible.

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
>            Assignee: Jacopo Cappellato
>             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=12688235#action_12688235 ]

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

Jacopo,

I don't know why there are two patches for htmlFormMacroLibrary.ftl, I will resubmit the patch later. Please don't commit until I do this.

I found one problem that the macro can't accept parameters with quotation marks, like:
<@renderLabel text="目录 为 "" []" id="" style="h1" />
It will throw an exception when I test this. Do you have any advice for this problem?

And about the request and response objects, I will try to deal this after I finished most of the macro fucntion.

Guo


> 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: Jacopo Cappellato
>             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=12688237#action_12688237 ]

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

I will try to use the html encode function to encode the parameters with quotation marks. And any advice are welcome.

> 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: Jacopo Cappellato
>             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=12688242#action_12688242 ]

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

Guo,

html encode function is what I was going to suggest... let me know if it will fix the issue.

Thanks again for your great work.

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
>            Assignee: Jacopo Cappellato
>             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=12688248#action_12688248 ]

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

Jacopo,

It works with this function.

Thanks.

Guo

> 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: Jacopo Cappellato
>             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] 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: ftlMacroRenderer.patch

add more macro and update the java code

> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, 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=12689866#action_12689866 ]

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

Guo,

thank you so much for your work; your last patch is in svn with rev. 759086
I know it is still a work in progress, but I think it will be easier for you and me to work incrementally; of course feel free to send more patches as they are ready.
I did a small change: instead of using lowagie HtmlEncoder I have used the StringUtil methods.
Also, please move the MacroFormRenderer class from the screen to the form package: I didn't do this myself to avoid to you headaches because I know that you are still modifying the class.

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
>            Assignee: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, 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] 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: ftlMacroRenderer.patch

The HTML macro can work, I have do some test about this, but haven't test the xml and text macro code.please tell me if there is any problem.


> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, 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=12693696#action_12693696 ]

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

Guo,

thanks so much for your contributions.
I had some issues applying your patch, caused by the class moved from a package to another one.
I have committed the code I could apply in rev. 759871 but there could be some missing changes to that class. Could you please update your local copy and send me a new diff patch?
Or, if it is easier for you, just send me the whole class.

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
>            Assignee: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, 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] 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: src.rar
                ftlMacroRenderer.patch

I updated the code but got "Obstructed update" error, I upload the last patch and src. so you can use them to merge the code.

> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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=12694486#action_12694486 ]

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

I am sorry Guo,

but I have problems applying your last patch; also the src file you sent me doesn't contain the latest (patched) version of your work... see for example the MacroFormRenderer.java file.

I would really appreciate if you could:
1) update your working copy
2) resolve any conflicts you may have
3) send me another patch

In order to resolve the "obstructed update" error I'd suggest you to delete (but save the content) the folder that is causing the error and run an svn up to get fresh copy of it; then copy and paste the content of your modified files (I think it is just MacroFormRenderer.java) over the new ones and send me a new patch.

Does it make sense?

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
>            Assignee: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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] 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: ftlMacroRenderer.patch

this patch should be work.

> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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=12694635#action_12694635 ]

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

Guo,

thanks so much, your patch is in rev. 760976
Tomorrow I will clean a few small things, then I will write an email to the dev list to explain the work that was done, the next steps and how to test it.



> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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=12695722#action_12695722 ]

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

Guo,

is it ok if I close this issue? Are you planning to do more work on this?
There are definitely other things to do to complete the Macro renderers (like implementing the Tree and Menu ones, or converting the FO renderers), but they can be tracked in new ad hoc jira issues.

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
>            Assignee: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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=12695843#action_12695843 ]

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

Jacopo,

You can close it, I will submit a new one issues like what you're said if I try to implementing more macro.

I'm planning to add dojo macro first as the our project need, then I will try to implement tree or others.

Thank you!

Guo


> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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] Closed: (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 closed OFBIZ-1235.
----------------------------------

    Resolution: Fixed

> 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: Jacopo Cappellato
>             Fix For: SVN trunk
>
>         Attachments: ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, ftlMacroRenderer.patch, src.rar, 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