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 2010/10/16 23:32:58 UTC

Checkbox confirmation

Hi all
I want to add a checkbox in the create quote screen like a confirmation box
and the user shouldnt be able to
Create the quote unless he checks it
I added this line to the form EditeQuote
        <field name="checkBox" title="Payment method and Dsicount
checked"><check/></field>

knowing that this field has NO existence in the quote entity. or I should
add it to the entity?

Plus I want to force the user to check it. I want to do that in the Create
Quote simple service 
I want to do that by adding this condition to the conditions already
existing
can anyone guide me what's the right way to do so?
can I use if compare and if compare field or they work only for fields
existing in the quote entity?


-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p2998649.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
thanx
its working fine.i achieved my requirement.i gave target i nthe form itself. 
<form target="deleteticket"> like that.i want another target also there for
edit purpose.bcaz i added target for edit in form previously .it was working
fine. i removed it for this delete purpose.

<form name="ListBookings" type="multi" use-row-submit="true" title="Selected
Monument" separate-columns="true"  paginate-target="Book_E_Ticket1"  traget
="updateBookingDetails" target="deleteticket"
                 list-name="TicketDetails">
                <actions>
                        
                         <script
location="component://eticket/webapp/eticket/WEB-INF/actions/TicketBookingView.groovy"/>  
                </actions>
                
          <field name="ticketId">
                        <display-entity entity-name="TicketBookingDetails"
description="${ticketId}"/>
                        <hidden/>
                </field>
                <field name="check"><check></check>
                </field>
                <field name="monumentName">
                        <display/>
                </field>
                <field name="date_visit">
                        <display/>
                </field>
                
                <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}">
                        <hidden value="Y"/>
                </field>
                
            <field name="editLink" title="Edit" widget-style="buttontext">
        	<hyperlink target="editTicket" description="Edit"
also-hidden="false">
        		<parameter param-name="ticketId"/>
      		</hyperlink>
    	</field>
                <field name="deleteLink" title="Delete"
widget-style="buttontext">
        <hyperlink target="deleteTicket"
description="${uiLabelMap.CommonDelete}" also-hidden="false" 
confirmation-message ="Are You Sure">
        <parameter param-name="ticketId"/>
      </hyperlink>
    </field>
    
        in above code "updateBookingDetails" target is used for updating
details and   "editTicket"  is a target for getting another screen with
details of selected row.

now in form already one target is there   "updateBookingDetails". now this
"deleteticket" target also required in form only. how ?
 

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4625968.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Amit Sharma <sh...@gmail.com>.
Hi Madhu,

Use  <field name="_rowSubmit" title="${uiLabelMap.CommonYes}">
            <check/>
        </field>

In the form instead of passing hidden = Y and remove
              <field name="check"><check></check>
              </field>

--
Thanks and Regards
Amit Sharma

On Thu, May 10, 2012 at 5:31 PM, madhu <ma...@lntinfotech.com>wrote:

> thanx...i have followed wat u told and i called that service method from
> service instead of calling directly from controller.but here when i click
> on
> that button it is deleting all the records at a time..but i want the
> checked
> records only to be deleted. thats why i am providing checkboxes option to
> the user.
>
> so,instead of deleting all the records how to delete only checed records on
> that button click..thats wat my actual requirement
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623253.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
thanx...i have followed wat u told and i called that service method from
service instead of calling directly from controller.but here when i click on
that button it is deleting all the records at a time..but i want the checked
records only to be deleted. thats why i am providing checkboxes option to
the user.

so,instead of deleting all the records how to delete only checed records on
that button click..thats wat my actual requirement

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623253.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
thanx. i am passing "ticketid" as a parameter which is a pk in that table.i
am passing like this

 <field name="deleteLink" title="Delete" widget-style="buttontext">
        	<hyperlink target="deleteTicket"
description="${uiLabelMap.CommonDelete}" also-hidden="false" 
confirmation-message ="Are You Sure">
        		<parameter param-name="ticketId"/>
      		</hyperlink>
    	</field> 

so the button in the row when it is clicked,this id will be passed as a
parameter for deletion.



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623314.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Ravindra Mandre <ra...@gmail.com>.
On Thu, May 10, 2012 at 4:26 PM, Ankit Jain <an...@gmail.com> wrote:

> Madhu,
>
> Try this code it will work for you what you are expecting.
>
> Add target in the form tag instead of you added Delete field in each row.
>
> <form name="ListBookings" type="multi" target="deleteTicket"
> use-row-submit="true" title="Selected Monument"
> separate-columns="true"  paginate-target="Book_E_Ticket1"
>                list-name="TicketDetails">
>               <actions>
>                        <script
>
> location="component://eticket/webapp/eticket/WEB-INF/actions/TicketBookingView.groovy"/>
>               </actions>
>
>



