[OFBiz] Dev - How can I pass an uiLabelMap to a form widget
created in a bsh form?
David E. Jones
jonesde at ofbiz.org
Mon Apr 11 12:56:41 EDT 2005
Thanks Adrian, that is the proper way to do it.
There is one shortcut in place that I thought I'd mention... Because we
use the "uiLabelMap" variable so much the HtmlFormWrapper constructor
will look for that in a request attribute. So, as long as the
uiLabelMap is in a request attribute you shouldn't have to do anything
else. The envsetup.bsh scripts should already do this for code going
through JPublish.
For things going through the Screen Widget, those will be setup by
actions in the decorator, so generally you won't have to do anything
(as long as the decorator actions run BEFORE the bsh script that sets
up the form).
-David
On Apr 11, 2005, at 10:20 AM, Adrian Crum wrote:
> I'm sorry I didn't give more detail.
>
> Use the code from envsetup.bsh to create the uiLabelMap object, then
> put it in the HtmlFormWrapper's context using
> HtmlFormWrapper.putInContext().
>
> Example:
>
> locale = UtilHttp.getLocale(request);
> uiLabelMap =
> UtilProperties.getResourceBundleMap("MyComponentUiLabels", locale);
> uiLabelMap.addBottomResourceBundle("CommonUiLabels", locale);
> myFormWrapper = new HtmlFormWrapper();
> myFormWrapper.putInContext("uiLabelMap", uiLabelMap);
>
>
> Jacopo Cappellato wrote:
>
>> Adrian,
>> in the envsetup.bsh file, I cannot find anything about form
>> widgets... am I missing something?
>> Kind regards,
>> Jacopo
>>
>>> Look in Party Manager envsetup.bsh.
>>>
>>>
>>> Jacopo Cappellato wrote:
>>>
>>>> Hi all,
>>>>
>>>> how can I pass an uiLabelMap to a form widget created in a bsh form?
>>>>
>>>> I've noticed that uiLabelMap can be referenced from within a form
>>>> definition if the form is included using the include directive of
>>>> the screen definition.
>>>>
>>>> On the other hand, if the form is created directly in the bsh
>>>> script (thru the "new HtmlFormWrapper(...)" constructor), the
>>>> uiLabelMap is missing and the follwing definition returns an empty
>>>> title:
>>>>
>>>> <field name="notAvailableQuantity"
>>>> title="${uiLabelMap.ProductNotAvailable}"><display/></field>
>>>>
>>>> Any hints?
>>>>
>>>> Thanks,
>>>>
>>>> Jacopo
>>>>
>>>>
>>>>
>>>> ____________________________________________________________
>>>> 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di
>>>> Libero!
>>>> Scaricalo su INTERNET GRATIS 6X http://www.libero.it
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev at lists.ofbiz.org
>>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at lists.ofbiz.org
>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>
>> ____________________________________________________________
>> Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl
>> Flat senza limiti su http://www.libero.it
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/dev
> _______________________________________________
> Dev mailing list
> Dev at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2363 bytes
Desc: not available
Url : http://lists.ofbiz.org/pipermail/dev/attachments/20050411/770b410b/smime.bin
More information about the Dev
mailing list