Sam

action methods on WOElements or WOComponents don't take arguments. 

wire the submit button's action to a method called addtocart() and that
will work. 

Now my guess is you have a list of stuff on the page. The WO way is not
to hardcode this. use a WORepetition, bind the list= and item= if that
to an array of whatever you are displaying (apparently numbers). Add a
aItem ivar to your page. Now WOF will make sure that when addtocart()
fires, the ivar aItem will simply hold the number for that row in the
list.

d

sam wrote:
> 
> I currently have a WOSubmit button.  The submit button calls a function that
> expects an integer to be passed to it.  In PB I have been trying to get the
> submit button to call the function and submit the static integer for the
> button.  In the wod file im trying to assign  action = addtocart(45);, 45
> being the static integer. The main class file that holds the init for the
> method that is waiting for the variable looks like public WOComponent
> addtocart(int price).  Now when I switch back to WYSIWYG mode I get an error
> saying missing }.  Is there a different way to pass variables from function
> to function in WO or am I making a stupid mistake.
> 
> Thanks for your help,
> Sam

Reply via email to