groovy screen widget

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

groovy screen widget

Varun Bhansaly
Hi,
I am using ofbiz 09.04, facing an issue with groovy & screen widget.
my screen widget action contains -
<set field="*andCondition*" value="*${groovy: return
org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual", "Y")}*
" />
In my groovy script *andCondition *is an instanceof *String* (isVirtual = Y)
instead of *EntityCondition*.

*What could be possibly wrong, am i missing something ?
*
--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Scott Gray-2
What are there asterisks everywhere in your code?
Why aren't you just creating the condition in groovy?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 19/06/2010, at 4:23 AM, varun bhansaly wrote:

> Hi,
> I am using ofbiz 09.04, facing an issue with groovy & screen widget.
> my screen widget action contains -
> <set field="*andCondition*" value="*${groovy: return
> org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual", "Y")}*
> " />
> In my groovy script *andCondition *is an instanceof *String* (isVirtual = Y)
> instead of *EntityCondition*.
>
> *What could be possibly wrong, am i missing something ?
> *
> --
> Regards,
> Varun Bhansaly


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Atul Vani
In reply to this post by Varun Bhansaly
hi Varun,

try using 'type' attribute
<set field="foo" value="${groovy: ...}" type="..."/>

--
Thanks & Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.


varun bhansaly wrote:

> Hi,
> I am using ofbiz 09.04, facing an issue with groovy & screen widget.
> my screen widget action contains -
> <set field="*andCondition*" value="*${groovy: return
> org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual", "Y")}*
> " />
> In my groovy script *andCondition *is an instanceof *String* (isVirtual = Y)
> instead of *EntityCondition*.
>
> *What could be possibly wrong, am i missing something ?
> *
>  
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Varun Bhansaly
Hi Atul,
Thanks for ur reply.
I had already tried that with type = "Object", it still does not work, still
seen as instanceof String.

Hi Scott,
There are no asterisks, for the post i had replaced &quot; with ".


On Sat, Jun 19, 2010 at 10:08 AM, Atul Vani <[hidden email]>wrote:

> hi Varun,
>
> try using 'type' attribute
> <set field="foo" value="${groovy: ...}" type="..."/>
>
> --
> Thanks & Regards
> Atul Vani
> Enterprise Software Developer
> HotWax Media Pvt. Ltd.
> http://www.hotwaxmedia.com/
> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for
> yourself.
>
>
> varun bhansaly wrote:
>
>> Hi,
>> I am using ofbiz 09.04, facing an issue with groovy & screen widget.
>> my screen widget action contains -
>> <set field="*andCondition*" value="*${groovy: return
>> org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual",
>> "Y")}*
>> " />
>> In my groovy script *andCondition *is an instanceof *String* (isVirtual =
>> Y)
>> instead of *EntityCondition*.
>>
>> *What could be possibly wrong, am i missing something ?
>> *
>>
>>
>


--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Varun Bhansaly
Hi Scott,
I have already put the groovy part in a .groovy file, though just wanted to
know if i had missed something.
Thanks again.

On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly <[hidden email]>wrote:

> Hi Atul,
> Thanks for ur reply.
> I had already tried that with type = "Object", it still does not work,
> still seen as instanceof String.
>
> Hi Scott,
> There are no asterisks, for the post i had replaced &quot; with ".
>
>
>
> On Sat, Jun 19, 2010 at 10:08 AM, Atul Vani <[hidden email]>wrote:
>
>> hi Varun,
>>
>> try using 'type' attribute
>> <set field="foo" value="${groovy: ...}" type="..."/>
>>
>> --
>> Thanks & Regards
>> Atul Vani
>> Enterprise Software Developer
>> HotWax Media Pvt. Ltd.
>> http://www.hotwaxmedia.com/
>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for
>> yourself.
>>
>>
>> varun bhansaly wrote:
>>
>>> Hi,
>>> I am using ofbiz 09.04, facing an issue with groovy & screen widget.
>>> my screen widget action contains -
>>> <set field="*andCondition*" value="*${groovy: return
>>> org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual",
>>> "Y")}*
>>> " />
>>> In my groovy script *andCondition *is an instanceof *String* (isVirtual =
>>> Y)
>>> instead of *EntityCondition*.
>>>
>>> *What could be possibly wrong, am i missing something ?
>>> *
>>>
>>>
>>
>
>
> --
> Regards,
> Varun Bhansaly
>



