Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6032293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:18:45+00:00 2026-05-23T05:18:45+00:00

I’m struggling with it for some time with no results. I want data entered

  • 0

I’m struggling with it for some time with no results. I want data entered in a form and submitted to be rendered as a new row of a table being on the same page (without the page reload). What I currently have is an item model with several fields,
a controller with saveItem action:

public static void saveItem(@Valid SoldItem item) {...

, and of course the form:

<tr class="itemNew">
    <td>
        <input type="image" id="saveItem" name="&{'Save'}" alt="&{'Save'}" height="16" src="/public/images/001_06.png" form="itemsTable"/>
        <a href="#/cancelEdits"><image id="cancelEdits" src="/public/images/001_05.png" alt="&{'Cancel'}" title="&{'Cancel'}" height="16"></a>
    </td>

    <td>
        <div class="item">
            <input class="itemDesc" type="text" size="30" name="item.item.name" placeholder="&{'item.name'}" />
        </div>
        <div class="item">
            <textarea class="itemDesc" rows="2" cols="30" name="item.item.description" placeholder="&{'item.description'}" ></textarea>
        </div>
    </td>

….

with some JavaScript:

    this.post('#/saveItem', function (context) {
        var item_def = new Sammy.Object();
        context.log('saveItem - params = ' + this.params);
        context.log('saveItem - form_fields = {');
        //for ( var item in this.params.keys()) {
        var items = this.params.keys(true);
        for ( var i = 0; i < items.length; i++) {
            var item = items[i];
            context.log('item: ' + item);
            if(item.match(/^item\./)) {
                item_def[':'+ item] = this.params[item];
            }
        }
        context.log('}');
        context.log('item_def: ' + item_def);
        var action = #{jsAction @Invoices.saveItem(item_def) /};
        context.log('action: ' + action({item: item_def}));
        this.partial(action({item: item_def}));
    });

The latter is a Sammy.js fragment but this seems to be irrelevant to the case. What I get is totally nothing. Here is the sample of the last two log entries:

[Fri Jun 10 2011 01:30:51] item_def: Sammy.Object: {":item.item.name": aaa,":item.item.description": dsfsd,":item.retailPrice": dsfs,":item.rebate": sdf,":item.quantity": dsf,":item.vatRate": d,":item.notes": ds}
[Fri Jun 10 2011 01:30:51 ] action: /invoices/saveitem

The documentation of jsAction does not cover such issue, and I couldn’t find any example, so please help me with it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:18:46+00:00Added an answer on May 23, 2026 at 5:18 am

    So the solution I came up with is:

        this.post('#/saveItem', function (context) {
            var items = this.params.toHash();
            var action = #{jsAction @Invoices.saveItem() /};
            this.send($.post, action(), items)
                .then(function(contents) {
                    this.swap(contents);
                });
        });
    

    Some explanation I’ve found on the playframework group. When posting from a form there is no need to create full query URL. All the parameters should be sent as the post body. The above example shows use of Sammy.js framework (within Play! framework) and it works pretty well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm interested in microtypography issues on the web. I want a tool to fix:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.