Re: freemarker binding issue .

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Tuesday, August 2, 2011, 1:01:10 PM, Magatapalli, Sarat wrote:

> Thanks Daniel . I agree with your statement .
> Is there way to increment a freemarker variable within a javascript function ?

Re-read my earlier answer, and it should be clear that it doesn't make
sense. If it isn't then you need to look into how HTTP and the Web in
general works, the request-response things and so on. Traditionally
user interaction is handled by re-loading the whole web page when the
user clicks on something. Nowadays you can contact the server with
AJAX instead and change only parts of the page (like with JQuery), but
the request-response/client-server modell applies to that too.

-- 
Best regards,
 Daniel Dekany


> Example of my FTL :
> 0)  <#assign row=0 />
>  
> 1)  <@spring.bind "wccJobRecords.detailContent[${row}].accentity" />
> <input type="text" size = "30"  maxlength= "30"  id="Entity_0" 
> name="${spring.status.expression}"
> value="${spring.status.value?default("")}" />
>  
>    2) Call addWccRow javascript function.
>  
>    3) function addWccRow(.......){
> <#assign row=row+1 />
>  
> But when access the row variable in step 1 , it return 0 only , but
> I am expecting it to incremented .I think this is problem with scope of variables .
> I tried with global also it did not work.
>  
> I am very new to freemaker , please help me to resolve this issue .
>
> Regards,
> Sarat 
>  
> -----Original Message-----
> From: Daniel Dekany [mailto:[email protected]] 
> Sent: Tuesday, August 02, 2011 4:09 PM
> To: Magatapalli, Sarat
> Cc: [email protected]
> Subject: Re: [FreeMarker-user] freemarker binding issue .
>  
> Tuesday, August 2, 2011, 7:38:52 AM, Magatapalli, Sarat wrote:
>  
>> One more question :
>>  
>> Can I use Javascript variable in a FREEMARKER expression
>>  
>> Example :
>> <script language="javascript">
>>  
>> Var row=1;
>> ${report(row)}
>  
> The question doesn't make sense this way. FreeMarker runs on the
> server, generates the HTML page that has no FreeMarker markup in it
> anymore, sends it to the client computer, then the JavaScript runs
> on the client computer in the Web browser.
>  
>> </script>
>> I tried use it but it failed , any other option to do ?
>> -----Original Message-----
>> From: Daniel Dekany [mailto:[email protected]]
>> Sent: Monday, August 01, 2011 4:04 PM
>> To: Magatapalli, Sarat
>> Cc: [email protected]
>> Subject: Re: [FreeMarker-user] freemarker binding issue .
>>  
>> Wrong mailing list I suppose. It sounds like a Spring question.
>> Anyway, I don't know Spring MVC Controller, but if the name of those 
>> repeated fields are the same, certainly you should just receive an 
>> array or List instead of a single value, so maybe you should declare 
>> the target bean property(?) as such.
>>  
>>  
>> Monday, August 1, 2011, 9:21:17 AM, Magatapalli, Sarat wrote:
>>  
>>> Team ,
>>>  
>>> I have question/issue with freemarker binding . As per our 
>>> requirement I need to insert a NEW ROW in a table when the user clicks on “ADD NEW” button .
>>>  
>>> Step1 : So when the user clicks on “Add MORE” button I inserting a 
>>> new row within a table , I am handling this using javascript Step 2: 
>>> When user clicks on the submit button ,  I Need to send the values 
>>> entered by user to my Controller (Spring MVC Controller) .
>>>  
>>> So how can binding the values to controller dynamically ?
>>>  
>>> My page looks like below : 
>>>  
>>> Please help me to resolve this issue ASAP .
>>> Regards,
>>> Sarat
>>  
>> --
>> Best regards,
>> Daniel Dekany
>>  
>> This message w/attachments (message) is intended solely for the use of 
>> the intended recipient(s) and may contain information that is 
>> privileged, confidential or proprietary. If you are not an intended 
>> recipient, please notify the sender, and then please delete and 
>> destroy all copies and attachments, and be advised that any review or 
>> dissemination of, or the taking of any action in reliance on, the 
>> information contained in or attached to this message is prohibited.
>> Unless specifically indicated, this message is not an offer to sell or 
>> a solicitation of any investment products or other financial product 
>> or service, an official confirmation of any transaction, or an 
>> official statement of Sender. Subject to applicable law, Sender may 
>> intercept, monitor, review and retain e-communications (EC) traveling 
>> through its networks/systems and may produce any such EC to 
>> regulators, law enforcement, in litigation and as required by law.
>> The laws of the country of each sender/recipient may impact the 
>> handling of EC, and EC may be archived, supervised and produced in 
>> countries other than the country in which you are located. This 
>> message cannot be guaranteed to be secure or free of errors or 
>> viruses. Attachments that are part of this EC may have additional 
>> important disclosures and disclaimers, which you should read. By 
>> messaging with Sender you consent to the foregoing.
> --
> Best regards,
> Daniel Dekany
>  
> This message w/attachments (message) is intended solely for the use
> of the intended recipient(s) and may contain information that is
> privileged, confidential or proprietary. If you are not an intended
> recipient, please notify the sender, and then please delete and
> destroy all copies and attachments, and be advised that any review
> or dissemination of, or the taking of any action in reliance on, the
> information contained in or attached to this message is prohibited. 
> Unless specifically indicated, this message is not an offer to sell
> or a solicitation of any investment products or other financial
> product or service, an official confirmation of any transaction, or
> an official statement of Sender. Subject to applicable law, Sender
> may intercept, monitor, review and retain e-communications (EC)
> traveling through its networks/systems and may produce any such EC
> to regulators, law enforcement, in litigation and as required by law.
> The laws of the country of each sender/recipient may impact the
> handling of EC, and EC may be archived, supervised and produced in
> countries other than the country in which you are located. This
> message cannot be guaranteed to be secure or free of errors or
> viruses. Attachments that are part of this EC may have additional
> important disclosures and disclaimers, which you should read. By
> messaging with Sender you consent to the foregoing.


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.