Displaying records from DB

5 views
Skip to first unread message

Rahul

unread,
Apr 8, 2009, 11:00:54 PM4/8/09
to rife-users
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.

Rahul

unread,
Apr 9, 2009, 12:30:34 AM4/9/09
to rife-users
I am trying with

<a href="${v SUBMISSION:QUERY:show/}${v hotel_id/}">View Hotel</a> for

<a href="show?id=${v hotel_id/}">View Hotel</a>

with doShow function defined, but i am not able to catch the hotel_id
in the
function. How can i pass this parameter from the page?

Geert Bevin

unread,
Apr 9, 2009, 1:05:33 AM4/9/09
to rife-...@googlegroups.com
Hi Rahul,

I'm not going to spend time replying to this since it's documented in
the User's Guide, the small examples, the full blown example
projects, ... Please take some time going through the material on the
website and read up on the basics.

Best regards,

Geert
--
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 9, 2009, 5:48:34 AM4/9/09
to rife-users
Hi Geert, after spending my time searching around, I am not able to
pass the parameter

<td><a href="${v SUBMISSION:QUERY:show/}#${v hotel_id/}">View Hotel</
a></td>


and accessing it through

int id = getParameterInt("hotel_id");

It always shows me 0.

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

Geert Bevin

unread,
Apr 9, 2009, 5:51:10 AM4/9/09
to rife-...@googlegroups.com
Read up on query parameters in a URL

Rahul

unread,
Apr 9, 2009, 6:05:27 AM4/9/09
to rife-users
SUBMISSION:QUERY:name says that it is replaced by the url to activate
the corresponding submission, all data will be passed through an
automatically constructed query string.

The query string generated in my case is :-

/rife-jumpstart/?submission=show&submissioncontext=Lg%3D%3D9

here the last digit 9 is the actual id that i am trying to pass by
this

<a href="${v SUBMISSION:QUERY:show/}#${v hotel_id/}">View Hotel

not sure how can i get that in my class.

Geert Bevin

unread,
Apr 9, 2009, 6:07:56 AM4/9/09
to rife-...@googlegroups.com
Rahul, honestly, read the docs and examples, it's all explained in
there. You're using an URL anchor instead of a query string parameter
to pass the hotel ID. That part is just standard HTTP stuff, has
nothing to do with RIFE.

Rahul

unread,
Apr 9, 2009, 7:37:51 AM4/9/09
to rife-users
Well well.....

getParameter(name) from com.uwyn.rife.engine.ElementSupport

doesnt gave me the parameters from the query url.

However using
setProhibitRawAccess(false)
getHttpServletRequest().getParameter("hotel_id")

gave me the parameter value....

I dont have the reason for this... may be Geert you can add the
reasons to this.

Thanks

Geert Bevin

unread,
Apr 9, 2009, 7:44:17 AM4/9/09
to rife-...@googlegroups.com
READ ... THE ... DOCS

I'm not going to waste more time replying to you about this.

On 09 Apr 2009, at 13:37, Rahul wrote:

>
> Well well.....
>
> getParameter(name) from com.uwyn.rife.engine.ElementSupport
>
> doesnt gave me the parameters from the query url.
>
> However using
> setProhibitRawAccess(false)
> getHttpServletRequest().getParameter("hotel_id")
>
> gave me the parameter value....
>
> I dont have the reason for this... may be Geert you can add the
> reasons to this.

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

gabriel munteanu

unread,
Apr 9, 2009, 9:02:12 AM4/9/09
to rife-...@googlegroups.com
Geert, you did enough , don't bother any more, i will take it from here.
let him be.

jgabios
--
jgabios
http://bash.editia.info

Rahul

unread,
Apr 9, 2009, 9:08:00 AM4/9/09
to rife-users
Hey guys.... just chill..... I am very new to this stuff so i am
getting these issues.
These issues must be irritating for you guys.... but for me it stands
as it is...

Anyways... somehow I got out of this issue.

Catch you guys with some other if I get one.

Thanks


On Apr 9, 6:02 pm, gabriel munteanu <jajali...@gmail.com> wrote:
> Geert, you did enough , don't bother any more, i will take it from here.
> let him be.
>
> jgabios
>
>
>
> On Thu, Apr 9, 2009 at 2:44 PM, Geert Bevin <gbe...@uwyn.com> wrote:
>
> > READ ... THE ... DOCS
>
> > I'm not going to waste more time replying to you about this.
>
> > On 09 Apr 2009, at 13:37, Rahul wrote:
>
> >> Well well.....
>
> >> getParameter(name) from com.uwyn.rife.engine.ElementSupport
>
> >> doesnt gave me the parameters from the query url.
>
> >> However using
> >> setProhibitRawAccess(false)
> >> getHttpServletRequest().getParameter("hotel_id")
>
> >> gave me the parameter value....
>
> >> I dont have the reason for this... may be Geert you can add the
> >> reasons to this.
>
> > --
> > 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
>
> --
> jgabioshttp://bash.editia.info
Reply all
Reply to author
Forward
0 new messages