Help with widgets please

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

Help with widgets please

Adrian Crum
In our local OFBiz deployment I have favored using ftl files instead of widgets
for HTML layout. I find it easier, it takes less code, and I don't have to learn
a new language.

But now I'm trying to refactor the party manager application UI as a "test bed"
for the UI refactoring effort. Much of the party manager UI is handled by
widgets, so I'm constrained to work with them. My efforts to get them to do
simple tasks have been unsuccessful and I am becoming increasingly frustrated.

To boil it down, I need a simple way to sprinkle a little HTML inside a widget
XML file. Ideally, I'd like to be able to do something like:

<widget>
   <html>
     <div>Hello world!</div>
     <ul>
       <li>Choice One</li>
       <li>Choice Two</li>
     </ul>
   </html>
</widget>

Is there a way I can do that in the screen widgets?

-Adrian
Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

cjhowe
You can, but it involves using the widgets in ways that I don't think is intended (using the label element with &lt; and &gt; and sometimes &quot; in the text attribute). CDATA might be an option as well, although I forget if that tag accepts element values in addition to element attributes.  I think ordered lists are handled much cleaner as ftl.  Do you have a particular screen you're concerned about?

----- Original Message ----
From: Adrian Crum <[hidden email]>
To: [hidden email]
Sent: Wednesday, February 7, 2007 10:49:17 AM
Subject: Help with widgets please

In our local OFBiz deployment I have favored using ftl files instead of widgets
for HTML layout. I find it easier, it takes less code, and I don't have to learn
a new language.

But now I'm trying to refactor the party manager application UI as a "test bed"
for the UI refactoring effort. Much of the party manager UI is handled by
widgets, so I'm constrained to work with them. My efforts to get them to do
simple tasks have been unsuccessful and I am becoming increasingly frustrated.

To boil it down, I need a simple way to sprinkle a little HTML inside a widget
XML file. Ideally, I'd like to be able to do something like:

<widget>
   <html>
     <div>Hello world!</div>
     <ul>
       <li>Choice One</li>
       <li>Choice Two</li>
     </ul>
   </html>
</widget>

Is there a way I can do that in the screen widgets?

-Adrian



Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Scott Gray
I'm not sure how well it works, but isn't this what a Menu widget with
alignment set to vertical is for?

Regards
Scott

Chris Howe wrote:

> You can, but it involves using the widgets in ways that I don't think is intended (using the label element with &lt; and &gt; and sometimes &quot; in the text attribute). CDATA might be an option as well, although I forget if that tag accepts element values in addition to element attributes.  I think ordered lists are handled much cleaner as ftl.  Do you have a particular screen you're concerned about?
>
> ----- Original Message ----
> From: Adrian Crum <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, February 7, 2007 10:49:17 AM
> Subject: Help with widgets please
>
> In our local OFBiz deployment I have favored using ftl files instead of widgets
> for HTML layout. I find it easier, it takes less code, and I don't have to learn
> a new language.
>
> But now I'm trying to refactor the party manager application UI as a "test bed"
> for the UI refactoring effort. Much of the party manager UI is handled by
> widgets, so I'm constrained to work with them. My efforts to get them to do
> simple tasks have been unsuccessful and I am becoming increasingly frustrated.
>
> To boil it down, I need a simple way to sprinkle a little HTML inside a widget
> XML file. Ideally, I'd like to be able to do something like:
>
> <widget>
>    <html>
>      <div>Hello world!</div>
>      <ul>
>        <li>Choice One</li>
>        <li>Choice Two</li>
>      </ul>
>    </html>
> </widget>
>
> Is there a way I can do that in the screen widgets?
>
> -Adrian
>
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Adrian Crum
In reply to this post by cjhowe
The createParty screen was the one I was working on last night
(https://127.0.0.1:8443/partymgr/control/createnew). It's about a page of widget
code. I can do the same thing with just a few lines of HTML (or freemarker)
code, but that would mean creating a separate ftl file for that screen. I went
ahead and created the ftl file just to try out an idea and the results worked
well. So then I went back to the widget to get it to do the same thing and
that's where I got stuck.

I was hoping to clean up the overlapping links by converting them to a list.


Chris Howe wrote:

> You can, but it involves using the widgets in ways that I don't think is intended (using the label element with &lt; and &gt; and sometimes &quot; in the text attribute). CDATA might be an option as well, although I forget if that tag accepts element values in addition to element attributes.  I think ordered lists are handled much cleaner as ftl.  Do you have a particular screen you're concerned about?
>
> ----- Original Message ----
> From: Adrian Crum <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, February 7, 2007 10:49:17 AM
> Subject: Help with widgets please
>
> In our local OFBiz deployment I have favored using ftl files instead of widgets
> for HTML layout. I find it easier, it takes less code, and I don't have to learn
> a new language.
>
> But now I'm trying to refactor the party manager application UI as a "test bed"
> for the UI refactoring effort. Much of the party manager UI is handled by
> widgets, so I'm constrained to work with them. My efforts to get them to do
> simple tasks have been unsuccessful and I am becoming increasingly frustrated.
>
> To boil it down, I need a simple way to sprinkle a little HTML inside a widget
> XML file. Ideally, I'd like to be able to do something like:
>
> <widget>
>    <html>
>      <div>Hello world!</div>
>      <ul>
>        <li>Choice One</li>
>        <li>Choice Two</li>
>      </ul>
>    </html>
> </widget>
>
> Is there a way I can do that in the screen widgets?
>
> -Adrian
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

cjhowe
In reply to this post by Adrian Crum
Scott's right, the menu widget would be more appropriate for that

----- Original Message ----
From: Adrian Crum <[hidden email]>
To: [hidden email]
Sent: Wednesday, February 7, 2007 11:53:50 AM
Subject: Re: Help with widgets please

The createParty screen was the one I was working on last night
(https://127.0.0.1:8443/partymgr/control/createnew). It's about a page of widget
code. I can do the same thing with just a few lines of HTML (or freemarker)
code, but that would mean creating a separate ftl file for that screen. I went
ahead and created the ftl file just to try out an idea and the results worked
well. So then I went back to the widget to get it to do the same thing and
that's where I got stuck.

I was hoping to clean up the overlapping links by converting them to a list.


Chris Howe wrote:

> You can, but it involves using the widgets in ways that I don't think is intended (using the label element with &lt; and &gt; and sometimes &quot; in the text attribute). CDATA might be an option as well, although I forget if that tag accepts element values in addition to element attributes.  I think ordered lists are handled much cleaner as ftl.  Do you have a particular screen you're concerned about?
>
> ----- Original Message ----
> From: Adrian Crum <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, February 7, 2007 10:49:17 AM
> Subject: Help with widgets please
>
> In our local OFBiz deployment I have favored using ftl files instead of widgets
> for HTML layout. I find it easier, it takes less code, and I don't have to learn
> a new language.
>
> But now I'm trying to refactor the party manager application UI as a "test bed"
> for the UI refactoring effort. Much of the party manager UI is handled by
> widgets, so I'm constrained to work with them. My efforts to get them to do
> simple tasks have been unsuccessful and I am becoming increasingly frustrated.
>
> To boil it down, I need a simple way to sprinkle a little HTML inside a widget
> XML file. Ideally, I'd like to be able to do something like:
>
> <widget>
>    <html>
>      <div>Hello world!</div>
>      <ul>
>        <li>Choice One</li>
>        <li>Choice Two</li>
>      </ul>
>    </html>
> </widget>
>
> Is there a way I can do that in the screen widgets?
>
> -Adrian
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Adrian Crum
Okay, so a menu widget solves that simple example construct. Later, in another
screen widget, I want to insert 6 more lines of HTML that a menu widget won't
solve. What do I do then?

It seems there is no easy solution. I'll just sleep on it for a few days.

Maybe someone who has worked on widget code can come up with an enhancement to
the widgets that will accomodate HTML "snippets."


Chris Howe wrote:

> Scott's right, the menu widget would be more appropriate for that
>
> ----- Original Message ----
> From: Adrian Crum <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, February 7, 2007 11:53:50 AM
> Subject: Re: Help with widgets please
>
> The createParty screen was the one I was working on last night
> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a page of widget
> code. I can do the same thing with just a few lines of HTML (or freemarker)
> code, but that would mean creating a separate ftl file for that screen. I went
> ahead and created the ftl file just to try out an idea and the results worked
> well. So then I went back to the widget to get it to do the same thing and
> that's where I got stuck.
>
> I was hoping to clean up the overlapping links by converting them to a list.
>
>
> Chris Howe wrote:
>
>
>>You can, but it involves using the widgets in ways that I don't think is intended (using the label element with &lt; and &gt; and sometimes &quot; in the text attribute). CDATA might be an option as well, although I forget if that tag accepts element values in addition to element attributes.  I think ordered lists are handled much cleaner as ftl.  Do you have a particular screen you're concerned about?
>>
>>----- Original Message ----
>>From: Adrian Crum <[hidden email]>
>>To: [hidden email]
>>Sent: Wednesday, February 7, 2007 10:49:17 AM
>>Subject: Help with widgets please
>>
>>In our local OFBiz deployment I have favored using ftl files instead of widgets
>>for HTML layout. I find it easier, it takes less code, and I don't have to learn
>>a new language.
>>
>>But now I'm trying to refactor the party manager application UI as a "test bed"
>>for the UI refactoring effort. Much of the party manager UI is handled by
>>widgets, so I'm constrained to work with them. My efforts to get them to do
>>simple tasks have been unsuccessful and I am becoming increasingly frustrated.
>>
>>To boil it down, I need a simple way to sprinkle a little HTML inside a widget
>>XML file. Ideally, I'd like to be able to do something like:
>>
>><widget>
>>   <html>
>>     <div>Hello world!</div>
>>     <ul>
>>       <li>Choice One</li>
>>       <li>Choice Two</li>
>>     </ul>
>>   </html>
>></widget>
>>
>>Is there a way I can do that in the screen widgets?
>>
>>-Adrian
>>
>>
>>
>>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Jacopo Cappellato
Why don't you simply import a small ftl template?

Jacopo

Adrian Crum wrote:

> Okay, so a menu widget solves that simple example construct. Later, in
> another screen widget, I want to insert 6 more lines of HTML that a menu
> widget won't solve. What do I do then?
>
> It seems there is no easy solution. I'll just sleep on it for a few days.
>
> Maybe someone who has worked on widget code can come up with an
> enhancement to the widgets that will accomodate HTML "snippets."
>
>
> Chris Howe wrote:
>
>> Scott's right, the menu widget would be more appropriate for that
>>
>> ----- Original Message ----
>> From: Adrian Crum <[hidden email]>
>> To: [hidden email]
>> Sent: Wednesday, February 7, 2007 11:53:50 AM
>> Subject: Re: Help with widgets please
>>
>> The createParty screen was the one I was working on last night
>> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a page
>> of widget code. I can do the same thing with just a few lines of HTML
>> (or freemarker) code, but that would mean creating a separate ftl file
>> for that screen. I went ahead and created the ftl file just to try out
>> an idea and the results worked well. So then I went back to the widget
>> to get it to do the same thing and that's where I got stuck.
>>
>> I was hoping to clean up the overlapping links by converting them to a
>> list.
>>
>>
>> Chris Howe wrote:
>>
>>
>>> You can, but it involves using the widgets in ways that I don't think
>>> is intended (using the label element with &lt; and &gt; and sometimes
>>> &quot; in the text attribute). CDATA might be an option as well,
>>> although I forget if that tag accepts element values in addition to
>>> element attributes.  I think ordered lists are handled much cleaner
>>> as ftl.  Do you have a particular screen you're concerned about?
>>>
>>> ----- Original Message ----
>>> From: Adrian Crum <[hidden email]>
>>> To: [hidden email]
>>> Sent: Wednesday, February 7, 2007 10:49:17 AM
>>> Subject: Help with widgets please
>>>
>>> In our local OFBiz deployment I have favored using ftl files instead
>>> of widgets for HTML layout. I find it easier, it takes less code, and
>>> I don't have to learn a new language.
>>>
>>> But now I'm trying to refactor the party manager application UI as a
>>> "test bed" for the UI refactoring effort. Much of the party manager
>>> UI is handled by widgets, so I'm constrained to work with them. My
>>> efforts to get them to do simple tasks have been unsuccessful and I
>>> am becoming increasingly frustrated.
>>>
>>> To boil it down, I need a simple way to sprinkle a little HTML inside
>>> a widget XML file. Ideally, I'd like to be able to do something like:
>>>
>>> <widget>
>>>   <html>
>>>     <div>Hello world!</div>
>>>     <ul>
>>>       <li>Choice One</li>
>>>       <li>Choice Two</li>
>>>     </ul>
>>>   </html>
>>> </widget>
>>>
>>> Is there a way I can do that in the screen widgets?
>>>
>>> -Adrian
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>


Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Adrian Crum
Jacopo,

That's what I did at first and that worked great. As I said, that's my preferred
way of doing things. But here's the problem...

The work I'm doing I hope to contribute back to the project. So I'm sure the
question will be raised, "Why did you convert some of the widgets into ftl
templates? Don't you understand we're trying to move the project toward
widgets?" A big discussion starts about what's the best way to code - widgets
versus templates. In the meantime, the work I did just sits there and never gets
committed.

As David pointed out recently, it's easier to get small, incremental changes
into the project instead of large ones.

So, I'm trying to clean up the Party Manager's markup without making drastic
changes to it.


Jacopo Cappellato wrote:

> Why don't you simply import a small ftl template?
>
> Jacopo
>
> Adrian Crum wrote:
>
>> Okay, so a menu widget solves that simple example construct. Later, in
>> another screen widget, I want to insert 6 more lines of HTML that a
>> menu widget won't solve. What do I do then?
>>
>> It seems there is no easy solution. I'll just sleep on it for a few days.
>>
>> Maybe someone who has worked on widget code can come up with an
>> enhancement to the widgets that will accomodate HTML "snippets."
>>
>>
>> Chris Howe wrote:
>>
>>> Scott's right, the menu widget would be more appropriate for that
>>>
>>> ----- Original Message ----
>>> From: Adrian Crum <[hidden email]>
>>> To: [hidden email]
>>> Sent: Wednesday, February 7, 2007 11:53:50 AM
>>> Subject: Re: Help with widgets please
>>>
>>> The createParty screen was the one I was working on last night
>>> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a
>>> page of widget code. I can do the same thing with just a few lines of
>>> HTML (or freemarker) code, but that would mean creating a separate
>>> ftl file for that screen. I went ahead and created the ftl file just
>>> to try out an idea and the results worked well. So then I went back
>>> to the widget to get it to do the same thing and that's where I got
>>> stuck.
>>>
>>> I was hoping to clean up the overlapping links by converting them to
>>> a list.
>>>
>>>
>>> Chris Howe wrote:
>>>
>>>
>>>> You can, but it involves using the widgets in ways that I don't
>>>> think is intended (using the label element with &lt; and &gt; and
>>>> sometimes &quot; in the text attribute). CDATA might be an option as
>>>> well, although I forget if that tag accepts element values in
>>>> addition to element attributes.  I think ordered lists are handled
>>>> much cleaner as ftl.  Do you have a particular screen you're
>>>> concerned about?
>>>>
>>>> ----- Original Message ----
>>>> From: Adrian Crum <[hidden email]>
>>>> To: [hidden email]
>>>> Sent: Wednesday, February 7, 2007 10:49:17 AM
>>>> Subject: Help with widgets please
>>>>
>>>> In our local OFBiz deployment I have favored using ftl files instead
>>>> of widgets for HTML layout. I find it easier, it takes less code,
>>>> and I don't have to learn a new language.
>>>>
>>>> But now I'm trying to refactor the party manager application UI as a
>>>> "test bed" for the UI refactoring effort. Much of the party manager
>>>> UI is handled by widgets, so I'm constrained to work with them. My
>>>> efforts to get them to do simple tasks have been unsuccessful and I
>>>> am becoming increasingly frustrated.
>>>>
>>>> To boil it down, I need a simple way to sprinkle a little HTML
>>>> inside a widget XML file. Ideally, I'd like to be able to do
>>>> something like:
>>>>
>>>> <widget>
>>>>   <html>
>>>>     <div>Hello world!</div>
>>>>     <ul>
>>>>       <li>Choice One</li>
>>>>       <li>Choice Two</li>
>>>>     </ul>
>>>>   </html>
>>>> </widget>
>>>>
>>>> Is there a way I can do that in the screen widgets?
>>>>
>>>> -Adrian
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Jacopo Cappellato
Adrian,

maybe the best solution is to compose the page with menu/form widgets
were possible, and small ftl templates were needed.

Jacopo

Adrian Crum wrote:

> Jacopo,
>
> That's what I did at first and that worked great. As I said, that's my
> preferred way of doing things. But here's the problem...
>
> The work I'm doing I hope to contribute back to the project. So I'm sure
> the question will be raised, "Why did you convert some of the widgets
> into ftl templates? Don't you understand we're trying to move the
> project toward widgets?" A big discussion starts about what's the best
> way to code - widgets versus templates. In the meantime, the work I did
> just sits there and never gets committed.
>
> As David pointed out recently, it's easier to get small, incremental
> changes into the project instead of large ones.
>
> So, I'm trying to clean up the Party Manager's markup without making
> drastic changes to it.
>
>
> Jacopo Cappellato wrote:
>
>> Why don't you simply import a small ftl template?
>>
>> Jacopo
>>
>> Adrian Crum wrote:
>>
>>> Okay, so a menu widget solves that simple example construct. Later,
>>> in another screen widget, I want to insert 6 more lines of HTML that
>>> a menu widget won't solve. What do I do then?
>>>
>>> It seems there is no easy solution. I'll just sleep on it for a few
>>> days.
>>>
>>> Maybe someone who has worked on widget code can come up with an
>>> enhancement to the widgets that will accomodate HTML "snippets."
>>>
>>>
>>> Chris Howe wrote:
>>>
>>>> Scott's right, the menu widget would be more appropriate for that
>>>>
>>>> ----- Original Message ----
>>>> From: Adrian Crum <[hidden email]>
>>>> To: [hidden email]
>>>> Sent: Wednesday, February 7, 2007 11:53:50 AM
>>>> Subject: Re: Help with widgets please
>>>>
>>>> The createParty screen was the one I was working on last night
>>>> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a
>>>> page of widget code. I can do the same thing with just a few lines
>>>> of HTML (or freemarker) code, but that would mean creating a
>>>> separate ftl file for that screen. I went ahead and created the ftl
>>>> file just to try out an idea and the results worked well. So then I
>>>> went back to the widget to get it to do the same thing and that's
>>>> where I got stuck.
>>>>
>>>> I was hoping to clean up the overlapping links by converting them to
>>>> a list.
>>>>
>>>>
>>>> Chris Howe wrote:
>>>>
>>>>
>>>>> You can, but it involves using the widgets in ways that I don't
>>>>> think is intended (using the label element with &lt; and &gt; and
>>>>> sometimes &quot; in the text attribute). CDATA might be an option
>>>>> as well, although I forget if that tag accepts element values in
>>>>> addition to element attributes.  I think ordered lists are handled
>>>>> much cleaner as ftl.  Do you have a particular screen you're
>>>>> concerned about?
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Adrian Crum <[hidden email]>
>>>>> To: [hidden email]
>>>>> Sent: Wednesday, February 7, 2007 10:49:17 AM
>>>>> Subject: Help with widgets please
>>>>>
>>>>> In our local OFBiz deployment I have favored using ftl files
>>>>> instead of widgets for HTML layout. I find it easier, it takes less
>>>>> code, and I don't have to learn a new language.
>>>>>
>>>>> But now I'm trying to refactor the party manager application UI as
>>>>> a "test bed" for the UI refactoring effort. Much of the party
>>>>> manager UI is handled by widgets, so I'm constrained to work with
>>>>> them. My efforts to get them to do simple tasks have been
>>>>> unsuccessful and I am becoming increasingly frustrated.
>>>>>
>>>>> To boil it down, I need a simple way to sprinkle a little HTML
>>>>> inside a widget XML file. Ideally, I'd like to be able to do
>>>>> something like:
>>>>>
>>>>> <widget>
>>>>>   <html>
>>>>>     <div>Hello world!</div>
>>>>>     <ul>
>>>>>       <li>Choice One</li>
>>>>>       <li>Choice Two</li>
>>>>>     </ul>
>>>>>   </html>
>>>>> </widget>
>>>>>
>>>>> Is there a way I can do that in the screen widgets?
>>>>>
>>>>> -Adrian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>


Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

Adrian Crum
That is probably the conclusion I will settle on. Thank you very much for your
advice!

Jacopo Cappellato wrote:

> Adrian,
>
> maybe the best solution is to compose the page with menu/form widgets
> were possible, and small ftl templates were needed.
>
> Jacopo
>
> Adrian Crum wrote:
>
>> Jacopo,
>>
>> That's what I did at first and that worked great. As I said, that's my
>> preferred way of doing things. But here's the problem...
>>
>> The work I'm doing I hope to contribute back to the project. So I'm
>> sure the question will be raised, "Why did you convert some of the
>> widgets into ftl templates? Don't you understand we're trying to move
>> the project toward widgets?" A big discussion starts about what's the
>> best way to code - widgets versus templates. In the meantime, the work
>> I did just sits there and never gets committed.
>>
>> As David pointed out recently, it's easier to get small, incremental
>> changes into the project instead of large ones.
>>
>> So, I'm trying to clean up the Party Manager's markup without making
>> drastic changes to it.
>>
>>
>> Jacopo Cappellato wrote:
>>
>>> Why don't you simply import a small ftl template?
>>>
>>> Jacopo
>>>
>>> Adrian Crum wrote:
>>>
>>>> Okay, so a menu widget solves that simple example construct. Later,
>>>> in another screen widget, I want to insert 6 more lines of HTML that
>>>> a menu widget won't solve. What do I do then?
>>>>
>>>> It seems there is no easy solution. I'll just sleep on it for a few
>>>> days.
>>>>
>>>> Maybe someone who has worked on widget code can come up with an
>>>> enhancement to the widgets that will accomodate HTML "snippets."
>>>>
>>>>
>>>> Chris Howe wrote:
>>>>
>>>>> Scott's right, the menu widget would be more appropriate for that
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Adrian Crum <[hidden email]>
>>>>> To: [hidden email]
>>>>> Sent: Wednesday, February 7, 2007 11:53:50 AM
>>>>> Subject: Re: Help with widgets please
>>>>>
>>>>> The createParty screen was the one I was working on last night
>>>>> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a
>>>>> page of widget code. I can do the same thing with just a few lines
>>>>> of HTML (or freemarker) code, but that would mean creating a
>>>>> separate ftl file for that screen. I went ahead and created the ftl
>>>>> file just to try out an idea and the results worked well. So then I
>>>>> went back to the widget to get it to do the same thing and that's
>>>>> where I got stuck.
>>>>>
>>>>> I was hoping to clean up the overlapping links by converting them
>>>>> to a list.
>>>>>
>>>>>
>>>>> Chris Howe wrote:
>>>>>
>>>>>
>>>>>> You can, but it involves using the widgets in ways that I don't
>>>>>> think is intended (using the label element with &lt; and &gt; and
>>>>>> sometimes &quot; in the text attribute). CDATA might be an option
>>>>>> as well, although I forget if that tag accepts element values in
>>>>>> addition to element attributes.  I think ordered lists are handled
>>>>>> much cleaner as ftl.  Do you have a particular screen you're
>>>>>> concerned about?
>>>>>>
>>>>>> ----- Original Message ----
>>>>>> From: Adrian Crum <[hidden email]>
>>>>>> To: [hidden email]
>>>>>> Sent: Wednesday, February 7, 2007 10:49:17 AM
>>>>>> Subject: Help with widgets please
>>>>>>
>>>>>> In our local OFBiz deployment I have favored using ftl files
>>>>>> instead of widgets for HTML layout. I find it easier, it takes
>>>>>> less code, and I don't have to learn a new language.
>>>>>>
>>>>>> But now I'm trying to refactor the party manager application UI as
>>>>>> a "test bed" for the UI refactoring effort. Much of the party
>>>>>> manager UI is handled by widgets, so I'm constrained to work with
>>>>>> them. My efforts to get them to do simple tasks have been
>>>>>> unsuccessful and I am becoming increasingly frustrated.
>>>>>>
>>>>>> To boil it down, I need a simple way to sprinkle a little HTML
>>>>>> inside a widget XML file. Ideally, I'd like to be able to do
>>>>>> something like:
>>>>>>
>>>>>> <widget>
>>>>>>   <html>
>>>>>>     <div>Hello world!</div>
>>>>>>     <ul>
>>>>>>       <li>Choice One</li>
>>>>>>       <li>Choice Two</li>
>>>>>>     </ul>
>>>>>>   </html>
>>>>>> </widget>
>>>>>>
>>>>>> Is there a way I can do that in the screen widgets?
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with widgets please

jonwimp
In reply to this post by Adrian Crum
Adrian,

 > As David pointed out recently, it's easier to get small, incremental
 > changes into the project instead of large ones.

David's right. It's easier to audit a small change than a big change to make sure the change
doesn't break existing codes.

I'd say we do as much as we can with FTL files (for your UI refactoring), leave those parts that
don't integrate well with widgets, and commit your changes such that there is "net improvement"
(existing codes not broken).

Over time, we'll look your consistent UI constructs in your FTL files, quickly spot any oft-used
patterns (you're best candidate for this), then enhance the widget engine accordingly and
effectively. Better not spend time enhancing the widget engine without a clearly justified cause
for doing so.

For now, I'd suggest you bring in the UI improvements.

Jonathon

Adrian Crum wrote:

> Jacopo,
>
> That's what I did at first and that worked great. As I said, that's my
> preferred way of doing things. But here's the problem...
>
> The work I'm doing I hope to contribute back to the project. So I'm sure
> the question will be raised, "Why did you convert some of the widgets
> into ftl templates? Don't you understand we're trying to move the
> project toward widgets?" A big discussion starts about what's the best
> way to code - widgets versus templates. In the meantime, the work I did
> just sits there and never gets committed.
>
> As David pointed out recently, it's easier to get small, incremental
> changes into the project instead of large ones.
>
> So, I'm trying to clean up the Party Manager's markup without making
> drastic changes to it.
>
>
> Jacopo Cappellato wrote:
>
>> Why don't you simply import a small ftl template?
>>
>> Jacopo
>>
>> Adrian Crum wrote:
>>
>>> Okay, so a menu widget solves that simple example construct. Later,
>>> in another screen widget, I want to insert 6 more lines of HTML that
>>> a menu widget won't solve. What do I do then?
>>>
>>> It seems there is no easy solution. I'll just sleep on it for a few
>>> days.
>>>
>>> Maybe someone who has worked on widget code can come up with an
>>> enhancement to the widgets that will accomodate HTML "snippets."
>>>
>>>
>>> Chris Howe wrote:
>>>
>>>> Scott's right, the menu widget would be more appropriate for that
>>>>
>>>> ----- Original Message ----
>>>> From: Adrian Crum <[hidden email]>
>>>> To: [hidden email]
>>>> Sent: Wednesday, February 7, 2007 11:53:50 AM
>>>> Subject: Re: Help with widgets please
>>>>
>>>> The createParty screen was the one I was working on last night
>>>> (https://127.0.0.1:8443/partymgr/control/createnew). It's about a
>>>> page of widget code. I can do the same thing with just a few lines
>>>> of HTML (or freemarker) code, but that would mean creating a
>>>> separate ftl file for that screen. I went ahead and created the ftl
>>>> file just to try out an idea and the results worked well. So then I
>>>> went back to the widget to get it to do the same thing and that's
>>>> where I got stuck.
>>>>
>>>> I was hoping to clean up the overlapping links by converting them to
>>>> a list.
>>>>
>>>>
>>>> Chris Howe wrote:
>>>>
>>>>
>>>>> You can, but it involves using the widgets in ways that I don't
>>>>> think is intended (using the label element with &lt; and &gt; and
>>>>> sometimes &quot; in the text attribute). CDATA might be an option
>>>>> as well, although I forget if that tag accepts element values in
>>>>> addition to element attributes.  I think ordered lists are handled
>>>>> much cleaner as ftl.  Do you have a particular screen you're
>>>>> concerned about?
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Adrian Crum <[hidden email]>
>>>>> To: [hidden email]
>>>>> Sent: Wednesday, February 7, 2007 10:49:17 AM
>>>>> Subject: Help with widgets please
>>>>>
>>>>> In our local OFBiz deployment I have favored using ftl files
>>>>> instead of widgets for HTML layout. I find it easier, it takes less
>>>>> code, and I don't have to learn a new language.
>>>>>
>>>>> But now I'm trying to refactor the party manager application UI as
>>>>> a "test bed" for the UI refactoring effort. Much of the party
>>>>> manager UI is handled by widgets, so I'm constrained to work with
>>>>> them. My efforts to get them to do simple tasks have been
>>>>> unsuccessful and I am becoming increasingly frustrated.
>>>>>
>>>>> To boil it down, I need a simple way to sprinkle a little HTML
>>>>> inside a widget XML file. Ideally, I'd like to be able to do
>>>>> something like:
>>>>>
>>>>> <widget>
>>>>>   <html>
>>>>>     <div>Hello world!</div>
>>>>>     <ul>
>>>>>       <li>Choice One</li>
>>>>>       <li>Choice Two</li>
>>>>>     </ul>
>>>>>   </html>
>>>>> </widget>
>>>>>
>>>>> Is there a way I can do that in the screen widgets?
>>>>>
>>>>> -Adrian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>
>