receiving null

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

receiving null

Pal Infocom Technologies-2
i have created a UI form using .ftl file. on clicking on the submit button i called a java service via controller. but when i try to access data in java file it receive null for fields except esns. here is code for ftl; and java file respectively. plz tell where am i wrong?
Thanx in advance


#assign numberofesns=0/>
<#if receivedItems?has_content>

<form name="selectForm" method="post" action="<@ofbizUrl>UpdateEsnNumbers</@ofbizUrl>" style="margin: 0;">

    <input type="hidden" name="facilityId" value="${requestParameters.facilityId?if_exists}"/>
                                               
    <#list receivedItems as item>
   
       
                                
                                <#assign numberofesns = numberofesns + 1/>
    </#list>
   
        <input type="hidden" name="esns" value="10" />
 
                             
<div class="head3">${uiLabelMap.ProductReceiptPurchaseOrder} #${purchaseOrder.orderId}</div>
<hr class="sepbar">
<div class="tableheadtext"><div class="head3">Inventory Item Id#</div><div class="tableheadtext"><div class="head3">Receipt Id#</div><div class="tableheadtext"><div class="head3">Product Id#</div><div class="tableheadtext"><div class="head3">Esn Numbers#</div>
<hr class="sepbar">
<div class="tabletext">${item.inventoryItemId}</div><div class="tabletext">${item.receiptId}</div><div class="tabletext">${item.productId?default("Not Found")}</div><div class="tabletext"><input type="text" size="30" name="${numberofesns}"/></div><div class="tabletext"><input type="hidden" name="id${numberofesns}" value=${item.inventoryItemId}/></div</td>
       
       
   
<hr class="sepbar">
           <input type="submit" name="submit" value="Submit"/>
       
  </form>
  <br/>
</#if>
Reply | Threaded
Open this post in threaded view
|

Re: receiving null

cjhowe
1st suggestion, use camelCase for variable names.  It's much easier to
read.

how large is the receivedItems list?
--- amit charaya <[hidden email]> wrote:

