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 7760131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:48:09+00:00 2026-06-01T13:48:09+00:00

I have a loop displaying records, and I want to add submit buttons to

  • 0

I have a loop displaying records, and I want to add submit buttons to all the rows. The reason they need to be submit is because there is a form at the bottom I would like to have persisted when the user selected one of the buttons.

I’ve seen the comments about using defer, etc, but nothing seems to work for me. The current submit code I’m trying is:

<input t:id="deleteItem" t:type="submit" t:context="item.number.content"   value="deleteItem" class="deleteItem" />

To expand on the context:
The current context I have listed, is just a string within the number object within the item object. In fact, it’s being displayed in the code above perfectly fine.

To test this differently, I’ve replace item.number.content with a getContext() method and had it return a hard-coded 1. I then debug this method and see it being called when the page is SUBMITTED, not when the page is rendered as I would have expected.

The context is never populated until after the button is pushed. Am I misunderstanding something??

Edit:

So my issue is with getting the context value. Take for instance my code:

<t:loop source="itemsList" value="item" formState="none">
<!-- Display info here -->
<input t:id="deleteItem" t:type="submit" t:context="myContext" value="deleteItem"    class="deleteItem" />  
</t:loop>

The definition for getMyContext is:

public String getMyContext() {
    String context = item.getNumber().getContent();
    return context;
}

The problem is, the method is not called until after the submit has been pressed at which time the variable “item” is null. I was expecting getMyContext to be called each time the submit button is rendered, and then when the submit is selected, the event would be triggered with the appropriate context. Does that make sense?

  • 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-06-01T13:48:10+00:00Added an answer on June 1, 2026 at 1:48 pm

    I finally figured out what my problem was:

    formState="none" 
    

    I originally did this because it was having trouble translating between my Objects and a String. When this is selected, the submit buttons don’t work properly. I ended up changing it to formState=”iteration” and now it is working exactly as I expected it to (and I needed the defer as expected too).

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

Sidebar

Related Questions

I have the following inside a foreach loop (displaying my various videos), I'm trying
I have to create a while loop displaying the integers from 1-20 but only
I have divs created within a while loop displaying a MySQL query. I'd like
I have an ul list with a query and a while loop displaying the
I have a while loop that is going through and displaying an RSS icon
There is a weird problem my while loop is not incrementing like its displaying
I have a for loop displaying XML data from the last.fm API. Im wanting
I have a for loop which actually displays a product name and several buttons
I have some table cells displaying different time. I want the time to be
i have php while loop, creates many classes, displaying info (user posts ect) and

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.