[OFBiz] Users - Screen Widget Questions

Adrian Crum adrianc at hlmksw.com
Fri Mar 18 14:23:22 EST 2005


David,

I created a Jira issue for this:

http://jira.undersunconsulting.com/browse/OFBIZ-174

What do I do next?


Adrian Crum wrote:
> Thanks for the suggestions David!
> 
> Yeah, I'd like to help with conversion/consolidation. I need to get a 
> better understanding of the widgets though. Let me know where I should 
> get started and I'll get to work!
> 
> I'm not putting down the screen widgets - I praised them a few messages 
> ago. I understand they are still in development.
> 
> I like the idea that the screen widgets have overcome some of the 
> limitations of JPublish. My preference is to use them with the bsh/ftl 
> combination though. Maybe once the screen widgets are more fully 
> developed that will change.
> 
> 
> 
> David Jones wrote:
> 
>>
>> Adrian,
>>
>> If the template really is going through the screen widget and not 
>> through JPublish this line:
>>
>>> <#assign uiLabelMap = requestAttributes.uiLabelMap>
>>
>>
>>
>> Will fail immediately because with the screen widget the uiLabelMap is 
>> put straight into the context and it does not exist as a request 
>> attribute (unless you put it there in your code, but that is not the 
>> recommended approach).
>>
>> So, there's one thing to look at. Another thing to consider is that 
>> there are dozens of pages working just fine, and with localization, so 
>> you might want to look at existing examples if you aren't sure how 
>> things might best go together. This sort of thing involves some 
>> understanding of the tools, but it mostly just done by convention to 
>> try to keep things consistent, and some of the conventions when 
>> working with the screen widget are different than working with JPublish.
>>
>> Also, there is some inconsistency in how things are done, which is to 
>> be expected when you have different requirements and needs for 
>> different pages even if done by the same person, and sometimes even 
>> worse when written by totally different people.
>>
>> Over time we do sometimes spend time on consolidation and reducing 
>> redundancy, but heck the screen widget is only about 5 months old and 
>> we haven't even converted everything to use it instead of JPublish, 
>> let alone reduced everything to a master plan for formatting... If you 
>> want to contribute to this effort, that's great! If not, you'll just 
>> have to be patient...
>>
>> -David
>>
>>
>> On Mar 14, 2005, at 6:01 PM, Adrian Crum wrote:
>>
>>> BJ,
>>>
>>> Using your example, this ftl code doesn't work:
>>>
>>> <#assign uiLabelMap = requestAttributes.uiLabelMap>
>>> ${uiLabelMap.fooCompanySubtitle}
>>>
>>>
>>> bjfree at free-man.net wrote:
>>>
>>>> you can define many
>>>>                 <property-map resource="fooUiLabels" 
>>>> map-name="uiLabelMap"
>>>> global="true"/>
>>>>                 <property-map resource="CommonUiLabels"
>>>> map-name="uiLabelMap" global="true"/>
>>>> then you                 <set field="layoutSettings.companyName"
>>>> from-field="uiLabelMap.fooCompanyName" global="true"/>
>>>>                 <set field="layoutSettings.companySubtitle"
>>>> from-field="uiLabelMap.fooCompanySubtitle" global="true"/>
>>>> this uses the global properties.
>>>> layoutSettings.companyName be reference in the FTL's
>>>> -----Original Message-----
>>>> From: Adrian Crum [mailto:adrianc at hlmksw.com]
>>>> Sent: Monday, March 14, 2005 11:46 PM
>>>> To: OFBiz Users / Usage Discussion (High Traffic)
>>>> Subject: [OFBiz] Users - Screen Widget Questions
>>>> I've spent about four days trying to get the screen widgets to work, 
>>>> but I'm running into problems I can't get resolved.
>>>> 1. The following line:
>>>> <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
>>>> global="true"/>
>>>> doesn't seem to work because when I try to access the uiLabelMap 
>>>> from within an FTL file, the UI labels don't work. If I put a bsh 
>>>> script in the <action> section and setup the uiLabelMap from there, 
>>>> everything works properly.
>>>> 2. Is there a way to specify a global script, like JPublish 
>>>> <global-action> ? I've tried putting the script in a common 
>>>> decorator screen, but it seems to get run AFTER the content's 
>>>> actions are run.
>>>> With JPublish, envsetup.bsh was run, then the page's script 
>>>> (myPage.bsh) was run, then the content (myPage.ftl) was merged with 
>>>> the template and output. I can't get that behavior with screen widgets.
>>>> It seems the decorator's scripts are run before the page's scripts 
>>>> are run. So using the previous example, screen widgets run 
>>>> myPage.bsh, then envsetup.bsh, then merge myPage.ftl with the template.
>>>>  _______________________________________________
>>>> Users mailing list
>>>> Users at lists.ofbiz.org
>>>> http://lists.ofbiz.org/mailman/listinfo/users
>>>>  _______________________________________________
>>>> Users mailing list
>>>> Users at lists.ofbiz.org
>>>> http://lists.ofbiz.org/mailman/listinfo/users
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.ofbiz.org
>>> http://lists.ofbiz.org/mailman/listinfo/users
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/users
>>
> 
> _______________________________________________
> Users mailing list
> Users at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/users
> 


More information about the Users mailing list