Accessing each element of a form widget list

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

Accessing each element of a form widget list

Leon Torres-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Accessing each element of a form widget list

David E Jones-2

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

Reply | Threaded
Open this post in threaded view
|

Re: Accessing each element of a form widget list

cjhowe
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 <[hidden email]>
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
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Accessing each element of a form widget list

David E Jones-2

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 <[hidden email]>
> 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
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Accessing each element of a form widget list

Leon Torres-2
In reply to this post by Leon Torres-2
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
>