You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by madhu <ma...@lntinfotech.com> on 2012/05/09 13:23:10 UTC

Re: Checkbox confirmation

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>.
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.