>
> i have created a UI form using .ftl file. on clicking on the submit
> button i
> called a java service via controller. but when i try to access data
> in java
> file it receive null for fields except esns. here is code for ftl;
> and java
> file respectively. plz tell where am i wrong?
> Thanx in advance
>
>
> #assign numberofesns=0/>
> <#if receivedItems?has_content>
>
> <form name="selectForm" method="post"
> action="<@ofbizUrl>UpdateEsnNumbers</@ofbizUrl>" style="margin: 0;">
>
>   <table width="100%" border="0" cellpadding="2" cellspacing="0">
>   <input type="hidden" name="facilityId"
> value="${requestParameters.facilityId?if_exists}"/>
>     <tr><td colspan="4"><div
> class="head3">${uiLabelMap.ProductReceiptPurchaseOrder}
> #${purchaseOrder.orderId}</div></td></tr>
>     <tr><td colspan="4"><hr class="sepbar"></td></tr>
>     <tr>
>       <td><div class="tableheadtext"><div class="head3">Inventory
> Item
> Id#</div></td>
>       <td><div class="tableheadtext"><div class="head3">Receipt
> Id#</div></td>
>       <td><div class="tableheadtext"><div class="head3">Product
> Id#</div></td>
>       <td><div class="tableheadtext"><div class="head3">Esn
> Numbers#</div></td>
>         <tr><td colspan="10"><hr class="sepbar"></td></tr>
>    
>     <#list receivedItems as item>
>    
>        
>         <tr>
>         <td><div class="tabletext">${item.inventoryItemId}</div></td>
>          <td><div class="tabletext">${item.receiptId}</div></td>
>        
>         <td><div class="tabletext">${item.productId?default("Not
> Found")}</div></td>
>         <td><div class="tabletext"><input type="text" size="30"
> name="${numberofesns}"/></div></td>
>         <td><div class="tabletext"><input type="hidden"
> name="id${numberofesns}" value=${item.inventoryItemId}/></div</td>
>        
>        
>     </tr>  
>       <#assign numberofesns = numberofesns + 1/>
>     </#list>
>    
>     <tr><td colspan="4"><hr class="sepbar"></td></tr>
>   <tr>
>   <input type="hidden" name="esns" value="10" />
>  
>         <td colspan="2">&nbsp;</td>
>         <td colspan="2">
>           <input type="submit" name="submit" value="Submit"/>
>         </td>
>       </tr>
>        </table>
>   </form>
>   <br/>
> </#if>
> --
> View this message in context:
> http://www.nabble.com/receiving-null-tf4003685.html#a11370827
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: receiving null

Pal Infocom Technologies-2
received item list is 30




cjhowe wrote
1st suggestion, use camelCase for variable names.  It's much easier to
read.

how large is the receivedItems list?
--- amit charaya <ofbiz@palinfocom.net> wrote:

>
> i have created a UI form using .ftl file. on clicking on the submit
> button i
> called a java service via controller. but when i try to access data
> in java
> file it receive null for fields except esns. here is code for ftl;
> and java
> file respectively. plz tell where am i wrong?
> Thanx in advance
>
>
> #assign numberofesns=0/>
> <#if receivedItems?has_content>
>
> <form name="selectForm" method="post"
> action="<@ofbizUrl>UpdateEsnNumbers</@ofbizUrl>" style="margin: 0;">
>
>   >   <input type="hidden" name="facilityId"
> value="${requestParameters.facilityId?if_exists}"/>
>     >     >     >       >       >       >       >         >    
>     <#list receivedItems as item>
>    
>        
>         >         >          >        
>         >         >           >       <#assign numberofesns = numberofesns + 1/>
>     </#list>
>    
>     >   >   <input type="hidden" name="esns" value="10" />
>  
>         >         >       >        
<div
> class="head3">${uiLabelMap.ProductReceiptPurchaseOrder}
> #${purchaseOrder.orderId}</div>
<hr class="sepbar">
<div class="tableheadtext"><div class="head3">Inventory
> Item
> Id#</div>
<div class="tableheadtext"><div class="head3">Receipt
> Id#</div>
<div class="tableheadtext"><div class="head3">Product
> Id#</div>
<div class="tableheadtext"><div class="head3">Esn
> Numbers#</div>
<hr class="sepbar">
<div class="tabletext">${item.inventoryItemId}</div><div class="tabletext">${item.receiptId}</div><div class="tabletext">${item.productId?default("Not
> Found")}</div>
<div class="tabletext"><input type="text" size="30"
> name="${numberofesns}"/></div>
<div class="tabletext"><input type="hidden"
> name="id${numberofesns}" value=${item.inventoryItemId}/></div</td>
>        
>        
>    
<hr class="sepbar">
 >           <input type="submit" name="submit" value="Submit"/>
>        
>   </form>
>   <br/>
> </#if>
> --
> View this message in context:
> http://www.nabble.com/receiving-null-tf4003685.html#a11370827
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: receiving null

Rodrigo Lima-2
In reply to this post by Pal Infocom Technologies-2
Which the error message? That variable that she is null?
Confirm variable list in service.xml of your application.


2007/6/30, amit charaya <[hidden email]>:

>
> i have created a UI form using .ftl file. on clicking on the submit button i
> called a java service via controller. but when i try to access data in java
> file it receive null. here is code for ftl; and java file respectively. plz
> tell where am i wrong?
> Thanx in advance
>
>
> #assign numberofesns=0/>
> <#if receivedItems?has_content>
>
> <form name="selectForm" method="post"
> action="<@ofbizUrl>UpdateEsnNumbers</@ofbizUrl>" style="margin: 0;">
>
>  <table width="100%" border="0" cellpadding="2" cellspacing="0">
>  <input type="hidden" name="facilityId"
> value="${requestParameters.facilityId?if_exists}"/>
>    <tr><td colspan="4"><div
> class="head3">${uiLabelMap.ProductReceiptPurchaseOrder}
> #${purchaseOrder.orderId}</div></td></tr>
>    <tr><td colspan="4"><hr class="sepbar"></td></tr>
>    <tr>
>      <td><div class="tableheadtext"><div class="head3">Inventory Item
> Id#</div></td>
>      <td><div class="tableheadtext"><div class="head3">Receipt
> Id#</div></td>
>      <td><div class="tableheadtext"><div class="head3">Product
> Id#</div></td>
>      <td><div class="tableheadtext"><div class="head3">Esn
> Numbers#</div></td>
>        <tr><td colspan="10"><hr class="sepbar"></td></tr>
>
>    <#list receivedItems as item>
>
>
>        <tr>
>        <td><div class="tabletext">${item.inventoryItemId}</div></td>
>         <td><div class="tabletext">${item.receiptId}</div></td>
>
>        <td><div class="tabletext">${item.productId?default("Not
> Found")}</div></td>
>        <td><div class="tabletext"><input type="text" size="30"
> name="${numberofesns}"/></div></td>
>        <td><div class="tabletext"><input type="hidden"
> name="id${numberofesns}" value=${item.inventoryItemId}/></div</td>
>
>
>    </tr>
>      <#assign numberofesns = numberofesns + 1/>
>    </#list>
>
>    <tr><td colspan="4"><hr class="sepbar"></td></tr>
>  <tr>
>  <input type="hidden" name="esns" value="10" />
>
>        <td colspan="2">&nbsp;</td>
>        <td colspan="2">
>          <input type="submit" name="submit" value="Submit"/>
>        </td>
>      </tr>
>       </table>
>  </form>
>  <br/>
> </#if>
> --
> View this message in context: http://www.nabble.com/receiving-null-tf4003685.html#a11370827
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>