--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Scott Gray-2
Hi Varun,

But I don't understand why you don't just create the entity condition in the groovy file:
isVirtualCondition = org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual", "Y")

Why try and create a condition in the screen widget when it is easier to do it in the groovy file itself?

Regards
Scott

On 19/06/2010, at 7:29 PM, varun bhansaly wrote:

> Hi Scott,
> I have already put the groovy part in a .groovy file, though just wanted to
> know if i had missed something.
> Thanks again.
>
> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly <[hidden email]>wrote:
>
>> Hi Atul,
>> Thanks for ur reply.
>> I had already tried that with type = "Object", it still does not work,
>> still seen as instanceof String.
>>
>> Hi Scott,
>> There are no asterisks, for the post i had replaced &quot; with ".
>>
>>
>>
>> On Sat, Jun 19, 2010 at 10:08 AM, Atul Vani <[hidden email]>wrote:
>>
>>> hi Varun,
>>>
>>> try using 'type' attribute
>>> <set field="foo" value="${groovy: ...}" type="..."/>
>>>
>>> --
>>> Thanks & Regards
>>> Atul Vani
>>> Enterprise Software Developer
>>> HotWax Media Pvt. Ltd.
>>> http://www.hotwaxmedia.com/
>>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for
>>> yourself.
>>>
>>>
>>> varun bhansaly wrote:
>>>
>>>> Hi,
>>>> I am using ofbiz 09.04, facing an issue with groovy & screen widget.
>>>> my screen widget action contains -
>>>> <set field="*andCondition*" value="*${groovy: return
>>>> org.ofbiz.entity.condition.EntityCondition.makeCondition("isVirtual",
>>>> "Y")}*
>>>> " />
>>>> In my groovy script *andCondition *is an instanceof *String* (isVirtual =
>>>> Y)
>>>> instead of *EntityCondition*.
>>>>
>>>> *What could be possibly wrong, am i missing something ?
>>>> *
>>>>
>>>>
>>>
>>
>>
>> --
>> Regards,
>> Varun Bhansaly
>>
>
>
>
> --
> Regards,
> Varun Bhansaly


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

james_sg
In reply to this post by Varun Bhansaly
Hi Varun,

What you had wanted to do will work if you are using 10.04.
So coding it in groovy file is the right approach when using 9.04

Regards,
James

<quote author="Varun Bhansaly">
Hi Scott,
I have already put the groovy part in a .groovy file, though just wanted to
know if i had missed something.
Thanks again.

On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly <vbhansaly@gmail.com>wrote:

> Hi Atul,
> Thanks for ur reply.
> I had already tried that with type = "Object", it still does not work,
> still seen as instanceof String.
>
> Hi Scott,
> There are no asterisks, for the post i had replaced " with ".
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Scott Gray-2
I would argue that using groovy is the right approach regardless of the version.  Screen actions are intended to speed up simple tasks, they are not a substitute for actual scripting.  Especially when you consider that whenever you try and do something complicated with them you end up spending more time debugging than if you had just put your logic in a script in the first place.

Regards
Scott

On 21/06/2010, at 6:24 PM, james_sg wrote:

>
> Hi Varun,
>
> What you had wanted to do will work if you are using 10.04.
> So coding it in groovy file is the right approach when using 9.04
>
> Regards,
> James
>
>
> Hi Scott,
> I have already put the groovy part in a .groovy file, though just wanted to
> know if i had missed something.
> Thanks again.
>
> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly <[hidden email]>wrote:
>
>> Hi Atul,
>> Thanks for ur reply.
>> I had already tried that with type = "Object", it still does not work,
>> still seen as instanceof String.
>>
>> Hi Scott,
>> There are no asterisks, for the post i had replaced &quot; with ".
>>
>>
>>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262179.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

james_sg
Hi Scott,

I agree. In my special case, I was backporting the ajax lookup code from 10.04 to 9.04, and encountered the problem where the "set field" function gives a String instead of the EntityCondition object. So if I were to use the makeCondition function, many extra groovy files will be created.

Regards,
James

Scott Gray-2 wrote
I would argue that using groovy is the right approach regardless of the version.  Screen actions are intended to speed up simple tasks, they are not a substitute for actual scripting.  Especially when you consider that whenever you try and do something complicated with them you end up spending more time debugging than if you had just put your logic in a script in the first place.

Regards
Scott

On 21/06/2010, at 6:24 PM, james_sg wrote:

>
> Hi Varun,
>
> What you had wanted to do will work if you are using 10.04.
> So coding it in groovy file is the right approach when using 9.04
>
> Regards,
> James
>
>
> Hi Scott,
> I have already put the groovy part in a .groovy file, though just wanted to
> know if i had missed something.
> Thanks again.
>
> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly <vbhansaly@gmail.com>wrote:
>
>> Hi Atul,
>> Thanks for ur reply.
>> I had already tried that with type = "Object", it still does not work,
>> still seen as instanceof String.
>>
>> Hi Scott,
>> There are no asterisks, for the post i had replaced " with ".
>>
>>
>>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262179.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


 
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Jacques Le Roux
Administrator
Hi James,

Did you succeed with this backporting?
If yes you might coinsider to contribute a patch even if it will not be commited (only bugs)
I'm quite sure a number of persons would appreciate...

Thanks

Jacques

From: "james_sg" <[hidden email]>

>
> Hi Scott,
>
> I agree. In my special case, I was backporting the ajax lookup code from
> 10.04 to 9.04, and encountered the problem where the "set field" function
> gives a String instead of the EntityCondition object. So if I were to use
> the makeCondition function, many extra groovy files will be created.
>
> Regards,
> James
>
>
> Scott Gray-2 wrote:
>>
>> I would argue that using groovy is the right approach regardless of the
>> version.  Screen actions are intended to speed up simple tasks, they are
>> not a substitute for actual scripting.  Especially when you consider that
>> whenever you try and do something complicated with them you end up
>> spending more time debugging than if you had just put your logic in a
>> script in the first place.
>>
>> Regards
>> Scott
>>
>> On 21/06/2010, at 6:24 PM, james_sg wrote:
>>
>>>
>>> Hi Varun,
>>>
>>> What you had wanted to do will work if you are using 10.04.
>>> So coding it in groovy file is the right approach when using 9.04
>>>
>>> Regards,
>>> James
>>>
>>>
>>> Hi Scott,
>>> I have already put the groovy part in a .groovy file, though just wanted
>>> to
>>> know if i had missed something.
>>> Thanks again.
>>>
>>> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly
>>> <[hidden email]>wrote:
>>>
>>>> Hi Atul,
>>>> Thanks for ur reply.
>>>> I had already tried that with type = "Object", it still does not work,
>>>> still seen as instanceof String.
>>>>
>>>> Hi Scott,
>>>> There are no asterisks, for the post i had replaced &quot; with ".
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262179.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
>>  
>>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262209.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

james_sg
Hi Jacques,

I am sorry that I couldn't get the time for making a patch.

Those interested may want to start looking at htmlTemplate.ftl and trace from there.

Regards,
James

Jacques Le Roux wrote
Hi James,

Did you succeed with this backporting?
If yes you might coinsider to contribute a patch even if it will not be commited (only bugs)
I'm quite sure a number of persons would appreciate...

