You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Shereen <sh...@hotmail.com> on 2011/01/01 17:11:28 UTC

form action buttons

Hi all
I want to make buttons in my form and when each button is pressed a
different action takes place
like in html and freemarker and other languages
I want  to know how specify a javascript action for a button and where to
write it and how to specify its path
I've seen the attributes "parameter-name" and "action" and "attribute-name"
I think action is for javascript action
I don't know how to use them.
can anyone give me any example or specify an forms.xml file in ofbiz that
uses this technique actually I\ve done this many times but through the
freemarker 
now I want to do this through the regular xml forms that are widely used in
ofbiz

Thanks a lot for any help
-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170195.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: form action buttons

Posted by Jacques Le Roux <ja...@les7arts.com>.
From: "Shereen" <sh...@hotmail.com>
> Thanks a lot for your reply.
> I understood your point about making link a link button and hyperlink with
> target and give it parameter if I'd like.
> I'll put more information about what I want to do so that you and others can
> help
> I want to put some buttons in addition to the regular submit and each button
> should be responsible for doing 2 things:
> changing the status of the entity used in the form (changing a value
> generally)
> and doing the regular sumbit task of updating the value
> so if I used your solution that's what I expect I'll d and please anyone
> correct me
> 
> - make different versions of the update service each one will be the regular
> update plus putting extra code NOT to take the status from the parameters
> but seeting it to certain value
> 
> -make the buttons as button links and set target of each one to the suitable
> update service version that suits it and assign the parameter name the Id of
> the entity record I wish to update and change the status like the delete or
> cancel links
> 
> 
> My point was to use a hidden field in the form say (actionSelected) and when
> a certain button is pressed then I'll use the javascript to set that field
> to certain value
> 
> and do some customization in the update service to check for the value of
> actionSelected to decide to which status it will be updated 
> 
> and that will save me from creating different targets.That hidden input and
> javascript will help me decide which button was pressed and that's very
> important for me
> 
> Thanks in advance for any help


This is a good solution indeed. I think there are ever examples OOTB. At least we use it often in custom projects

Jacques

 > 
> 
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170492.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


Re: form action buttons

Posted by Shereen <sh...@hotmail.com>.
Thanks a lot for your reply.
I understood your point about making link a link button and hyperlink with
target and give it parameter if I'd like.
I'll put more information about what I want to do so that you and others can
help
I want to put some buttons in addition to the regular submit and each button
should be responsible for doing 2 things:
changing the status of the entity used in the form (changing a value
generally)
and doing the regular sumbit task of updating the value
so if I used your solution that's what I expect I'll d and please anyone
correct me

- make different versions of the update service each one will be the regular
update plus putting extra code NOT to take the status from the parameters
but seeting it to certain value

-make the buttons as button links and set target of each one to the suitable
update service version that suits it and assign the parameter name the Id of
the entity record I wish to update and change the status like the delete or
cancel links


My point was to use a hidden field in the form say (actionSelected) and when
a certain button is pressed then I'll use the javascript to set that field
to certain value

and do some customization in the update service to check for the value of
actionSelected to decide to which status it will be updated 

and that will save me from creating different targets.That hidden input and
javascript will help me decide which button was pressed and that's very
important for me

Thanks in advance for any help



-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170492.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: form action buttons

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes you need to pass any values you need in the service, your solution should work

Jacques

From: "Shereen" <sh...@hotmail.com>
> I've another question regarding this
> if I'll use link buttons and targets
> if I want to use a target service that looks exactly like update service
> except that it sets a certain field with a certain value in my case (The
> status field)
> how can I path the parameters?
> use <parameter param-name=""> for each parameter?
> can any one help me with that?
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170508.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


Re: form action buttons

Posted by Shereen <sh...@hotmail.com>.
I've another question regarding this
if I'll use link buttons and targets
if I want to use a target service that looks exactly like update service
except that it sets a certain field with a certain value in my case (The
status field)
how can I path the parameters?
use <parameter param-name=""> for each parameter?
can any one help me with that?
-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170508.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: form action buttons

Posted by Adrian Crum <ad...@yahoo.com>.
Just make links and style them like buttons. Look at the Cancel/Done buttons for an example.

-Adrian

--- On Sat, 1/1/11, Shereen <sh...@hotmail.com> wrote:
> Hi all
> I want to make buttons in my form and when each button is
> pressed a
> different action takes place
> like in html and freemarker and other languages
> I want  to know how specify a javascript action for a
> button and where to
> write it and how to specify its path
> I've seen the attributes "parameter-name" and "action" and
> "attribute-name"
> I think action is for javascript action
> I don't know how to use them.
> can anyone give me any example or specify an forms.xml file
> in ofbiz that
> uses this technique actually I\ve done this many times but
> through the
> freemarker 
> now I want to do this through the regular xml forms that
> are widely used in
> ofbiz
> 
> Thanks a lot for any help
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/form-action-buttons-tp3170195p3170195.html
> Sent from the OFBiz - User mailing list archive at
> Nabble.com.
>