Similar to Variable Variables question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Similar to Variable Variables question

Jonathan Schwarz
Lasso6 on IIS6

I have a dynamically created form - it ends up with form fields named
like '79Quantity1'.

On the action page I want to determine which form fields have been
populated. I can recreate the string '79Quantity1' but how do I check to
see if there is an action_param named '79Quantity1' with a non-blank
value.

I tried:
[If:(action_param:(Var:'quanName')) != '']

Where the value of quanName is '79Quantity1'.

No dice.

-Jon

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Fletcher Sandbeck
Sent: Tuesday, May 31, 2005 1:32 PM
To: [hidden email]
Subject: Re: Variable Variables

On 5/31/05 at 10:08 AM by [hidden email] (Douglas
Burchard):

>Yes, all of your code works fine on my system and yours, but  
>obviously not on Peter's. Since [(Var: 'name') = 'value] clearly  
>isn't correct to the docs ("...called with a name/value  
>parameter..."), my guess is whatever version Peter is using isn't as  
>forgiving in this respect (previous posts would suggest LP7 on  
>Windows, but I have no idea which release).

The [Variable] tag can either be called with a name/value parameter to
set a variable or with a name parameter to retrieve a variable value.
Variable values are retrieved by reference in Lasso.  (Var: 'name') is
equivalent to $name.  Just as $name='new value' works to store a new
value in $name so too will (var: 'name')='new value' work.

However, there can be subtle differences between using [Var: 'name' =
'value'] and [(Var: 'name') = 'value'].  All things being equal, I'd
recommend using the former unless you know you need the latter.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Lasso Product Specialist              [hidden email]
OmniPilot, Software Inc.                http://www.omnipilot.com

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Similar to Variable Variables question

Doug Gentry
How are these dynamic action_params created on the initial page?

If they are text input fields, then I'd think your code below should
work.

If they are checkboxes or radio buttons, either of which without the
selected modifier, then the browser doesn't send anything and the if
statement on your response page might upchuck.

Can you just temporarily display both [var: 'quanName'] and  
[action_param: (var: 'quanName')] to see what is coming over?

....Doug Gentry

On May 31, 2005, at 1:44 PM, Jonathan Schwarz wrote:

> Lasso6 on IIS6
>
> I have a dynamically created form - it ends up with form fields named
> like '79Quantity1'.
>
> On the action page I want to determine which form fields have been
> populated. I can recreate the string '79Quantity1' but how do I check
> to
> see if there is an action_param named '79Quantity1' with a non-blank
> value.
>
> I tried:
> [If:(action_param:(Var:'quanName')) != '']
>
> Where the value of quanName is '79Quantity1'.
>
> No dice.
>
> -Jon
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Fletcher Sandbeck
> Sent: Tuesday, May 31, 2005 1:32 PM
> To: [hidden email]
> Subject: Re: Variable Variables
>
> On 5/31/05 at 10:08 AM by [hidden email] (Douglas
> Burchard):
>
>> Yes, all of your code works fine on my system and yours, but
>> obviously not on Peter's. Since [(Var: 'name') = 'value] clearly
>> isn't correct to the docs ("...called with a name/value
>> parameter..."), my guess is whatever version Peter is using isn't as
>> forgiving in this respect (previous posts would suggest LP7 on
>> Windows, but I have no idea which release).
>
> The [Variable] tag can either be called with a name/value parameter to
> set a variable or with a name parameter to retrieve a variable value.
> Variable values are retrieved by reference in Lasso.  (Var: 'name') is
> equivalent to $name.  Just as $name='new value' works to store a new
> value in $name so too will (var: 'name')='new value' work.
>
> However, there can be subtle differences between using [Var: 'name' =
> 'value'] and [(Var: 'name') = 'value'].  All things being equal, I'd
> recommend using the former unless you know you need the latter.
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Lasso Product Specialist              [hidden email]
> OmniPilot, Software Inc.                http://www.omnipilot.com
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>

---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 888-490-0644
[hidden email]


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Similar to Variable Variables question

