Screen widget question

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

Screen widget question

Adrian Crum
Does anyone know how I can do the equivalent of java.lang.String.replaceAll(...) in the screen
widget? I need to remove some characters from a screen widget field and I don't know how.

-Adrian

Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

Rodrigo Lima-2
One sugestion:

<call-class-method class-name="org.ofbiz.base.util.StringUtil"
method-name="replaceAll" // rewrite
                ret-field-name="parameters.myFieldParameter">
                <field field-name="meyField"/>
 </call-class-method>

In service definition.

2007/8/10, Adrian Crum <[hidden email]>:
>
> Does anyone know how I can do the equivalent of
> java.lang.String.replaceAll(...) in the screen
> widget? I need to remove some characters from a screen widget field and I
> don't know how.
>
> -Adrian
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

Adrian Crum
I think that code is intended for mini-lang, not screen widgets.

Rodrigo Souza wrote:

> One sugestion:
>
> <call-class-method class-name="org.ofbiz.base.util.StringUtil"
> method-name="replaceAll" // rewrite
>                 ret-field-name="parameters.myFieldParameter">
>                 <field field-name="meyField"/>
>  </call-class-method>
>
> In service definition.
>
> 2007/8/10, Adrian Crum <[hidden email]>:
>
>>Does anyone know how I can do the equivalent of
>>java.lang.String.replaceAll(...) in the screen
>>widget? I need to remove some characters from a screen widget field and I
>>don't know how.
>>
>>-Adrian
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

Rodrigo Lima-2
Oks! Your app is mini-lang or bsh?

2007/8/10, Adrian Crum <[hidden email]>:

>
> I think that code is intended for mini-lang, not screen widgets.
>
> Rodrigo Souza wrote:
>
> > One sugestion:
> >
> > <call-class-method class-name="org.ofbiz.base.util.StringUtil"
> > method-name="replaceAll" // rewrite
> >                 ret-field-name="parameters.myFieldParameter">
> >                 <field field-name="meyField"/>
> >  </call-class-method>
> >
> > In service definition.
> >
> > 2007/8/10, Adrian Crum <[hidden email]>:
> >
> >>Does anyone know how I can do the equivalent of
> >>java.lang.String.replaceAll(...) in the screen
> >>widget? I need to remove some characters from a screen widget field and
> I
> >>don't know how.
> >>
> >>-Adrian
> >>
> >>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

Adrian Crum
I could use a bsh script, but I was trying to avoid that. I would have to create a bsh script that
is only one line long.

I've tried hacks like:

<actions>
   <set field="oldString" value="He went this way"/>
   <set field="replaceResult" value="bsh:newString = oldString.replaceAll('this', 'that')"/>
</actions>

I can't seem to get anything to do what I want. I end up with exceptions or empty strings.


Rodrigo Souza wrote:

> Oks! Your app is mini-lang or bsh?
>
> 2007/8/10, Adrian Crum <[hidden email]>:
>
>>I think that code is intended for mini-lang, not screen widgets.
>>
>>Rodrigo Souza wrote:
>>
>>
>>>One sugestion:
>>>
>>><call-class-method class-name="org.ofbiz.base.util.StringUtil"
>>>method-name="replaceAll" // rewrite
>>>                ret-field-name="parameters.myFieldParameter">
>>>                <field field-name="meyField"/>
>>> </call-class-method>
>>>
>>>In service definition.
>>>
>>>2007/8/10, Adrian Crum <[hidden email]>:
>>>
>>>
>>>>Does anyone know how I can do the equivalent of
>>>>java.lang.String.replaceAll(...) in the screen
>>>>widget? I need to remove some characters from a screen widget field and
>>
>>I
>>
>>>>don't know how.
>>>>
>>>>-Adrian
>>>>
>>>>
>>>
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

Rodrigo Lima-2
It?

     <set field="myField" type="String" value="${bsh:
org.ofbiz.StringUtil.replaceAll('this', 'that')}"/>



2007/8/10, Adrian Crum <[hidden email]>:

>
> I could use a bsh script, but I was trying to avoid that. I would have to
> create a bsh script that
> is only one line long.
>
> I've tried hacks like:
>
> <actions>
>    <set field="oldString" value="He went this way"/>
>    <set field="replaceResult" value="bsh:newString = oldString.replaceAll('this',
> 'that')"/>
> </actions>
>
> I can't seem to get anything to do what I want. I end up with exceptions
> or empty strings.
>
>
> Rodrigo Souza wrote:
>
> > Oks! Your app is mini-lang or bsh?
> >
> > 2007/8/10, Adrian Crum <[hidden email]>:
> >
> >>I think that code is intended for mini-lang, not screen widgets.
> >>
> >>Rodrigo Souza wrote:
> >>
> >>
> >>>One sugestion:
> >>>
> >>><call-class-method class-name="org.ofbiz.base.util.StringUtil"
> >>>method-name="replaceAll" // rewrite
> >>>                ret-field-name="parameters.myFieldParameter">
> >>>                <field field-name="meyField"/>
> >>> </call-class-method>
> >>>
> >>>In service definition.
> >>>
> >>>2007/8/10, Adrian Crum <[hidden email]>:
> >>>
> >>>
> >>>>Does anyone know how I can do the equivalent of
> >>>>java.lang.String.replaceAll(...) in the screen
> >>>>widget? I need to remove some characters from a screen widget field
> and
> >>
> >>I
> >>
> >>>>don't know how.
> >>>>
> >>>>-Adrian
> >>>>
> >>>>
> >>>
> >>>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Screen widget question

jonwimp
In reply to this post by Adrian Crum
Adrian,

Try value="${bsh: blah; blah;}" ? I've done that in widget forms.

Jonathon

Adrian Crum wrote:

> I could use a bsh script, but I was trying to avoid that. I would have
> to create a bsh script that is only one line long.
>
> I've tried hacks like:
>
> <actions>
>   <set field="oldString" value="He went this way"/>
>   <set field="replaceResult" value="bsh:newString =
> oldString.replaceAll('this', 'that')"/>
> </actions>
>
> I can't seem to get anything to do what I want. I end up with exceptions
> or empty strings.
>
>
> Rodrigo Souza wrote:
>
>> Oks! Your app is mini-lang or bsh?
>>
>> 2007/8/10, Adrian Crum <[hidden email]>:
>>
>>> I think that code is intended for mini-lang, not screen widgets.
>>>
>>> Rodrigo Souza wrote:
>>>
>>>
>>>> One sugestion:
>>>>
>>>> <call-class-method class-name="org.ofbiz.base.util.StringUtil"
>>>> method-name="replaceAll" // rewrite
>>>>                ret-field-name="parameters.myFieldParameter">
>>>>                <field field-name="meyField"/>
>>>> </call-class-method>
>>>>
>>>> In service definition.
>>>>
>>>> 2007/8/10, Adrian Crum <[hidden email]>:
>>>>
>>>>
>>>>> Does anyone know how I can do the equivalent of
>>>>> java.lang.String.replaceAll(...) in the screen
>>>>> widget? I need to remove some characters from a screen widget field
>>>>> and
>>>
>>> I
>>>
>>>>> don't know how.
>>>>>
>>>>> -Adrian
>>>>>
>>>>>
>>>>
>>>>
>>
>
>