• Post Reply Bookmark Topic Watch Topic
  • New Topic

why i can not use f:param inside an html form? what is the solution for it?  RSS feed

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
what is wrong with the following code ?
[code]

<form action="https://www.3rdpartyWeb.com/CardServices/controller"
method="GET" enctype="multipart/form-data"
name="submissionform">
<f:param value="#{Session.MID}" name="MID" id="MID"/>
<f:param value="#{ButtonsActionListener.reservationNumber}"
name="ResNum" id="ResNum"/>
<f:param value="#{Session.redirectURL}" name="RedirectURL"
id="RedirectURL"/>
<f:param value="#{ButtonsActionListener.total_price}" name="Amount"
id="Amount"/>

</form>
<SCRIPT type="text/javascript">
document.forms["submissionform"].submit();
</SCRIPT>

[code]

while both ButtonsActionListener , Session are managed beans ,
my question is , does the above form will post correctly to the named
url along with parameters ?
if not , how i can make this possible , i should say that i submit the
form using javascript and no user interaction should be involved.

do i used a correct design for this ?
I should say that : i used some java script to show a progress bar in
this page until the page submit to 3rd party web site.

what is a correct design for this kind of requirements ?
thanks
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is wrong with the following code ?

i cannot say whats wrong, if you dont tell me whats happening when the code runs. does it work as intended (or) does it give you errors?
 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in this code , the form submit as i used javascript , but none of parameters are included in form submission.
I looked at the html code that is generated and i find that none of those param stuff included in the form tag.

thanks
 
Denise Smith
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the jsf form component(not a web form) and apply the action to the Submit button the jsf button has the ability to pass parameters
 
Sajan Patel
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working for me if I use param inside commandLink


This is completely jsf base jsp so it may not work for you.
[ October 05, 2006: Message edited by: Sajan Patel ]
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
f:param is not intented for this use. Use f:attribute within an UICommand element instead.
Also see http://balusc.xs4all.nl/srv/dev-jep-com.html
[ October 09, 2006: Message edited by: B L Scholtz ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!