Apache OFBiz development

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

Apache OFBiz development

                                                              <#elseif "TELECOM_NUMBER" = mechMap.contactMechTypeId?if_exists>
               

Thanks to anyone that can pointing out this issue.



Warning : Noob in training
Wicus
Hi,

Working through the Apache OFBiz development : The Beginner's Tutorial, I'm experiencing the following error when trying to update the User-Interface (when creating a new enitity) as explained on pages 39 - 41.

Error rendering included template at location [component://party/webapp/partymgr/party/editcontactmech.ftl]: freemarker.core.ParseException: Encountered ">" at line 185, column 127 in component://party/webapp/partymgr/party/editcontactmech.ftl. Was expecting one of: "}" ... "." ... "[" ... "(" ... "?" ... "!" ...  ... "??" ... "+" ... "-" ... "*" ... "/" ... "%" ... "!=" ... "=" ... "==" ... ">=" ...  ... ">" ...  ...  ...  ... ".." ...  ...  ...


Line 185 only goes to column count 116.... and is as follows:-


<input type="text" size="30" maxlength="100" name="planet" value="${(mechMap.postalAddress.planet)!"}">



Herewith a snippet from my editcontactmech.ftl

   
${uiLabelMap.PartyIsUsps}<#if isUsps>${uiLabelMap.CommonY}<#else>${uiLabelMap.CommonN}</#if>
     
Planet                        <input type="text" size="30" maxlength="100" name="planet" value="${(mechMap.postalAddress.planet)!"}">
               
${uiLabelMap.PartyPhoneNumber}        <input type="text" size="4" maxlength="10" name="countryCode" value="${(mechMap.telecomNumber.countryCode)?default(request.getParameter('countryCode')?if_exists)}">
        - <input type="text" size="4" maxlength="10" name="areaCode" value="${(mechMap.telecomNumber.areaCode)?default(request.getParameter('areaCode')?if_exists)}">
        - <input type="text" size="15" maxlength="15" name="contactNumber" value="${(mechMap.telecomNumber.contactNumber)?default(request.getParameter('contactNumber')?if_exists)}">
         ${uiLabelMap.PartyContactExt} <input type="text" size="6" maxlength="10" name="extension" value="${(mechMap.partyContactMech.extension)?default(request.getParameter('extension')?if_exists)}">
     
Reply | Threaded
Open this post in threaded view
|

Re: Apache OFBiz development

santosh malviya-2
Hello Wicus,

<input type="text" size="30" maxlength="100" name="planet"
value="${(mechMap.postalAddress.planet)!"}">

In this line you have included extra double quote(") before } so remove it and give it a try...



Wicus wrote:

> Hi,
>
> Working through the Apache OFBiz development : The Beginner's Tutorial, I'm
> experiencing the following error when trying to update the User-Interface
> (when creating a new enitity) as explained on pages 39 - 41.
>
> Error rendering included template at location
> [component://party/webapp/partymgr/party/editcontactmech.ftl]:
> freemarker.core.ParseException: Encountered ">" at line 185, column 127 in
> component://party/webapp/partymgr/party/editcontactmech.ftl. Was expecting
> one of: "}" ... "." ... "[" ... "(" ... "?" ... "!" ...  ... "??" ... "+"
> ... "-" ... "*" ... "/" ... "%" ... "!=" ... "=" ... "==" ... ">=" ...  ...
> ">" ...  ...  ...  ... ".." ...  ...  ...
>
>
> Line 185 only goes to column count 116.... and is as follows:-
>
>
> <input type="text" size="30" maxlength="100" name="planet"
> value="${(mechMap.postalAddress.planet)!"}">
>
>
>
> Herewith a snippet from my editcontactmech.ftl
>
>     <tr>
>       <td class="label">${uiLabelMap.PartyIsUsps}</td>
>       <td><#if
> isUsps>${uiLabelMap.CommonY}<#else>${uiLabelMap.CommonN}</#if>
>       </td>
>     </tr>
>     <tr>
> <td class="label">Planet</td>
> <td>
> <input type="text" size="30" maxlength="100" name="planet"
> value="${(mechMap.postalAddress.planet)!"}">
> </td>
> </tr>
>   <#elseif "TELECOM_NUMBER" = mechMap.contactMechTypeId?if_exists>
>     <tr>
>       <td class="label">${uiLabelMap.PartyPhoneNumber}</td>
>       <td>
>         <input type="text" size="4" maxlength="10" name="countryCode"
> value="${(mechMap.telecomNumber.countryCode)?default(request.getParameter('countryCode')?if_exists)}">
>         -&nbsp;<input type="text" size="4" maxlength="10" name="areaCode"
> value="${(mechMap.telecomNumber.areaCode)?default(request.getParameter('areaCode')?if_exists)}">
>         -&nbsp;<input type="text" size="15" maxlength="15"
> name="contactNumber"
> value="${(mechMap.telecomNumber.contactNumber)?default(request.getParameter('contactNumber')?if_exists)}">
>         &nbsp;${uiLabelMap.PartyContactExt}&nbsp;<input type="text" size="6"
> maxlength="10" name="extension"
> value="${(mechMap.partyContactMech.extension)?default(request.getParameter('extension')?if_exists)}">
>       </td>
>
>
> Thanks to anyone that can pointing out this issue.
>
>
>
> Warning : Noob in training :working:
>  
--
Thanks and Regards
Santosh Malviya
Enterprise Software Developer
Hotwax Media Inc.
Indore(M.P.) India
Mobile : +91 9977650914


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

Re: Apache OFBiz development

Roel Veldhuizen
In reply to this post by Wicus
<input type="text" size="30" maxlength="100" name="planet"
value="${(mechMap.postalAddress.planet)!"}">

should be

<input type="text" size="30" maxlength="100" name="planet"
value="${(mechMap.postalAddress.planet)!}">



2009/1/19 Wicus <[hidden email]>:

>
> Hi,
>
> Working through the Apache OFBiz development : The Beginner's Tutorial, I'm
> experiencing the following error when trying to update the User-Interface
> (when creating a new enitity) as explained on pages 39 - 41.
>
> Error rendering included template at location
> [component://party/webapp/partymgr/party/editcontactmech.ftl]:
> freemarker.core.ParseException: Encountered ">" at line 185, column 127 in
> component://party/webapp/partymgr/party/editcontactmech.ftl. Was expecting
> one of: "}" ... "." ... "[" ... "(" ... "?" ... "!" ...  ... "??" ... "+"
> ... "-" ... "*" ... "/" ... "%" ... "!=" ... "=" ... "==" ... ">=" ...  ...
> ">" ...  ...  ...  ... ".." ...  ...  ...
>
>
> Line 185 only goes to column count 116.... and is as follows:-
>
>
> <input type="text" size="30" maxlength="100" name="planet"
> value="${(mechMap.postalAddress.planet)!"}">
>
>
>
> Herewith a snippet from my editcontactmech.ftl
>
>    <tr>
>      <td class="label">${uiLabelMap.PartyIsUsps}</td>
>      <td><#if
> isUsps>${uiLabelMap.CommonY}<#else>${uiLabelMap.CommonN}</#if>
>      </td>
>    </tr>
>    <tr>
>                <td class="label">Planet</td>
>                <td>
>                        <input type="text" size="30" maxlength="100" name="planet"
> value="${(mechMap.postalAddress.planet)!"}">
>                </td>
>        </tr>
>  <#elseif "TELECOM_NUMBER" = mechMap.contactMechTypeId?if_exists>
>    <tr>
>      <td class="label">${uiLabelMap.PartyPhoneNumber}</td>
>      <td>
>        <input type="text" size="4" maxlength="10" name="countryCode"
> value="${(mechMap.telecomNumber.countryCode)?default(request.getParameter('countryCode')?if_exists)}">
>        -&nbsp;<input type="text" size="4" maxlength="10" name="areaCode"
> value="${(mechMap.telecomNumber.areaCode)?default(request.getParameter('areaCode')?if_exists)}">
>        -&nbsp;<input type="text" size="15" maxlength="15"
> name="contactNumber"
> value="${(mechMap.telecomNumber.contactNumber)?default(request.getParameter('contactNumber')?if_exists)}">
>        &nbsp;${uiLabelMap.PartyContactExt}&nbsp;<input type="text" size="6"
> maxlength="10" name="extension"
> value="${(mechMap.partyContactMech.extension)?default(request.getParameter('extension')?if_exists)}">
>      </td>
>
>
> Thanks to anyone that can pointing out this issue.
>
>
>
> Warning : Noob in training :working:
> --
> View this message in context: http://www.nabble.com/Apache-OFBiz-development-tp21541727p21541727.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Apache OFBiz development

Wicus
In reply to this post by Wicus
When changing the statement to:


<input type="text" size="30" maxlength="100" name="planet" value="${(mechMap.postalAddress.<b>planet)}">


Ofbiz is happier, yet does not display as expected. (Please refer to attached pic)

Entity.jpeg

Warning : Noob in training

Reply | Threaded
Open this post in threaded view
|

Re: Apache OFBiz development

santosh malviya-2
Hello Wicus,
Actually you are getting error in second input box of missing "!"
(if_exists) at the end of value and should be like.

<input type="text" size="30" maxlength="100" name="planet"
value="${(mechMap.postalAddress.planet)!}">



Wicus wrote:

> When changing the statement to:
>
>
> <input type="text" size="30" maxlength="100" name="planet"
> value="${(mechMap.postalAddress.planet)}">
>
>
> Ofbiz is happier, yet does not display as expected. (Please refer to
> attached pic)
>
> http://www.nabble.com/file/p21541933/Entity.jpeg Entity.jpeg
>
> Warning : Noob in training :working:
>
>
>  
--
Thanks and Regards
Santosh Malviya
Enterprise Software Developer
Hotwax Media Inc.
Indore(M.P.) India
Mobile : +91 9977650914


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

Re: Apache OFBiz development

Wicus
In reply to this post by santosh malviya-2
Thanks for the reply guys.

Though it does display now, the specific text box already has "(mechMap.postalAddress.planet)!" within it... where it should actually wait for user input before writing to / reading from the database...





The entity definition was created within \applications\party\entitydef\entitymodel.xml as

<field name="planet" type="name"></field>

within the <entity entity-name="PostalAddress"
                  package-name="org.ofbiz.party.contact"
                  title="Postal Address Entity">

and above the </entity> line

thereby adding a new field named planet to the data entity PostalAddress

If I'm correct in the abovementioned, why is my text box reflecting the (mechMap.postalAddress.planet)!  ???

Thanks for any advice once again.

Wicus
Reply | Threaded
Open this post in threaded view
|

Re: Apache OFBiz development

Wicus
In reply to this post by santosh malviya-2
Thanks once again to all whom replied to my query.

It is really appreciated.

The errata has been already submitted to http://www.packtpub.com/support/book/apache-ofbiz-development-beginners-tutorial

and is as follows:-

page 41 Code 19 Nov 08

Under the heading 'Editing the User-Interface', in the code line: value="${mechMap.postalAddress.planet)!"}">
the second double-quote and the exclamation mark should not be present.
This code should read:
value="${(mechMap.postalAddress.planet)}">