Thanks

Jacques

From: "james_sg" <snowmedal@hotmail.com>
>
> Hi Scott,
>
> I agree. In my special case, I was backporting the ajax lookup code from
> 10.04 to 9.04, and encountered the problem where the "set field" function
> gives a String instead of the EntityCondition object. So if I were to use
> the makeCondition function, many extra groovy files will be created.
>
> Regards,
> James
>
>
> Scott Gray-2 wrote:
>>
>> I would argue that using groovy is the right approach regardless of the
>> version.  Screen actions are intended to speed up simple tasks, they are
>> not a substitute for actual scripting.  Especially when you consider that
>> whenever you try and do something complicated with them you end up
>> spending more time debugging than if you had just put your logic in a
>> script in the first place.
>>
>> Regards
>> Scott
>>
>> On 21/06/2010, at 6:24 PM, james_sg wrote:
>>
>>>
>>> Hi Varun,
>>>
>>> What you had wanted to do will work if you are using 10.04.
>>> So coding it in groovy file is the right approach when using 9.04
>>>
>>> Regards,
>>> James
>>>
>>>
>>> Hi Scott,
>>> I have already put the groovy part in a .groovy file, though just wanted
>>> to
>>> know if i had missed something.
>>> Thanks again.
>>>
>>> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly
>>> <vbhansaly@gmail.com>wrote:
>>>
>>>> Hi Atul,
>>>> Thanks for ur reply.
>>>> I had already tried that with type = "Object", it still does not work,
>>>> still seen as instanceof String.
>>>>
>>>> Hi Scott,
>>>> There are no asterisks, for the post i had replaced " with ".
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262179.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
>>  
>>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262209.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: groovy screen widget

Varun Bhansaly
In reply to this post by james_sg
Hi James,
This is exactly the same reason why i posted this in first place wen i was
backporting ajax autocomplete (successfully).
but I do agree with Scott as well.
Thanks.

On Mon, Jun 21, 2010 at 12:38 PM, james_sg <[hidden email]> wrote:

>
> Hi Scott,
>
> I agree. In my special case, I was backporting the ajax lookup code from
> 10.04 to 9.04, and encountered the problem where the "set field" function
> gives a String instead of the EntityCondition object. So if I were to use
> the makeCondition function, many extra groovy files will be created.
>
> Regards,
> James
>
>
> Scott Gray-2 wrote:
> >
> > I would argue that using groovy is the right approach regardless of the
> > version.  Screen actions are intended to speed up simple tasks, they are
> > not a substitute for actual scripting.  Especially when you consider that
> > whenever you try and do something complicated with them you end up
> > spending more time debugging than if you had just put your logic in a
> > script in the first place.
> >
> > Regards
> > Scott
> >
> > On 21/06/2010, at 6:24 PM, james_sg wrote:
> >
> >>
> >> Hi Varun,
> >>
> >> What you had wanted to do will work if you are using 10.04.
> >> So coding it in groovy file is the right approach when using 9.04
> >>
> >> Regards,
> >> James
> >>
> >>
> >> Hi Scott,
> >> I have already put the groovy part in a .groovy file, though just wanted
> >> to
> >> know if i had missed something.
> >> Thanks again.
> >>
> >> On Sat, Jun 19, 2010 at 12:56 PM, varun bhansaly
> >> <[hidden email]>wrote:
> >>
> >>> Hi Atul,
> >>> Thanks for ur reply.
> >>> I had already tried that with type = "Object", it still does not work,
> >>> still seen as instanceof String.
> >>>
> >>> Hi Scott,
> >>> There are no asterisks, for the post i had replaced " with ".
> >>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262179.html
> >> Sent from the OFBiz - User mailing list archive at Nabble.com.
> >
> >
> >
> >
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/groovy-screen-widget-tp2260470p2262209.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>



--
Regards,
Varun Bhansaly