You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Leon Torres <le...@oss.minimetria.com> on 2006/08/19 02:34:41 UTC

Accessing each element of a form widget list

Hi all,

Is there a way to access the Map or GenericValue for a given row in a form 
widget of type list or multi?

Basically I want to pass the entire row of data to a helper function in a
${bsh: } call so I can format it in Java.


- Leon

Re: Accessing each element of a form widget list

Posted by David E Jones <jo...@undersunconsulting.com>.
On Aug 18, 2006, at 7:25 PM, Chris Howe wrote:

> That seems to be correct.  It drops each object of
> that iteration into the local context map.  To access
> the object it's just the object's name without map
> name. ie if you had a field name "productId" you
> access that object with just productId.
>
> David, does that mean the form element's attribute
> "default-map-name" has no current function or is that
> used for something else?

That's a different case altogether than a bsh snippet in a form  
definition. A field element has a field name but the data for the  
field can come from either the parameters map (for error conditions  
and such to show what the user just entered), or from a map that  
contains the data for the field (generally coming from the database  
as a GenericValue object).

If that doesn't make sense it might be helpful to review more details  
about how the form widget functions, either with something like the  
advanced framework videos from undersun, or you might find relevant  
information in the form widget cook book from OSS or if you really  
want details with the best info available: check out the code and  
config files... ;)

-David



> --- David E Jones <jo...@undersunconsulting.com>
> wrote:
>
>>
>> Try using the variable named "context". I don't know
>> if I'm
>> remembering right off the top of my head, but I
>> think I set that up
>> to always have the most local context.
>>
>> -David
>>
>>
>> On Aug 18, 2006, at 6:34 PM, Leon Torres wrote:
>>
>>> Hi all,
>>>
>>> Is there a way to access the Map or GenericValue
>> for a given row in
>>> a form widget of type list or multi?
>>>
>>> Basically I want to pass the entire row of data to
>> a helper
>>> function in a
>>> ${bsh: } call so I can format it in Java.
>>>
>>>
>>> - Leon
>>
>>
>


Re: Accessing each element of a form widget list

Posted by Chris Howe <cj...@yahoo.com>.
That seems to be correct.  It drops each object of
that iteration into the local context map.  To access
the object it's just the object's name without map
name. ie if you had a field name "productId" you
access that object with just productId.

David, does that mean the form element's attribute
"default-map-name" has no current function or is that
used for something else?

--- David E Jones <jo...@undersunconsulting.com>
wrote:

> 
> Try using the variable named "context". I don't know
> if I'm  
> remembering right off the top of my head, but I
> think I set that up  
> to always have the most local context.
> 
> -David
> 
> 
> On Aug 18, 2006, at 6:34 PM, Leon Torres wrote:
> 
> > Hi all,
> >
> > Is there a way to access the Map or GenericValue
> for a given row in  
> > a form widget of type list or multi?
> >
> > Basically I want to pass the entire row of data to
> a helper  
> > function in a
> > ${bsh: } call so I can format it in Java.
> >
> >
> > - Leon
> 
> 


Re: Accessing each element of a form widget list

Posted by David E Jones <jo...@undersunconsulting.com>.
Try using the variable named "context". I don't know if I'm  
remembering right off the top of my head, but I think I set that up  
to always have the most local context.

-David


On Aug 18, 2006, at 6:34 PM, Leon Torres wrote:

> Hi all,
>
> Is there a way to access the Map or GenericValue for a given row in  
> a form widget of type list or multi?
>
> Basically I want to pass the entire row of data to a helper  
> function in a
> ${bsh: } call so I can format it in Java.
>
>
> - Leon


Re: Accessing each element of a form widget list

Posted by Leon Torres <le...@oss.minimetria.com>.
I see the screen widget <iterate-section>  has an attribute entry-name to 
reference a row.  Is this what I'm looking for?  Does it work with form widgets 
of type list?

- Leon



Leon Torres wrote:
> Hi all,
> 
> Is there a way to access the Map or GenericValue for a given row in a 
> form widget of type list or multi?
> 
> Basically I want to pass the entire row of data to a helper function in a
> ${bsh: } call so I can format it in Java.
> 
> 
> - Leon
>