>         <field name="ticketId">
>                       <display-entity
> entity-name="TicketBookingDetails" description="${ticketId}"/>
>




>                       <hidden/>
>               </field>
>

Madhu,

Can you tell which parameter you are passing as hidden , as i can see your
form is not well formatted and it should give you some error.
if you have to pass ticket id as hidden then do not use display entity ,
you are combining both together.

Ravindra Mandre
Bangalore




>               <field name="check"><check></check>
>               </field>
>               <field name="monumentName">
>                       <display/>
>               </field>
>               <field name="date_visit">
>                       <display/>
>               </field>
>
>               <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}">
>                       <hidden value="Y"/>
>               </field>
>
>                <field name="submitButton"
> widget-style="smallSubmit"><submit/></field>
>
>
>       </form>
>
> in controller.xml :
>
>                <request-map uri="deleteTicket"><security https="true"
> auth="false"/>
>                     <event type="service-multi" invoke="deleteTicket"
> path="component://eticket/script/org/ofbiz/eticket/EbookingServices.xml"/>
>                    <response name="success" type="view"
> value="booketicket"/>
>                    <response name="error" type="view" value="booketicket"/>
>                </request-map>
>
>
> Don't worry about multiple Id's you don't need to do anything else
> your form is of type multi and we are using service-multi in
> controller so it will handle by its own.
>
>
> Regards,
> Ankit Jain
>
>
>
> On Thu, May 10, 2012 at 3:07 PM, madhu <ma...@lntinfotech.com>
> wrote:
> > with service also we can do but only single record deletion.instead of
> using
> > service i called simple method in controller itself. i can use service
> and i
> > can call simple method for deletion from service.that will work fine for
> > single record deletion but how mutiple records based on checkboxes
> > click..see the code wat ever i have posted and suggest me for multiple
> > deletion.here,main requirements are
> >
> > 1.getting recordids of checked.(in my code ticketids i have for each
> record
> > in hidden format. i m using that id for record deletion.but multiple ids
> how
> > to pass at a time)
> >
> > 2.how to handle those ids for deletion fo those records at a time.
> >
> > the code i have posted working very fine for single record deletion.
> >
> > @ankit : hoe to use that type="service-multi" for deletion of checked
> > records.ids how we can handle there.
> >
> > pls help me out.thanks in advance to every one
> >
> >
> > --
> > View this message in context:
> http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623004.html
> > Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: Checkbox confirmation

Posted by Ankit Jain <an...@gmail.com>.
Madhu,

Try this code it will work for you what you are expecting.

Add target in the form tag instead of you added Delete field in each row.

<form name="ListBookings" type="multi" target="deleteTicket"
use-row-submit="true" title="Selected Monument"
separate-columns="true"  paginate-target="Book_E_Ticket1"
                list-name="TicketDetails">
               <actions>
                        <script
location="component://eticket/webapp/eticket/WEB-INF/actions/TicketBookingView.groovy"/>
               </actions>

         <field name="ticketId">
                       <display-entity
entity-name="TicketBookingDetails" description="${ticketId}"/>
                       <hidden/>
               </field>
               <field name="check"><check></check>
               </field>
               <field name="monumentName">
                       <display/>
               </field>
               <field name="date_visit">
                       <display/>
               </field>

               <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}">
                       <hidden value="Y"/>
               </field>

               <field name="submitButton"
widget-style="smallSubmit"><submit/></field>


       </form>

in controller.xml :

                <request-map uri="deleteTicket"><security https="true"
auth="false"/>
                    <event type="service-multi" invoke="deleteTicket"
path="component://eticket/script/org/ofbiz/eticket/EbookingServices.xml"/>
                    <response name="success" type="view" value="booketicket"/>
                    <response name="error" type="view" value="booketicket"/>
                </request-map>


Don't worry about multiple Id's you don't need to do anything else
your form is of type multi and we are using service-multi in
controller so it will handle by its own.


Regards,
Ankit Jain