Jonathan Schwarz
In reply to this post by Jonathan Schwarz
I found my error - thanks to another post - I was trying to call the
action_param inside and Inline.

Working nicely now:

Creating comma list in Inline from DB then:
[var: 'newlist1' = (var:'listofvals1')->(split: ',')]
[Iterate: $newlist1, (Var:'thisSample1')]
[action_param:(Var: 'thisSample1')]<br>
[/Iterate]

I guess I could build the array directly inside the inline section
too....

...anyway - my if statements should work now. I wasn't aware that I
couldn't reference action_params inside of the inline - kind of
annoying. I am used to Cold Fusion still I guess with the
form.variablename notation that is available anywhere... still getting
used to lasso. :)

-Jon

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Doug Gentry
Sent: Tuesday, May 31, 2005 5:08 PM
To: [hidden email]
Subject: Re: Similar to Variable Variables question

How are these dynamic action_params created on the initial page?

If they are text input fields, then I'd think your code below should
work.

If they are checkboxes or radio buttons, either of which without the
selected modifier, then the browser doesn't send anything and the if
statement on your response page might upchuck.

Can you just temporarily display both [var: 'quanName'] and  
[action_param: (var: 'quanName')] to see what is coming over?

....Doug Gentry

On May 31, 2005, at 1:44 PM, Jonathan Schwarz wrote:

> Lasso6 on IIS6
>
> I have a dynamically created form - it ends up with form fields named
> like '79Quantity1'.
>
> On the action page I want to determine which form fields have been
> populated. I can recreate the string '79Quantity1' but how do I check
> to
> see if there is an action_param named '79Quantity1' with a non-blank
> value.
>
> I tried:
> [If:(action_param:(Var:'quanName')) != '']
>
> Where the value of quanName is '79Quantity1'.
>
> No dice.
>
> -Jon
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Fletcher Sandbeck
> Sent: Tuesday, May 31, 2005 1:32 PM
> To: [hidden email]
> Subject: Re: Variable Variables
>
> On 5/31/05 at 10:08 AM by [hidden email]
(Douglas

> Burchard):
>
>> Yes, all of your code works fine on my system and yours, but
>> obviously not on Peter's. Since [(Var: 'name') = 'value] clearly
>> isn't correct to the docs ("...called with a name/value
>> parameter..."), my guess is whatever version Peter is using isn't as
>> forgiving in this respect (previous posts would suggest LP7 on
>> Windows, but I have no idea which release).
>
> The [Variable] tag can either be called with a name/value parameter to
> set a variable or with a name parameter to retrieve a variable value.
> Variable values are retrieved by reference in Lasso.  (Var: 'name') is
> equivalent to $name.  Just as $name='new value' works to store a new
> value in $name so too will (var: 'name')='new value' work.
>
> However, there can be subtle differences between using [Var: 'name' =
> 'value'] and [(Var: 'name') = 'value'].  All things being equal, I'd
> recommend using the former unless you know you need the latter.
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Lasso Product Specialist              [hidden email]
> OmniPilot, Software Inc.                http://www.omnipilot.com
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>

---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 888-490-0644
[hidden email]


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Similar to Variable Variables question

Greg Willits
In reply to this post by Jonathan Schwarz
On May 31, 2005, at 2:45 PM, Jonathan Schwarz wrote:

> I found my error - thanks to another post - I was trying to call the
> action_param inside and Inline.
>
> Working nicely now:
>
> Creating comma list in Inline from DB then:
> [var: 'newlist1' = (var:'listofvals1')->(split: ',')]
> [Iterate: $newlist1, (Var:'thisSample1')]
> [action_param:(Var: 'thisSample1')]<br>
> [/Iterate]
>
> I guess I could build the array directly inside the inline section
> too....
>
> ...anyway - my if statements should work now. I wasn't aware that I
> couldn't reference action_params inside of the inline - kind of
> annoying. I am used to Cold Fusion still I guess with the
> form.variablename notation that is available anywhere... still getting
> used to lasso. :)


Have a look at client_postparams and client_getparams and its cousins.

-- greg willits


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage