Problem wo loop WOHyperlink
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