On Thu, May 10, 2012 at 3:07 PM, madhu <ma...@lntinfotech.com> wrote:
> with service also we can do but only single record deletion.instead of using
> service i called simple method in controller itself. i can use service and i
> can call simple method for deletion from service.that will work fine for
> single record deletion but how mutiple records based on checkboxes
> click..see the code wat ever i have posted and suggest me for multiple
> deletion.here,main requirements are
>
> 1.getting recordids of checked.(in my code ticketids i have for each record
> in hidden format. i m using that id for record deletion.but multiple ids how
> to pass at a time)
>
> 2.how to handle those ids for deletion fo those records at a time.
>
> the code i have posted working very fine for single record deletion.
>
> @ankit : hoe to use that type="service-multi" for deletion of checked
> records.ids how we can handle there.
>
> pls help me out.thanks in advance to every one
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623004.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
with service also we can do but only single record deletion.instead of using
service i called simple method in controller itself. i can use service and i
can call simple method for deletion from service.that will work fine for
single record deletion but how mutiple records based on checkboxes
click..see the code wat ever i have posted and suggest me for multiple
deletion.here,main requirements are

1.getting recordids of checked.(in my code ticketids i have for each record
in hidden format. i m using that id for record deletion.but multiple ids how
to pass at a time)

2.how to handle those ids for deletion fo those records at a time.

the code i have posted working very fine for single record deletion.

@ankit : hoe to use that type="service-multi" for deletion of checked
records.ids how we can handle there.

pls help me out.thanks in advance to every one


--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4623004.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Ravindra Mandre <ra...@gmail.com>.
Madhu ,

You need to implement your event as service then use tags as suggested by
Ankit.


Ravindra Mandre
Bangalore

On Thu, May 10, 2012 at 11:04 AM, madhu <ma...@lntinfotech.com>wrote:

> that request in controller i added.single record deletion is working
> fine.without controller request i cant call that simple method na.i did
> that
> like this already. now  iwant how to implement multiple record deletion
> using checkbox cheeck by user.
>
>    <request-map uri="deleteTicket"><security https="true" auth="false"/>
>                <event type="simple" invoke="deleteTicket"
> path="component://eticket/script/org/ofbiz/eticket/EbookingServices.xml"/>
>                <response name="success" type="view"
> value="booketicket"/><response
> name="error" type="view" value="booketicket"/></request-map>
>
>  simple method i posted above.
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4622552.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
that request in controller i added.single record deletion is working
fine.without controller request i cant call that simple method na.i did that
like this already. now  iwant how to implement multiple record deletion
using checkbox cheeck by user.

    <request-map uri="deleteTicket"><security https="true" auth="false"/>
		<event type="simple" invoke="deleteTicket"
path="component://eticket/script/org/ofbiz/eticket/EbookingServices.xml"/>
		<response name="success" type="view" value="booketicket"/><response
name="error" type="view" value="booketicket"/></request-map>

 simple method i posted above.

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4622552.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Ankit Jain <an...@gmail.com>.
I think you have missed the below entry in the controller, event type
should be "service-multi".

<event type="service-multi" invoke="deleteTicket"/>


Regards,
Ankit Jain



On Wed, May 9, 2012 at 4:53 PM, madhu <ma...@lntinfotech.com> wrote:
> HI,
> I am new to this OFBiz. I have some records in a grid. i want to provide
> checkbox to all the records.that thing i have done like
>
>        <field name="check"><check></check>
>                </field>                                in a form.
>
> now i want to delete  the  corresponding records which ever the user checked
> in the checkbox. ihave done to delete single record at a time.but i am not
> getting how to delete multiple records at a time using the checked
> checkboxes.
>
> code i have written for single delete :
>
> In form :
>
> <form name="ListBookings" type="multi" use-row-submit="true" title="Selected
> Monument" separate-columns="true"  paginate-target="Book_E_Ticket1"
>                 list-name="TicketDetails">
>                <actions>
>
>                         <script
> location="component://eticket/webapp/eticket/WEB-INF/actions/TicketBookingView.groovy"/>
>                </actions>
>
>          <field name="ticketId">
>                        <display-entity entity-name="TicketBookingDetails"
> description="${ticketId}"/>
>                        <hidden/>
>                </field>
>                <field name="check"><check></check>
>                </field>
>                <field name="monumentName">
>                        <display/>
>                </field>
>                <field name="date_visit">
>                        <display/>
>                </field>
>
>                <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}">
>                        <hidden value="Y"/>
>                </field>
>
>                <field name="deleteLink" title="Delete" widget-style="buttontext">
>                <hyperlink target="deleteTicket"
> description="${uiLabelMap.CommonDelete}" also-hidden="false"
> confirmation-message ="Are You Sure">
>                        <parameter param-name="ticketId"/>
>                </hyperlink>
>        </field>
>
>
>        </form>
>
> simple method to delete single record :
>
>  <simple-method method-name="deleteTicket" short-description="Delete
> Ticket">
>                <entity-one entity-name="TicketBookingDetails"
> value-field="lookedUpValue"/>
>                <remove-value value-field="lookedUpValue"/>
>                <set field="_event_message_" value="Successfully Deleted!!"/>
>        </simple-method>
>
> pls do the needful.
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4620129.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by madhu <ma...@lntinfotech.com>.
HI,
I am new to this OFBiz. I have some records in a grid. i want to provide
checkbox to all the records.that thing i have done like

        <field name="check"><check></check>
		</field>                                in a form.

