Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Seeya S Kudtarker
Liferay <portlet:actionURL>
March 10, 2013 11:51 PM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

In my jsp I have the following code:

<portlet:actionURL name="addDetails" var="addDetailsURL" />

<aui:form name="addDetails" action="<%=addDetailsURL.toString() %>" method="post" >
<aui:input type="text" label="name:" name="name" value="" />
<aui:input type="text" label="surname:" name="surname" value="" />
<aui:input type="text" label="age:" name="age" value="" />

<aui:button type="submit" value="addDetails" />


</aui:form>



I want to submit this data which will be processed in a java class. my java class has few functions. how should I specify in the above jsp that it should access the particular function in java after submitting the form?


Sounds silly but I am confused..


One more question: how does actionURL resolve the namepsace. I mean how does it know which function in java class it should go to..
Kowbathullah Gnaniyar
RE: Liferay <portlet:actionURL>
March 11, 2013 12:20 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 605

Join Date: December 19, 2007

Recent Posts

You have to go through the ACTION / RENDER URL behaviors in Portlet life cycle

Action URL calls processAction of your portlet
Render URL calls render / View Method

When you submit the Action URL, it will go and check the processAction method of your portlet class which you have defined in portlet.xml

<portlet-class>
com.my.package.CustomPortlet
</portlet-class>
kumar E
RE: Liferay <portlet:actionURL>
March 11, 2013 12:20 AM
Answer

kumar E

Rank: Junior Member

Posts: 64

Join Date: October 3, 2012

Recent Posts

hi seeya
by default when u call the <portlet:actionURL/>in your jsp it will hit to the processaction() function in your java class

now you r using
<portlet:actionURL name="addDetails" var="addDetailsURL" />.

when you r using name="addDetails" attribute in u'r actionurl it will hit to the addDetails() function
so you are suppose to create addDetails() in your java class

Regards,
vinod
Seeya S Kudtarker
RE: Liferay <portlet:actionURL>
March 11, 2013 12:27 AM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

Thanks Vinod!!

That was great help!! emoticon It cleared my doubts!! emoticon