You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by su2 <sh...@pexsupply.com> on 2009/09/29 16:28:14 UTC

Java Class

Hello Friends,

I have a form - myForm.xml 
 
I want to create following field in myForm.xml

<field name="subTotal" title="${uiLabelMap.mySubTotal}">
            <display
description="${bsh:org.ofbiz.my.my.MyHelper.getSubTotal(myOrderNo)}"/>
</field>

For this I want to create java class - getSubTotal()

Where I want to pass current orderno and get subtotal(=itemsubtotal +
shipping charges)

for that I want to create a SQL query in my java class - getSubTotal()

SELECT (itemsubtotal+shippingCharges) as subTotal FROM myTable where orderNo
= $(mypassedOrderNo);

Is this possible to do in java class?

If yes, can somebody guide me?

Thank you for the help in advance.

Su-





-- 
View this message in context: http://www.nabble.com/Java-Class-tp25663962p25663962.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Java Class

Posted by Sumit Pandit <su...@hotwaxmedia.com>.
Hi Su,	
	This is possible in java, you can find many java classes in OFBiz  
where various calculation are done based on many query, for example -  
ShoppingCart.java, PosTransaction.java and few are in Accounting  
component.
--
Regards
Sumit Pandit


On 29-Sep-09, at 7:58 PM, su2 wrote:

>
> Hello Friends,
>
> I have a form - myForm.xml
>
> I want to create following field in myForm.xml
>
> <field name="subTotal" title="${uiLabelMap.mySubTotal}">
>            <display
> description="${bsh:org.ofbiz.my.my.MyHelper.getSubTotal(myOrderNo)}"/>
> </field>
>
> For this I want to create java class - getSubTotal()
>
> Where I want to pass current orderno and get subtotal(=itemsubtotal +
> shipping charges)
>
> for that I want to create a SQL query in my java class - getSubTotal()
>
> SELECT (itemsubtotal+shippingCharges) as subTotal FROM myTable where  
> orderNo
> = $(mypassedOrderNo);
>
> Is this possible to do in java class?
>
> If yes, can somebody guide me?
>
> Thank you for the help in advance.
>
> Su-
>
>
>
>
>
> -- 
> View this message in context: http://www.nabble.com/Java-Class-tp25663962p25663962.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


Re: Java Class

Posted by su2 <sh...@pexsupply.com>.
Hi Adrian,

But I would like to have it in a java class instead of services as i need to
do lot of data manipulation which is i think not possible in services.


Adrian Crum wrote:
> 
> Typically, data queries are put in services (so they can be reused) and 
> then the service is called by the form's actions element.
> 
> -Adrian
> 
> su2 wrote:
>> Hello Friends,
>> 
>> I have a form - myForm.xml 
>>  
>> I want to create following field in myForm.xml
>> 
>> <field name="subTotal" title="${uiLabelMap.mySubTotal}">
>>             <display
>> description="${bsh:org.ofbiz.my.my.MyHelper.getSubTotal(myOrderNo)}"/>
>> </field>
>> 
>> For this I want to create java class - getSubTotal()
>> 
>> Where I want to pass current orderno and get subtotal(=itemsubtotal +
>> shipping charges)
>> 
>> for that I want to create a SQL query in my java class - getSubTotal()
>> 
>> SELECT (itemsubtotal+shippingCharges) as subTotal FROM myTable where
>> orderNo
>> = $(mypassedOrderNo);
>> 
>> Is this possible to do in java class?
>> 
>> If yes, can somebody guide me?
>> 
>> Thank you for the help in advance.
>> 
>> Su-
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Java-Class-tp25663962p25667055.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Java Class

Posted by Adrian Crum <ad...@hlmksw.com>.
Typically, data queries are put in services (so they can be reused) and 
then the service is called by the form's actions element.

-Adrian

su2 wrote:
> Hello Friends,
> 
> I have a form - myForm.xml 
>  
> I want to create following field in myForm.xml
> 
> <field name="subTotal" title="${uiLabelMap.mySubTotal}">
>             <display
> description="${bsh:org.ofbiz.my.my.MyHelper.getSubTotal(myOrderNo)}"/>
> </field>
> 
> For this I want to create java class - getSubTotal()
> 
> Where I want to pass current orderno and get subtotal(=itemsubtotal +
> shipping charges)
> 
> for that I want to create a SQL query in my java class - getSubTotal()
> 
> SELECT (itemsubtotal+shippingCharges) as subTotal FROM myTable where orderNo
> = $(mypassedOrderNo);
> 
> Is this possible to do in java class?
> 
> If yes, can somebody guide me?
> 
> Thank you for the help in advance.
> 
> Su-
> 
> 
> 
> 
>