now i want to delete  the  corresponding records which ever the user checked
in the checkbox. ihave done to delete single record at a time.but i am not
getting how to delete multiple records at a time using the checked
checkboxes.

code i have written for single delete :

In form :

<form name="ListBookings" type="multi" use-row-submit="true" title="Selected
Monument" separate-columns="true"  paginate-target="Book_E_Ticket1"
		 list-name="TicketDetails">
		<actions>
			
			 <script
location="component://eticket/webapp/eticket/WEB-INF/actions/TicketBookingView.groovy"/> 
		</actions>
		
	  <field name="ticketId">
			<display-entity entity-name="TicketBookingDetails"
description="${ticketId}"/>
			<hidden/>
		</field>
		<field name="check"><check></check>
		</field>
		<field name="monumentName">
			<display/>
		</field>
		<field name="date_visit">
			<display/>
		</field>
		
		<field name="_rowSubmit" title="${uiLabelMap.CommonSelect}">
			<hidden value="Y"/>
		</field>
		
		<field name="deleteLink" title="Delete" widget-style="buttontext">
        	<hyperlink target="deleteTicket"
description="${uiLabelMap.CommonDelete}" also-hidden="false" 
confirmation-message ="Are You Sure">
        		<parameter param-name="ticketId"/>
      		</hyperlink>
    	</field>
    	
		
	</form>

simple method to delete single record :

 <simple-method method-name="deleteTicket" short-description="Delete
Ticket">
		<entity-one entity-name="TicketBookingDetails"
value-field="lookedUpValue"/>
		<remove-value value-field="lookedUpValue"/>
		<set field="_event_message_" value="Successfully Deleted!!"/>     
	</simple-method>

pls do the needful.

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p4620129.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Shereen <sh...@hotmail.com>.
Thanks for your contribution I've tried this it didnt work at first because I
didnt update the service definition file 
I decided to post my updates so anyone who faces similar problem may get use
of it
-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p2999068.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by Jacques Le Roux <ja...@les7arts.com>.
Simply check for "Y", something like
<if-compare field="parameters.myCheckField" value="Y" operator="equals">
    ...
</if-compare>

Same for radio buttons

Jacques

From: "Shereen" <sh...@hotmail.com>
> Thanks a lot for your help
> so what I understand is that I can use that checkbox even if it's not in the
> entity it's just a form field
> and I can check for it in the create service I tried to do that checking but
> if it was completely ignored as if the condition has no existence so would
> you please tell me how can I do that in my code? check if the check box is
> checked or not.
> is that available in minilang ?
> can I use if compare or if compare field ?
> if so how?
> For sme reasons I dont want to use javascript.
> 
> Thanks again for your support
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p2998879.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


Re: Checkbox confirmation

Posted by Shereen <sh...@hotmail.com>.
Thanks a lot for your help
so what I understand is that I can use that checkbox even if it's not in the
entity it's just a form field
and I can check for it in the create service I tried to do that checking but
if it was completely ignored as if the condition has no existence so would
you please tell me how can I do that in my code? check if the check box is
checked or not.
is that available in minilang ?
can I use if compare or if compare field ?
if so how?
For sme reasons I dont want to use javascript.

Thanks again for your support
-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Checkbox-confirmation-tp2998649p2998879.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Checkbox confirmation

Posted by BJ Freeman <bj...@free-man.net>.
any form fields will be found in the context or  passed through the 
controller to Service or event. you can find many examples.
your service or event can then act on this and pass back to the 
controller a message that the controller then select the appropriate 
view from the message.
You can also use a java script that reads the page and field then 
decides to send the page to the controller.


=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Shereen sent the following on 10/16/2010 2:32 PM:
>
> Hi all
> I want to add a checkbox in the create quote screen like a confirmation box
> and the user shouldnt be able to
> Create the quote unless he checks it
> I added this line to the form EditeQuote
>          <field name="checkBox" title="Payment method and Dsicount
> checked"><check/></field>
>
> knowing that this field has NO existence in the quote entity. or I should
> add it to the entity?
>
> Plus I want to force the user to check it. I want to do that in the Create
> Quote simple service
> I want to do that by adding this condition to the conditions already
> existing
> can anyone guide me what's the right way to do so?
> can I use if compare and if compare field or they work only for fields
> existing in the quote entity?
>
>