• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem wo loop WOHyperlink
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem wo loop WOHyperlink


  • Subject: Problem wo loop WOHyperlink
  • From: Hugo Cambero <email@hidden>
  • Date: Fri, 13 Jul 2012 16:52:02 -0500

Hi Everybody

I'm Hugo,
I've been developing using WebObjects and Wonder Frameworks, I'm newbie in this topic.

I have a problem and I hope you can help me. I'm developing a test application, I want to display a list of ERXGenericRecord, but, in the last column,
I want to display a picture that can delete the selected row.

Example:


ID       NAME        LASTNAME       USERNAME          ACTIONS

120     Hugo          Perez                sun13                   delete
160     Aaron         Anthony            aaron12                 delete

If the user clicks the delete picture of the first row, the application deletes the record 120.

I'm trying to do it using the next code:


<table>

      <tr>   
         <td>ID</TD>
         <td>Name</td>
         <td>Lastname</td>
         <td>Username</td>
         <td>Actions</td>
      </tr>
      <wo:loop list="$allUsers" item="$entryItem">
      <tr>   
            <td>
                  <wo:str value="$entryItem.primaryKey" />
            </td>
            <td>
                  <wo:str value="$entryItem.name" />
            </td>
            <td>
                  <wo:str value="$entryItem.lastname" />
            </td>
            <td>
                  <wo:str value="$entryItem.username" />
            </td>
            <td>
                  <webobject name = "DeleteLink" >                       
                        <webobject name = "DeleteImage"/>
                  </webobject>   
           </td>                           
     </tr>
     </wo:loop>
</table>
---------------------------
DeleteLink : WOHyperlink {
    directActionName="
deleteRecord";
}

DeleteImage : WOImage {
    filename = "css/img/boton/delete.png";
    mimeType="image/gif";
}
--------------------------
package your.app.components;

import your.app.model.User;
import com.webobjects.appserver.WOContext;
import com.webobjects.foundation.NSArray;
import er.extensions.components.ERXComponent;
import er.extensions.eof.ERXEC;

public class AdminPage extends ERXComponent {
    private User entryItem;
   
    public AdminPage(WOContext context) {
        super(context);
    }

    public User entryItem() {
        return entryItem;       
    }

    public void setEntryItem(User entryItem) {
        this.entryItem = entryItem;
    }
   
    public NSArray<User> allUsers() {
        return User.fetchAllUsers( ERXEC.newEditingContext() );       
    }
}

I think, I can solve this problem, adding a key or data in GET method in the 'Delete Link', but, I don't know.
What do you recommend me?

What is the best way to do this exercise?

Thanks!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem wo loop WOHyperlink
      • From: Chuck Hill <email@hidden>
    • Re: Problem wo loop WOHyperlink
      • From: Paul Hoadley <email@hidden>
  • Prev by Date: Re: ant woes. The framework name 'WOOgnl' does not exist.
  • Next by Date: Re: Migrating from EOF to Cayenne
  • Previous by thread: Re: ERPatcher Framework Proposal
  • Next by thread: Re: Problem wo loop WOHyperlink
  • Index(es):
    • Date
    • Thread