Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Liferay Portlet: Form Actions

 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I am an absolute beginner so please excuse my ignorance on a lot of stuff.

I am having a problem when it comes to developing a simple webform in liferay. I was trying to create it normally as in HTML. I put a normal file URL in the action attribute of the form tag. As you may have guessed it did not work at all. So I did a little searching and found out that you have to use tag in the action attribute of the form. What I am not understanding is where do you put the actual URL of the file in there?
This is what I have so far...


Where do you put the URL? How do you do this?

Thanks for any response.
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please explain bit more what do you mean by "Where do you put the URL?"?
 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean.... I don't have an idea how the "actionURL" works. Normally in the form tag, you put a file URL in the action attribute. But convention in portlets dictates I use the actionURL, instead. I'm sorry if I'm too ignorant of this, but have a difficulty understanding Java Web development (newbie programmer). Particularly on Liferay portlets.
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basicly, what tag "<portlet:actionURL />" do is - it prints out url for you'r portlet actions target.

You can go and test this in this way:
 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But where does the URL come from?
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It comes from portlet API.
 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh... So in this case. It's from my "query.java" file? "query" is the name of my project.

So based on what I understand so far... it's supposed to be in the processAction?
The files I am modifying are the following:
- query_view.jsp - Automatically created. The view file.
- query.jsp - Created by me. This is what I want to be in the action attribute.
- query.java - Automatically created. This is where I saw the processAction.

I was trying to go for a simple user input webform that will go to my database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic