URL Param + ManagedBean + form submit Question

Hey,
I have a managed bean and configured the bean so that i takes params from the url and sets them automatically. The bean parameter is a integer value.
So when i call samplePage.faces?param1=23 then the bean takes the parameter from the url and i can query the database and present the result. That works perfekt
My problem is now the following:
On this page i have a form and some input tags to edit values, and now i want to submit the form and update the record in the database. (The record is identified by the url param)
But when i submit my form i got a java.lang.IllegalArgumentException - java.lang.IllegalArgumentException exception.
I thing that is because the action of the form has this parameter not ( action=samplePage.faces without my param) and when the bean tries to get the param from the url, which is not existing, then the exception is thrown.
Any suggestions what i can do?

i assume you have 2 managed beans that are in request scope. one bean for the overview page, one for the details page.
overview page:
create the link with the h:outputlink component which has one nested h:outputtext (the link text) and several nested f:param components. that means, you write one f:param for every parameter you want to pass to your details page. in your example, this would be only the id.
... so now you click the link ...
details page:
the id-parameter is available in the field "myId" in your details bean via this entry in faces-config.xml:
<managed-bean>
          <managed-bean-name>details</managed-bean-name>
          <managed-bean-class>com.DetailsBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <property-name>myId</property-name>
               <value>#{param.id}</value>
          </managed-property>
     </managed-bean>In DetailsBean, first you have to retrieve the data from the database. This could be done in the constructor or in a method annotated with @PostConstruct.
Also, save the id in a h:inputhidden. You will need the id again in the next step.
... now the user edits the data and presses submit ...
(All Parameters are lost at this point.) In your action, read the id from the h:inputhidden field. Now you have everything to update your database entry.

