Form Action not resolving

2 views
Skip to first unread message

Rahul

unread,
Apr 7, 2009, 6:05:54 AM4/7/09
to rife-users
From my login page, after successful login, i have a search page.
On sucessful login I do

newTemplate = getHtmlTemplate("search");

to get the search page.

On the search page I am doing something like this

<form name="search" action="[!V 'SUBMISSION:FORM:search'/]"
method="get">
<span[!V 'MARK:criteria'][!/V]>Search Criteria</span>
<input type="text" name="search" value="${v PARAM:search}${/v}" /><br /
><br />

<input type="submit" value="Search" /><br />

</form>

the problem is action is not resloving to search action.
On clicking the search button i get something like this

http://localhost:8080/rife-jumpstart/[!V%20'SUBMISSION:FORM:search'/]?search=

Some enlightment needed.... :) considering the fact that i am a newbie
to this stuff

Geert Bevin

unread,
Apr 7, 2009, 6:08:30 AM4/7/09
to rife-...@googlegroups.com
For forms to be auto-generated, you need to have a submission bean
registered with that element or you have to call generateForm
explicitly. See the docs here: http://rifers.org/wiki/display/RIFE/Forms
--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Flytecase Band - http://flytecase.be
Music and words - http://gbevin.com

Rahul

unread,
Apr 7, 2009, 6:42:21 AM4/7/09
to rife-users
thanks Geert for your reply.... taking the first option that you
suggested
of registering the submission bean with that element.. i tried it with

<submission name="search">
<bean name="search" classname="hotelbooking.elements.SearchCriteria"/
>
<!-- <param name="search"/>-->
</submission>

defined under that element.

I am getting this error:-

com.uwyn.rife.engine.exceptions.EngineException: The template value
'SUBMISSION:PARAMS:search'
nor 'SUBMISSION:PARAMSJS:search'are not present.
Replacement of the template value 'SUBMISSION:FORM:search' alone is
not sufficient.


Talking about the second option of using generateForm

In my login class just after successful authentication I tried with

generateForm(newTemplate, user);

i still get the same thing

http://localhost:8080/rife-jumpstart/[!V%20'SUBMISSION:FORM:search'/]?search=

:(
> Terracotta -http://www.terracotta.org
> Uwyn "Use what you need" -http://uwyn.com

Geert Bevin

unread,
Apr 7, 2009, 6:52:59 AM4/7/09
to rife-...@googlegroups.com
That error message says exactly what you need to do, you need to
include those value tags so that RIFE can generate the hidden form
parameters it needs.

On 07 Apr 2009, at 12:42, Rahul wrote:

>
> thanks Geert for your reply.... taking the first option that you
> suggested
> of registering the submission bean with that element.. i tried it with
>
> <submission name="search">
> <bean name="search"
> classname="hotelbooking.elements.SearchCriteria"/
>>
> <!-- <param name="search"/>-->
> </submission>
>
> defined under that element.
>
> I am getting this error:-
>
> com.uwyn.rife.engine.exceptions.EngineException: The template value
> 'SUBMISSION:PARAMS:search'
> nor 'SUBMISSION:PARAMSJS:search'are not present.
> Replacement of the template value 'SUBMISSION:FORM:search' alone is
> not sufficient.
>
>
> Talking about the second option of using generateForm
>
> In my login class just after successful authentication I tried with
>
> generateForm(newTemplate, user);
>
> i still get the same thing
>

Rahul

unread,
Apr 7, 2009, 7:00:39 AM4/7/09
to rife-users
yes, but where exactly and how i can include those value tags?

Geert Bevin

unread,
Apr 7, 2009, 7:03:22 AM4/7/09
to rife-...@googlegroups.com
Anywhere within the <form> ... </form> tags, they will be replaced
with hidden params. Just add them as value tags in the template.

Rahul

unread,
Apr 7, 2009, 10:17:57 AM4/7/09
to rife-users
Yes Geert , I got it working.

Here comes another issue.. :)

I am fetching records from db and displaying those on the template
like this:-

<td><r:v name="name"/></td>
<td><r:v name="address"/></td>
<td><r:v name="description"/></td>
<td><a href="show?id=${v hotel_id/}">View Hotel</a></td>
<td><a href="edit?id=${v hotel_id/}">Edit Hotel</a></td>
<td><a href="delete?id=${v hotel_id/}">Delete Hotel</a></td>

Here i am passing the hotel_id to perform the desired action like
viewing the hotel for that particular hotel_id or edit or delete.

I am not getting as to where i need to these actions show, edit or
delete
for that matter. Or may be my approach is wrong.

Please guide me through this.
Reply all
Reply to author
Forward
0 new messages