Quantcast

Comparison Issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Comparison Issue

MG 2016
Hi There,

I started using the Free Marker today.

 
<#if record.quantity?length == 2>

The above seems to be false. When I switch this to !=2 it seems to be OK. I just want to show a bit of text when the quantity is 2

What I'm I doing incorrectly?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Daniel Dekany
It should work like that, so the only thing I can think of is that the
length is indeed not 2.

BTW, this mailing list has been retired months ago. There's
[hidden email] instead (see
http://freemarker.incubator.apache.org/mailing-lists.html). Where did
you find the old address?

--
Thanks,
 Daniel Dekany


Wednesday, January 27, 2016, 6:01:31 PM, MG 2016 wrote:

> Hi There,
>
> I started using the Free Marker today.
>
>         <#if record.quantity?length == 2>
>
> The above seems to be false. When I switch this to !=2 it seems to be OK. I
> just want to show a bit of text when the quantity is 2
>
> What I'm I doing incorrectly?
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Lee
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Lee
What kind of data type is record.quantity?

If record.quantity is a list (array), use <#if record.quantity?size == 2> (http://freemarker.incubator.apache.org/docs/ref_builtins_sequence.html#ref_builtin_size)

If record.quantity is a string, use <#if record.quantity?length == 2>

If record.quantity is an integer, use <#if record.quantity == 2>

On Wed, Jan 27, 2016 at 11:46 AM, Daniel Dekany <[hidden email]> wrote:
It should work like that, so the only thing I can think of is that the
length is indeed not 2.

BTW, this mailing list has been retired months ago. There's
[hidden email] instead (see
http://freemarker.incubator.apache.org/mailing-lists.html). Where did
you find the old address?

--
Thanks,
 Daniel Dekany


Wednesday, January 27, 2016, 6:01:31 PM, MG 2016 wrote:

> Hi There,
>
> I started using the Free Marker today.
>
>         <#if record.quantity?length == 2>
>
> The above seems to be false. When I switch this to !=2 it seems to be OK. I
> just want to show a bit of text when the quantity is 2
>
> What I'm I doing incorrectly?
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Daniel Dekany
That's good point, though ?length on a non-list(ish) value will give
an error instead of a non-2 value.


Wednesday, January 27, 2016, 9:51:14 PM, Lee wrote:

> What kind of data type is record.quantity?
>
> If record.quantity is a list (array), use <#if record.quantity?size
> == 2>
> (http://freemarker.incubator.apache.org/docs/ref_builtins_sequence.html#ref_builtin_size)
>
> If record.quantity is a string, use <#if record.quantity?length == 2>
>
> If record.quantity is an integer, use <#if record.quantity == 2>
>
> On Wed, Jan 27, 2016 at 11:46 AM, Daniel Dekany <[hidden email]> wrote:
> It should work like that, so the only thing I can think of is that the
> length is indeed not 2.
>
> BTW, this mailing list has been retired months ago. There's
> [hidden email] instead (see
> http://freemarker.incubator.apache.org/mailing-lists.html). Where did
> you find the old address?
>
> --
> Thanks,
>  Daniel Dekany
>
>
> Wednesday, January 27, 2016, 6:01:31 PM, MG 2016 wrote:
>
>> Hi There,
>>
>> I started using the Free Marker today.
>>
>>         <#if record.quantity?length == 2>
>>
>> The above seems to be false. When I switch this to !=2 it seems to be OK. I
>> just want to show a bit of text when the quantity is 2
>>
>> What I'm I doing incorrectly?
>>
>>
>>
>> --
>> View this message in context:
>> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606.html
>> Sent from the freemarker-devel mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Daniel Dekany
Eh... I mean, ?size on a non-list(ish) value gives error. As of
?length, that gives error on non-string values, although if someone
uses pure BeansWrapper instead of DefaultObjectWrapper, listable
things can be also strings.


Wednesday, January 27, 2016, 10:33:22 PM, Daniel Dekany wrote:

> That's good point, though ?length on a non-list(ish) value will give
> an error instead of a non-2 value.
>
>
> Wednesday, January 27, 2016, 9:51:14 PM, Lee wrote:
>
>> What kind of data type is record.quantity?
>>
>> If record.quantity is a list (array), use <#if record.quantity?size
>> == 2>
>> (http://freemarker.incubator.apache.org/docs/ref_builtins_sequence.html#ref_builtin_size)
>>
>> If record.quantity is a string, use <#if record.quantity?length == 2>
>>
>> If record.quantity is an integer, use <#if record.quantity == 2>
>>
>> On Wed, Jan 27, 2016 at 11:46 AM, Daniel Dekany <[hidden email]> wrote:
>> It should work like that, so the only thing I can think of is that the
>> length is indeed not 2.
>>
>> BTW, this mailing list has been retired months ago. There's
>> [hidden email] instead (see
>> http://freemarker.incubator.apache.org/mailing-lists.html). Where did
>> you find the old address?
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>>
>> Wednesday, January 27, 2016, 6:01:31 PM, MG 2016 wrote:
>>
>>> Hi There,
>>>
>>> I started using the Free Marker today.
>>>
>>>         <#if record.quantity?length == 2>
>>>
>>> The above seems to be false. When I switch this to !=2 it seems to be OK. I
>>> just want to show a bit of text when the quantity is 2
>>>
>>> What I'm I doing incorrectly?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606.html
>>> Sent from the freemarker-devel mailing list archive at Nabble.com.
>>>
>>> ------------------------------------------------------------------------------
>>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>>> Monitor end-to-end web transactions and take corrective actions now
>>> Troubleshoot faster and improve end-user experience. Signup Now!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>>> _______________________________________________
>>> FreeMarker-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

MG 2016
In reply to this post by MG 2016
Thanks for getting back.

I am still trying to work out the exact type of quantity. I assumed it was an int because the out put on the form is always an int. I am trying to generate a PDF within NetSuite ERP.

None of these seem to work for me. But I can see the text if I use !=

<#if record.quantity?size ==14>TEST</#if>
<#if record.quantity?length==14>TEST</#if>
<#if record.quantity ==14>TEST</#if>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Daniel Dekany
If it's a number then you need "record.quantity == 14". The others
(?size an ?length) should give you an error, as number has no size or
length. Do they not? Something strange is going on there... do they
suppress FreeMarker errors and output nothing? If quantity is a string
that looks like a number, then you should also get an error (for
comparing a string to a number), but then you could use
"record.quantity?number == 14". (BTW, you can easily try these
scenarios on http://freemarker-online.kenshoo.com/)


Wednesday, January 27, 2016, 11:17:05 PM, MG 2016 wrote:

> Thanks for getting back.
>
> I am still trying to work out the exact type of quantity. I assumed it was
> an int because the out put on the form is always an int. I am trying to
> generate a PDF within NetSuite ERP.
>
> None of these seem to work for me. But I can see the text if I use !=
>
> <#if record.quantity?size ==14>TEST</#if>
> <#if record.quantity?length==14>TEST</#if>
> <#if record.quantity ==14>TEST</#if>
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606p4655611.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

MG 2016
Hi Daniel,

I sorted the integer issue out but this one is driving me crazy! I can't see to get two divs floating across each other and show text. This code works fine in normal html pages but not using free marker! Any ideas? The text Test is not displayed.

<?xml version="1.0" ?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
    <head>
       <style type="text/css">
  #details {
    background-color: lightblue;
    width: 50%;
    height: 100px;
  }
  
  #summary {
    background-color: red;
    width: 50%;
    height: 100px;
  }

</style>
</head>

<body>
  <div id="details" style="float:left; display:inline"> <span>test</span> </div>
  <div id="summary" style="float:left; display:inline"> <span>test</span> </div>
    </body>
</pdf>

On Thu, Jan 28, 2016 at 1:18 AM, Daniel Dekany [via FreeMarker] <[hidden email]> wrote:
If it's a number then you need "record.quantity == 14". The others
(?size an ?length) should give you an error, as number has no size or
length. Do they not? Something strange is going on there... do they
suppress FreeMarker errors and output nothing? If quantity is a string
that looks like a number, then you should also get an error (for
comparing a string to a number), but then you could use
"record.quantity?number == 14". (BTW, you can easily try these
scenarios on http://freemarker-online.kenshoo.com/)


Wednesday, January 27, 2016, 11:17:05 PM, MG 2016 wrote:

> Thanks for getting back.
>
> I am still trying to work out the exact type of quantity. I assumed it was
> an int because the out put on the form is always an int. I am trying to
> generate a PDF within NetSuite ERP.
>
> None of these seem to work for me. But I can see the text if I use !=
>
> <#if record.quantity?size ==14>TEST</#if>
> <#if record.quantity?length==14>TEST</#if>
> <#if record.quantity ==14>TEST</#if>
>
>
>
> --

> View this message in context:
> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606p4655611.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel



If you reply to this email, your message will be added to the discussion below:
http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606p4655612.html
To unsubscribe from Comparison Issue, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comparison Issue

Daniel Dekany
It's the browser that does those things (interpreting HTML and CSS),
so it's not related to FreeMarker. The HTML that you generate with
FreeMarker must differ from the one that has worked in some relevant
way. If you generate the same HTML with FreeMarker, it will look
exactly the same.


Wednesday, February 3, 2016, 5:14:19 PM, MG 2016 wrote:

> Hi Daniel,
>
> I sorted the integer issue out but this one is driving me crazy! I
> can't see to get two divs floating across each other and show text.
> This code works fine in normal html pages but not using free marker!
> Any ideas? The text Test is not displayed.
>
> <?xml version="1.0" ?>
> <!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
> <pdf>
> Â  Â  <head>
> Â  Â  Â  Â <style type="text/css">
> Â  #details {
> Â  Â  background-color: lightblue;
> Â  Â  width: 50%;
> Â  Â  height: 100px;
> Â  }
> Â Â
> Â  #summary {
> Â  Â  background-color: red;
> Â  Â  width: 50%;
> Â  Â  height: 100px;
> Â  }
>
> </style>
> </head>
>
> <body>
> Â  <div id="details" style="float:left; display:inline"> <span>test</span> </div>
> Â  <div id="summary" style="float:left; display:inline"> <span>test</span> </div>
> Â  Â  </body>
> </pdf>
>
> On Thu, Jan 28, 2016 at 1:18 AM, Daniel Dekany [via FreeMarker] <[hidden email]> wrote:
> If it's a number then you need "record.quantity == 14". The others
> (?size an ?length) should give you an error, as number has no size or
> length. Do they not? Something strange is going on there... do they
> suppress FreeMarker errors and output nothing? If quantity is a string
> that looks like a number, then you should also get an error (for
> comparing a string to a number), but then you could use
> "record.quantity?number == 14". (BTW, you can easily try these
> scenarios on http://freemarker-online.kenshoo.com/)
>
>
> Wednesday, January 27, 2016, 11:17:05 PM, MG 2016 wrote:
>
>> Thanks for getting back.
>>
>> I am still trying to work out the exact type of quantity. I assumed it was
>> an int because the out put on the form is always an int. I am trying to
>> generate a PDF within NetSuite ERP.
>>
>> None of these seem to work for me. But I can see the text if I use !=
>>
>> <#if record.quantity?size ==14>TEST</#if>
>> <#if record.quantity?length==14>TEST</#if>
>> <#if record.quantity ==14>TEST</#if>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Loading...