Similar Messages

  • Url called from form question

    HELP! I created a form that allows the user to enter a number (SEATPLAN). The code below is executed on a custom PL/SQL button. It does not seem to work. The url generated runs fine typed directly into the url of a browser. But the called url from the form just brings up a blank browser. Any help would be appreciated.
    DECLARE
    my_url varchar2(1000);
    v_id VARCHAR2(18);
    BEGIN
    v_id := p_session.get_value_as_VARCHAR2(p_block_name=>'DEFAULT',p_attribute_name=>'A_SEATPLAN');
    my_url := 'http://mydomain.com/||v_id||'.pdf';
    PORTAL30.wwa_app_module.set_target(my_url,'CALL');
    END;
    Thanks in advance

    Hi,
    It seems the URL created by you
    my_url := 'http://mydomain.com/||v_id||'.pdf'
    has a missing single quote
    Try this
    my_url := 'http://mydomain.com/'||v_id||'.pdf'
    Thanks
    Vineet

  • Portal URL's and Form Posting

    When I use the following url in a form POST method, I receive a "page cannot be found" error when I click submit, but if I go directly to the page by entering the url in my browser, it works. Why is that?
    http://matrix0.dynamex.com:7778/pls/portal/url/page/dxnet_jsps/cr_submit?test=1
    How do I call another page in Portal through a form POST method using JSP?

    Hello Angela,
    you should find everything you need in :
    - the pdk-java sample 'event form' (eventform.jsp and publicparam.jsp)
    - the pdk articles
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/ADDING.PARAMETERS.EVENTS.TO.PORTLETS.HTML
    (explained source code of the event form sample)
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/primer.portlet.parameters.events.html
    (what to do in portal once your jsp-application is running)
    For your jsps, you'll know how to create the events, th event's parameters, how to call the htmlFrormActionLink() method, and finally get back the params from the request.
    Else, to create a link to a page, use the constructEventLink() in the EventUtils class (see API DOC deployed with JDPK on your OC4J)
    Hope this helps.
    Jean-Roch

  • MULTI ITEM ENTRY AT A TIME IN TABULAR FORM SUBMIT ONE TIME

    MULTI ITEM ENTRY AT A TIME IN TABULAR FORM SUBMIT ONE TIME

    No, it wasn't addressed to you but rather the OP - sorry for the confusion.
    I try where possible to point out that without asking a sensible and clear question, posters are unlikely to get sensible and clear answers. A lot of time is wasted on this forum trying to get people to ask questions properly.
    Cheers
    Ben

  • How do I a form submit without losing page parametes on other portlets?

    I have a page with several portlets. How can I make one of the portlets do a form submit without losing page parameters in other portlets?
    If I do a submit only the controls in the form I have submitted are passed which means I loose parameters that where passed earlier.
    I looked at the code the portal uses for the next button and I see that it does a POST with the action being the complete current URL with existing parameters. When I do this I cannot access the form variables in my dynamic page.

    There are 3 steps to the balancing act of image weight (file size) vs image quality
    1) image dimensions (on screen height x width measured in pixels is all that counts). Smaller dimensions = smaller file size.
    2) compressed file type (JPEG for photos, PNG or GIF for everything else). Choose the right file type for your image.
    3) quality of the final compressed image - visually comparing the final image for "acceptableness" (less artifacts) vs final file size
    There are plenty of tutorials online
    http://inobscuro.com/tutorials/read/35/
    http://sixrevisions.com/web_design/comprehensive-guide-saving-images-for-web/

  • UIX Search Form "difficult" question

    OK,
    Say you dragged and dropped UIX search form onto the page. When you start the page it will render the result table without specific where criteria set, ie SELECT * FROM TABLE;
    Questions:
    1) How to add default WHERE clause for the first time when the page opens ie I want to have result page something like SELECT * FROM TABLE WHERE PARAM='bla';
    2) Similar question but this time how to pass PARAM from some previous page?
    Please help

    1. Try setting an initial where clause on the viewObject that you used to construct the search form. You can do this in the BC4J editor (wizard) for your viewObject.
    2. you would have to write an event handler and programmatically set the where clause on your viewObject.

  • Java Script: Form Submit issue.

    Is there a way where I can submit two forms ?
    Thats is submit 2nd form only when the first form is submitted.
    I tried this it works.
    function formSubmit(){
    document.form1.submit(); //Submit First Form
    alert(); //This will stall the execution thus form2 will not be submitted till I click on OK
    document.form2.submit();
    }But If I dont put an alert in between, only the second form is submitted.
    If I put a delay of say 3 seconds in between then it will throw a SOCKET CLOSED error in the action event triggered due to first form submit.
    Well Basically when the Alert pop's up the parent page "STALLS" and thus the form2 does not submit till I click on OK, Is there a way I can stall the browser/Parent JSP page using JAVA SCRIPT ??

    Relax people... Ok I will move my querries else where :) ..
    But whats wrong if somebody can provide me an answer ? I am sure most of you know java script , if you dont know then don't answer simple as that.
    You do know that Sun did not create JavaScript, right? So the Sun forum sites may not be the best place to look for a JavaScript forum " {code} 
    You mean to say if something is not from sun I am not supposed to ask a question on that, I agree that this is JAVA Programming forum.
    Peace,.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Dynamic Image (.gif) from URL into adobe Form by SFP

    Hi all
    I post the comment of Shamila because I have the same problem
    I need to place an image in the Adobe form based on the url.
    I have written the following formcalc script in the image field form ready action
    ImageField1.value.image.href = "http://www.adobe.com/imageshome/pdfgift_home.gif"
    But when i view the form , the image field is empty, and when i click on the blank space of the image field, a popup appears to select the image............
    How can i show the image from url in the form..........
    Regards,

    Hello,
    have you checked these basics documents?
    When you need to send a picture into the offline form: another image question - using Regular ABAP not web dynpro and Display a logo dynamically in adobe form
    Where to start with scripting: http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Also try: Re: Dynamic R/3 Image URL in Adoeb Form
    regards, Otto

  • Protect a form submit cfm page

    How else to I protect a form submit cfm page to make sure the request only comes from pages in my own site?
    So far I have this
    <cfif Not cgi.REQUEST_METHOD eq "POST">
      <cflocation url="../index.cfm" addtoken="no">
    </cfif>

    We do the following in our application.cfm:
    <cfif isDefined("FORM.fieldNames") and len(FORM.fieldNames) and NOT reFindNoCase("^(http|https)://#CGI.HTTP_HOST#/",CGI.HTTP_REFERER)>
      <cfabort showerror="Forbidden Request - POST request denied.">
    </cfif>

  • URL. variable persisting across submit()

    Hi,
    I have a wierd problem that affects only one script of dozens
    that use the same technique.
    I have apage with two forms. The first form displays a select
    lisst of players in our basketball club. When selecting a player
    the page is reloaded using onChange='document.players.submit();'.
    The second form contains all the players details, and when
    you press update button, it calls another script which then updates
    the players details and returns to the original script.
    To ensure the updated user row is loaded the first script
    passes the players id to the second script, which in turn passes it
    back after the update.
    A check is done to see if an incoming URL variable is
    present.
    As long as I don't update any player records URL.players
    never exists
    If I update a player URL.player exists, as it should, but
    then persists for every submit() from that point onwards, and it
    only happens in this one script, such that I can never load another
    player record unless I exist the script and go back in.
    Any ideas?

    This is the whole section of code. I already had
    method="post". Sorry about the >/cfoutput> it's not actually
    in the code.
    <cfquery name="players"
    Datasource="#Application.Datasource#">
    select users.uid_user,full_name from
    users, user_roles
    where user_roles.uid_role=3 and
    user_roles.uid_user=users.uid_user
    <cfif #session.sequence# is True>
    order by first_name, last_name
    <cfelse>
    order by last_name, first_name
    </cfif>
    </cfquery>
    <!--- When coming back after a change, remember which user
    was selected. --->
    <cfif isDefined('URL.players')>
    <cfset FORM.players=#URL.players#>
    <cfelse>
    <cfif Not isDefined('FORM.players')>
    <cfset FORM.players=#players.uid_user#>
    </cfif>
    </cfif>
    <!--- Load the player account --->
    <cfquery name="get_player"
    datasource="#Application.datasource#">
    select * from players where uid_user=#FORM.players#
    </cfquery>
    <!--- Display the form --->
    <cfform name="players" method="post" action="">
    <table width="652" border="0" cellspacing="0"
    cellpadding="5">
    <tr class="PageText">
    <td width="127"><div
    align="right">Member:</div></td>
    <td width="408">
    <cfselect name="players"
    Query="players"
    display="full_name"
    value="uid_user"
    size="1"
    required="yes"
    multiple="no"
    selected="#FORM.players#"
    passthrough="onchange='document.players.submit();'">
    </cfselect></td>
    </tr>
    </table>
    </cfform>
    The second half of the page contains all the player details
    for the user to edit. The form statement for this is..
    <cfform name="def_player" method="post"
    action="change_player2.cfm?players=#FORM.players#">
    When change_player2.cfm returns to change_player.cfm...
    <cflocation
    url="change_player.cfm?players=#URL.players#">
    This all used to work fine, but has stopped recently. This
    was the first script this happened to. Now I;ve found another one.
    In this case, selcting users from the drop down doesn't work at all
    - it juest keeps reloading the first user in the table.
    I was wondering if this might be server related, so I tried
    the version on the production server, which is externally hosted.
    Same problem. I uploaded the code as you see it above and tried
    again, same problem.
    thanks

  • Where is the PDF file generated by the form submit?

    I am designing a form with Adobe Acrobat Pro X that will be filled in on the web. So I've got a Submit button on it set to Submit a form, being sent to a URL (an html file), and I have checked (under Export Format) PDF The complete document.
    So where is this exported PDF file once a user has submitted the filled-in form?
    How can my html file find this PDF file?
    I don't see where you define the location for these PDF files to go. I haven't been able to find a repository with these PDF files in them. And I can't find any info on the web.

    Thanks - yes, that's right.
    I've been working on php code to get the data sent by the form, save it to a file and send an email with the file as an attachment.
    If I set the form submit button in the AA form to send the data in fdf format, the php file only seems to get header info. If I send using pdf format, it gets pages and pages of code and symbols. Nothing I can parse.
    Can't figure out how to save these pages and pages of code and symbols to a file and not very confident that if I did manage to and send them as an email attachment that they would ever reformat themselves to become a readable PDF.
    All I want to do is send the filled-out form as a PDF attachment to an email. I don't care about the fields or the data - I just want the PDF.
    And, no, I don't want to use the submit form to email feature because it is clunky.

  • How do you pass XML as a URL param?

    How do you pass XML as a URL param?
    Thanks!

    I don't know why I wasn't thinking about this when I made my
    last post. If they're pasting some XML into a form, that's one
    thing. But if they need to send XML to your site from their own,
    you can setup a Coldfusion Component (CFC) as a Web Service to
    accept XML through a WSDL call.
    Check out the
    Coldfusion
    Developers Center for
    articles
    on creating web services

  • Stripping out html from form submissions

    My web developer is using the attached code to strip/disallow
    html code from form submissions in an effort to prevent someone
    from posting dangerous scripts or code via a form or blog.
    Problem is, I DO want to at least allow people to post url
    links to external content like youtube videos, their own webstes,
    images etc.... Basically if it is something hosted AND viewed on a
    site other than mine I would like to give them the ability to link
    to it. How could I edit the code to allow links of this nature or
    is there a better way to do this?
    My developer has basically told me there is no other way. It
    is either disallow it all or open it up. I disagree with this and
    am looking for a 2nd opinion.

    url links are not html.
    Regular expressions are not my strength, but it looks like
    that function is simply replacing sets of angle brackets with empty
    strings.
    In other words, if your users submit
    http://somesite.com, that will not
    be affected by the function. However, if they submit <a href="
    http://somesite.com">, it will be
    transformed to href="
    http://somesite.com". In either
    case, it will be text, not a link.

  • Iframe url param

    Is iframe url param has limit? because IE is throw error page
    can't display. firefox work fine.

    i assume you have 2 managed beans that are in request scope. one bean for the overview page, one for the details page.
    overview page:
    create the link with the h:outputlink component which has one nested h:outputtext (the link text) and several nested f:param components. that means, you write one f:param for every parameter you want to pass to your details page. in your example, this would be only the id.
    ... so now you click the link ...
    details page:
    the id-parameter is available in the field "myId" in your details bean via this entry in faces-config.xml:
    <managed-bean>
              <managed-bean-name>details</managed-bean-name>
              <managed-bean-class>com.DetailsBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>myId</property-name>
                   <value>#{param.id}</value>
              </managed-property>
         </managed-bean>In DetailsBean, first you have to retrieve the data from the database. This could be done in the constructor or in a method annotated with @PostConstruct.
    Also, save the id in a h:inputhidden. You will need the id again in the next step.
    ... now the user edits the data and presses submit ...
    (All Parameters are lost at this point.) In your action, read the id from the h:inputhidden field. Now you have everything to update your database entry.

  • Web form submit to external email address

    I am trying to submit web form to email on external email server.
    I have followed the following: however - I get email message as the Administrator that this email address does not exist in the system.  Is it even possible to route to external email server?? Am I missing something?
    &Email=[email protected] - The email adddress to which the submission is sent. Replace “[email protected]” with your email address.
    Note: The email address that will be receiving the form submission must exist in either your sites CRM (customer database) or be a admin/email user of the site.
    If the email address being used to receive these form submissions does not exist as a site user or in the CRM, then the email will not be sent. A notification will be sent to the partner of the site advising them of this requirement.
    &Subject=This+is+email+subject - The subject of the email. Make sure you separate each word in the subject with the + (plus) sign.
    &EmailFrom=[email protected] - The from email address. Replace [email protected] with the email address you want to use for the submission.
    &PageID=/DestinationPage.html -  The URL of the landing page presented to the visitor after the web form has been submitted.

    Hi there.
    To not use the Form to CRM/Case form in BC you need to update a forms action as outlined in the guide here:
    http://kb.worldsecuresystems.com/kb/setting-form-email-using-web.html
    You pasted some of it But your post is a bit messed up I think. have ou updated the action? Got a link to the form?

Maybe you are looking for