f:param with commandlink

Is it possible to use a param with a commandLink?

hi! i am quite new to JSF and to JSP for that matter, I do have a question though with the posted reply in using <f:param> with the commandlink.
Let's say I have included that statement and what I need to do when the user clicks on the link is to continue onto the next JSP page. Now, I intend to use the value of the parameter and set it to a bean.
Can you or anyone enlighten me on how I can manage to do this? Thanks a bunch!

Similar Messages

  • Problem with commandLink and commandButton

    Problem with commandLink and commandButton
    I have commandButton id="submit" action="{myActionClass.dothis}"
    When I click on the commandbutton it is not submiting to the action class rather, its submitting to the same page..
    I am tired of this ...
    I am using tiles for displaying jsf pages . Any problem because of using tiles

    yes I have the validator.
    If I open the url directly its working fine
    let say I am opening localhost:8080/test/test.jsf
    then it works fine
    If i use the same test.jsf along with tiles and open it, then its dispalying all the elements but when i click on commandbutton.. nothin is happening.
    the seems like page is reloaded.

  • XSQL Using bind params with sql LIKE clause

    I am unable to use a bind-param with the LIKE clause in a SELECT statement.
    eg call .../temp.xsql?name=N
    XSQL query is this:
    <xsql:query max-rows="-1" bind-params="name">
    SELECT last_name
    FROM emp
    WHERE last_name LIKE '?%'
    </xsql:query>
    I have tried a few combinations so far with no success eg:
    WHERE last_name LIKE '{@name}%'
    WHERE last_name LIKE ?||%
    Any ideas?

    I highly recommend using XSQL's real bind variable feature wherever you can. You can read about it in the XSQL Online Documentation (Search for the "Using Bind Variables" section).
    Using this feature is more performant and more secure than using textual substitution variables.
    Here's what your page looks like using textual substitution:
    <page connection="UTD4" xmlns:xsql="urn:oracle-xsql">
      <xsql:query null-indicator="yes" >
        SELECT * FROM TC_HL7_SEG WHERE SEGMENT_CODE LIKE '{@code}%'
      </xsql:query>
    </page> .
    And here's what it would look like using real bind variables:
    <page connection="UTD4" xmlns:xsql="urn:oracle-xsql">
      <xsql:query null-indicator="yes" bind-params="code">
        SELECT * FROM TC_HL7_SEG WHERE SEGMENT_CODE LIKE ?||'%'
      </xsql:query>
    </page> .
    Using real bind variables allows the database to avoid reparsing the SQL statement everytime, which improves performance.
    Steve Muench
    JDeveloper/BC4J Development Team
    Author, Building Oracle XML Applications

  • Help with commandLink, actionListener, param in a simple CRUD example

    Hi All,
    I'm trying to build a very simple CRUD (create read update delete) interface as a proof of concept (concept being that I have some aptitude with JSF) and here is my problem:
    I have a dataTable, each row of which represents a campaign object. I want an "edit" link in each row that will load a single-edit page for the campaign in that row. I am not sure how to access the value of the param (campaignId) within the backing bean's actionListener method. Below is the code for the link and thanks in advance.
    Matt
    <h:commandLink
       actionListener="#{CampaignBean.chooseCampaign}"
       action="#{CampaignBean.editCampaign}"
       rendered="#{not campaign.editable }">
                   <h:outputText value='#{campaign.campaignName}'
                                 rendered="#{not campaign.editable }"/>
                   <f:param name="chosenCampaign"
                                 value="#{campaign.campaignId }"/>
              </h:commandLink>

    Thank you very much! Actually a co-worker had pointed me to your site yesterday afternoon and I was going to post a link to it. Your articles are very helpful!!!

  • Need Help with CommandLink Passing rowKeyStr to 2nd JSPX Page

    I've been working about 8 hours on something that should be simple - I have a databable displaying rows of data with a simple command link on one of the columns that will send the user to a 2nd page with a single record form showing detailed information for the selected row.
    The problems I'm having:
    * When I press the commandlink I do not get the correct record on the 2nd page
    * Also I'm receiving the following error: JBO-25020: View row of key oracle.jbo.Key[11 ] not found in SearchViewIterator
    When I use the af:tableselectone (selection) button to select the row first and then click the commandlink, the 2nd page DOES display the correct row, however I still receive the 25020 error above.
    Note I am using the same View Object and Iterator for both pages.
    I have compared my code against the SRDemo application and cannot see any differences - I was hoping someone could review my steps to see if I'm missing something (using JSF and ADF BC 10.1.3):
    Page 1 JSPX Code Snippet (commandLink / ActionListener):
    <af:commandLink actionListener="#{bindings.setCurrentRowWithKey.execute}"
    action="viewisp"
    text="setCurrentRowWithKey"
    disabled="#{!bindings.setCurrentRowWithKey.enabled}">
    <af:setActionListener from="#{row.rowKeyStr}"
    to="#{processScope.rowKeyStr}"/>
    </af:commandLink>
    Page 1 JSPX Page Definition File Snippet:
    <action id="setCurrentRowWithKey" IterBinding="SearchViewIterator"
    InstanceName="SearchDataControl.SearchView"
    DataControl="SearchDataControl" RequiresUpdateModel="false"
    Action="96">
    <NamedData NDName="rowKey" NDValue="#{row.rowKeyStr}"
    NDType="java.lang.String"/>
    </action>
    JSPX Page 2 (destination - single form) - Page Definition Snippet:
    <executables>
    <iterator id="SearchViewIterator" RangeSize="10" Binds="SearchView"
    DataControl="SearchDataControl"/>
    <invokeAction id="setCurrentRowWithKeyStr" Binds="setCurrentRowWithKey"
    RefreshCondition="#{adfFacesContext.postback==false}"/>
    </executables>
    <action id="setCurrentRowWithKey" IterBinding="SearchViewIterator"
    InstanceName="SearchDataControl.SearchView"
    DataControl="SearchDataControl" RequiresUpdateModel="false"
    Action="96">
    <NamedData NDName="rowKey" NDValue="#{processScope.rowKeyStr}"
    NDType="java.lang.String"/>
    </action>
    Finally - I did see some other posts related to the JBO-25020 error. The recommended Solution was to add the following code to the underlying ViewObjectImpl class:
    protected void create()
    {    setManageRowsByKey(true);
    super.create(); }
    This had no affect.
    thanks for any help.....
    ps what exactly is stored in the row.rowKeyStr? is it based on data columns in the row?

    Finally got this to work - thought I would post the solution that worked for me here in case anyone else runs into this:
    Note: Page#1 = Search Form - ADF parameter form and ADF read-only table (uses CommandLink to pass record to page#2)
    Page#2 = ADF read-only form - uses same VO and same iterator as page 1
    1. As Frank in his reply above, I don't need to use an ActionListener, but only use the commandlink for navigation. I did need also to set the current row when the user clicks the command link as described in the JDev help (Adding Tables | Setting the Current Object Using a Command Component) - this was a step I was missing before.
    2. NOW, here is where it gets Interesting - to avoid the issues of:
    a. page#2 not displaying the correct record selected, or, inconsistently displaying the correct record; and/or,
    b. receiving a "JBO-25020: View row of key oracle.jbo.Key[num] not found in xxIterator"
    I had to EITHER:
    A. Set the SyncMode for the DataControl in databindings.cpx = Batch (as described in      http://www.oracle.com/technology/products/jdev/tips/muench/batchmode/index.html)
    OR,
    B. Keep the SyncMode for the DataControl as Immediate, BUT override the following method in ViewObjImpl as described in some previous forum threads related to JBO-25020 error:
    protected void create()
    {     setManageRowsByKey(true);
    super.create(); }
    This is what I found (after much trial & error) worked for me - I'm curious to see if others have come to the same conclusions.
    thanks
    Tom

  • init-param with &

              hy,
              can anybody help me with a problem?
              Got following init-param in web.xml with <?xml version="1.0" encoding="ISO-8859-1"?>
              set at the beginning.
              <init-param>
              <param-name>removeTemplateCache</param-name>
              <param-value>/content/admin/remove?cache=templates&id=</param-value>
              </init-param>
              Deploying fails with SAXException saying:
              Deployment descriptor "web.xml" is malformed, check against the DTD: The reference
              to entity "id" must end with the ';' delimiter. (line 218, column 56)
              What do I need to do to handle "special characters" in the Deployment Descriptors
              ?? Only Escaping doesn´t really work ..
              Thanks for input.
              Greetings
              

              Seems to be a problem nobody want to answer to ..
              Tried a little and found something that worked:
              <?xml version="1.0" encoding="UTF-8"?>
              <init-param>
              <param-name>removePageCache</param-name>
              <param-value>/content/admin/remove&#x3F;cache=pages&#x26;id=</param-value>
              </init-param>
              The wonder ist called unicode and can be found in more details at: www.unicode.org
              "Markus Eisele" <[email protected]> wrote:
              >
              >hy,
              >
              >can anybody help me with a problem?
              >Got following init-param in web.xml with <?xml version="1.0" encoding="ISO-8859-1"?>
              >set at the beginning.
              >
              ><init-param>
              > <param-name>removeTemplateCache</param-name>
              > <param-value>/content/admin/remove?cache=templates&id=</param-value>
              > </init-param>
              >
              >Deploying fails with SAXException saying:
              >
              >Deployment descriptor "web.xml" is malformed, check against the DTD:
              >The reference
              >to entity "id" must end with the ';' delimiter. (line 218, column 56)
              >
              >What do I need to do to handle "special characters" in the Deployment
              >Descriptors
              >?? Only Escaping doesn´t really work ..
              >
              >Thanks for input.
              >
              >Greetings
              

  • Using Template Params with links

    Hi all, I was wondering how I could use a template parameters
    to change all links' prefix. For example all pages on my site will
    use relative paths to pages within the site. A few pages in the
    site are secure and therefore get directed to a "secure" server so
    the URL becomes different. Those pages cannot use relative URL's to
    get back to the 'normal', unsecured, site so they must use complete
    path "
    http://www.whatever.com/" in
    front of the links. I'm thinking I can make two template params
    like so:
    <!-- TemplateParam name="rootSite" type="text" value="
    http://www.whatever.com" -->
    <!-- TemplateParam name="pageSecure" type="boolean"
    value="true" -->
    but I some how need it to search through the document for all
    links and put the 'rootSite' inserted before whats already there.
    Can this be done??? If so, how?
    Thanks in advance!
    Buddy

    I would make this -
    <!-- TemplateParam name="rootSite" type="text"
    value="
    http://www.whatever.com"
    be this -
    <!-- TemplateParam name="rootSite" type="text"
    value="
    http://www.whatever.com/"
    Find (in current document) -
    <a href="
    Replace with -
    <a href="@@(rootSite)@@
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "buddyq" <[email protected]> wrote in
    message
    news:elp9s5$7k1$[email protected]..
    > Hi all, I was wondering how I could use a template
    parameters to change
    > all
    > links' prefix. For example all pages on my site will use
    relative paths to
    > pages within the site. A few pages in the site are
    secure and therefore
    > get
    > directed to a "secure" server so the URL becomes
    different. Those pages
    > cannot
    > use relative URL's to get back to the 'normal',
    unsecured, site so they
    > must
    > use complete path "
    http://www.whatever.com/" in
    front of the links. I'm
    > thinking I can make two template params like so:
    >
    > <!-- TemplateParam name="rootSite" type="text"
    > value="
    http://www.whatever.com"
    > -->
    > <!-- TemplateParam name="pageSecure" type="boolean"
    value="true" -->
    >
    > but I some how need it to search through the document
    for all links and
    > put
    > the 'rootSite' inserted before whats already there. Can
    this be done??? If
    > so,
    > how?
    >
    > Thanks in advance!
    >
    > Buddy
    >

  • Read applet param with unknown name

    To read an applet param, there's the method "String getParameter(String name). For using this method I need to know the parameters name.
    Does anybody know a way to read all params, without knowing all possible
    param names?
    Thanks for any help.
    Marko M�ller

    Yikes ... not sure. Perhaps you could try to indicate what you are doing and implement it an alternate way. I have gotten around this in the past using various tricks. One of them (briefly) is to use a generic parameter accumulator:
    <param NAME="keyValue0" VALUE="pieWedge1|15.43">
    <param NAME="keyValue1" VALUE="pieWedge2|10.57">
    <param NAME="keyValue2" VALUE="pieWedge3|12.00">
    <param NAME="keyValue3" VALUE="pieWedge4|12.00">
    <param NAME="keyValue4" VALUE="pieWedge5|25.00">
    <param NAME="keyValue5" VALUE="pieWedge6|50.00">
    Then you can just loop through and do
    .getParameter("keyValue" + String.ValueOf(i));
    and pick out all of the parameters. I pass each of the key value parameters to a decoupler, which parses out based on my "|" delimeter, and adds the parameters to a hashtable keyed on the key portion of the keyvalue pair, for easy access.
    In essense, you can do this with ALL of your dynamic parameters. I tend to use logical groupings myself. That is you can separate them by using keyValue#, option#, etc so that you can differentiate various sets of dynamic parameters to your applet.
    Hope this helps. If you find another way of grabbing all parameters, I would like to see what you come up with.

  • Open PDF with commandLink

    Hi,
    I'm trying to generate and open a PDF file in a new window, but i'm having problems showing the file. My main doubt is what to return from the Action method:
    The button:
    <h:commandLink styleClass="commandLink" id="link1" target="_blank" action="#{pc_MyClass.doLink1Action}">
    Open File                                   
    </h:commandLink>The method doLink1Action:
    StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   resp.setContentType("application/x-download");
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("attachment");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   resp.setHeader(
                        "Content-disposition",
                        sbContentDispValue.toString());
                   resp.setContentLength(baosPDF.size());
                   ServletOutputStream sos = resp.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
                   getFacesContext().responseComplete();It generates the PDF, but i don't know how to open it.
    Hope you can help me.
    P.S.: I need a solution that doesn't require invoking servlets.

    I had encountered this problem earlier. Check your server log if you see an IllegalStateException.
    This might be the solution: http://balusc.xs4all.nl/srv/dev-jep-pdf.html

  • JSTL-c:import tag and c:param with portlets

    I am writing a JSP file in a portlet application to use the c:import JSTL tag to include a JSP file. However, I am trying to pass a parameter via c:param to this included file but the parameter is not being passed. The included JSP file gets "null" when trying to retrieve the value of this parameter, due to the fact that the parameter is not being passed. See code below:
    <c:import url="/jstltestportlet/jsp/html/test.jsp">
    <c:param name="month" value="October" />
    </c:import>
    Any ideas on why this is happening? Anybody running into this sort of a problem?
    I would appreciate any feedback.

    Here is my jsp #1: content.jsp (all the values are valid on this page)
    <c:import url="/org/j2eebuilder/view/Window.jsp">
    <c:param name="componentName" value="Home"/>
    <c:param name="componentStatus" value="None"/>
    <c:param name="windowAlias" value="/org/j2eebuilder/view/ViewControllerHelper.jsp"/>
    <c:param name="windowHeader" value="Home Management"/>
    </c:import>
    Here is my jsp #2: window.jsp (just showing various ways I have tried to get the value out)
    1. ${requestScope.componentName} 2. ${componentName} 3. ${param.componentName}
    4. <%=renderRequest.getAttribute("componentName")%>
    5. <%=renderRequest.getParameter("componentName")%>
    6. <%=request.getQueryString()%>
    7. <%= request.getParameter("componentName") %>
    8. <portlet:renderURL />
    9.<c:out value="${param.componentName}" />
    10.<c:out value="${componentName}" />
    and here is what is rendered:
    1.
    2.
    3.
    4. null
    5. null
    6. componentName=Home&componentStatus=None&windowAlias=%2forg%2fj2eebuilder%2fview%2fViewControllerHelper.jsp&windowHeader=Home+Management
    7. null
    8. /pluto/portal//Test Page
    9.
    10.

  • DataTable with commandLinks  - How do I know which one I clicked?

    So, imagine I have a dataTable which returns rows from my database (any SELECT * FROM TABLE) and I want to, for example, delete the one object from row N, how do I know, if I put <h:commandLinks> after each row, which row I clicked?
    It's been really hard to do such a simple thing in JSF for me. Help!

    You'd better use selectBooleanCheckbox to delete the selected row rather than sommandLink. This way you'll be able to select more than one row and to delete all selected rows at the same time.
    Hope this helps!
    Ragards,
    Mariana Getova

  • Out param with db execute tag

    Hi,
    Im using a db execute tag to call a pl/sql procedure. This procedure returns an out parameter. My db execute call is as follows
    <database:dbExecute connId="db" output="none" bindParams="return_value">
    call ccr_contacts.save_organisation(<%=organisation_id%>,<%=org_type%>,'<%=org_name%>','<%=sort_name%>','<%=org_abbr_name%>','<%=division_name%>','<%=sub_division_name%>','<%=client_no%>','<%=comments%>',?)
    </database:dbExecute>
    Is it possible to get the value that the procedure returns into a java variable and if so how do I do it ?
    Thanks

    I am also doing the same.. Mike/Gurus, Did u find how to get the values back from procedure..

  • Handling quotes with ${param.CurrentName}

    I've read many posts on this topic, but cannot find a solution that works for my problem. I have 2 JSP pages. JSP 1 has text field CurrentName. JSP2 tries to capture that value and store it:<input type="hidden" name="CurrentName" id="CurrentName" value="${param.CurrentName}"> This of course works great, unless the user types in double quotes, like Joe "Cool" Johnson. If that happens, JSP2 contains <input type="hidden" name="CurrentName" id="CurrentName" value="Joe "Cool" Johnson"> Of course, the real data is cut off after Joe<space> because of the quote around "Cool." If I use single ticks like value='${param.CurrentName}', it works great with double quotes but not with single quotes, like Suzie's Kitchen, as we get the same data cutoff error after Suzie.
    So, of course the answer is to encode the value, replacing \" with ". But when I'm using default param and not a bean, I can't do this in a Java POJO. If I try calling a JavaScript method like fixquote(${param.CurrentName}); the result thows an error as fixquote(Joe "Cool" Johnson); If I try to capture the param in a variable first, it also throws an error.String paramname1 = ${param.CurrentName};results in String paramname1 = Joe "Cool" Johnson; and I can't pass paramname1 on the next line because it's already errored. I tried ${fn:replace(${param.CurrentName}, "a", "b")}; and that failed too.
    I'm not sure how I can actually pass that data to any method, Java, JSTL or JavaScript, because it translates the real value causing an error before I can pass it. I thought about using a bean from JSP1 to JSP2, but in this application I inherited, there are about 100 parameters on this page I'd need to add, so am hoping to avoid that work.
    Thanks.

    That last one was the closest to what you need to do. You just had some nested ${ expr } braces which doesn't work so well.
    // fixed example
    ${fn:replace(param.CurrentName, "a", "b")};
    // I think it should look something like this
    ${fn:replace(param.CurrentName, "\"", "\\\"")};Alternatively you could create a class wraps the parameter map, and escapes values for you.
    You could then replace all instances of "param" with references to this bean instead.
    cheers,
    evnafets

  • Link to URL should call a SAP transaction through URL with params

    Hi All,
    I have a requirement where I need to open a SAP Transaction MM03 on click of a link in a webdynpro application.
    I feel that I can call it using a URL but not sure of how the URL should look like.
    If I can pass the Params with the OKCodes etc this should work.
    Could you please let me know how to do that.
    Just to be clear the transaction should open as a new window and its not in portal So i cant use Portal Navigation(relative or absolute).
    Please do suggest me how to do this.
    Thanks & Regards,
    Sirisha.RS

    Hi Srisha,
    What i can suggest  you is to create a SAP Transaction iView and attach it to role where user can access and make the iview  invisible in navigation. In Webdynpro code  access the transaction by following way :
    WDPortalNavigation.navigateAbsolute("ROLES://portal_content/......<SAP Tran iView Path>",WDPortalNavigationMode.SHOW_EXTERNAL,
                   (String) null,
                   (String) null,
         WDPortalNavigationHistoryMode.NO_DUPLICATIONS,
                   (String) null,
                   (String) null,
                   <parameters to be passed to transaction> ); 
    Hope it helps !!!
    Good Luck,
    Vasu

  • Commandlink not opening in new window(browser) tried with popup

    Hi,
    stdURL=StandardURLData backingbean in faces-config
    viewerLink= having some URL ex: http://www.oracle.com
    stdName= some string say "oracle" if we click it redirects to "http://www.oracle.com"
    <af:commandLink action="#{stdURL.retrieveViewerLink}" >
    <af:setActionListener from="#{stdURL.viewerLink}"
    to="#{stdURL.url}"/>
    <af:outputText value="#{stdURL.stdName}"/>
    </af:commandLink>
    public String retrieveViewerLink(){
    String strURL="";
    try{
    FacesContext.getCurrentInstance().getExternalContext().redirect(getUrl());
    }catch(Exception e){
    System.out.println("Entered inside Viewer Link EXCEPTION BLOCK*************************************");
    return null;
    public void setUrl(String url) {
    this.url = url;
    public String getUrl() {
    return url;
    everything is working fine. But problem is when click on "oracle" name it is opening in same page.
    i want this url should open in new page.
    i tried with popup but it is not working.
    tried like,
    <af:commandLink action="#{stdURL.retrieveViewerLink}" >
    <af:setActionListener from="#{stdURL.viewerLink}"
    to="#{stdURL.url}"/>
    <af:outputText value="#{stdURL.stdName}"/>
    </af:commandLink>
    <af:showPopupBehavior triggerType="click" align="afterEnd" popupId="test"/>
    <af:popup id="test" clientComponent="true" launcherVar="source">
    <af:dialog type="none" contentWidth="200" contentHeight="200">
    <af:panelGroupLayout>
    <h:panelGrid rules="rows">
    test
    </h:panelGrid>
    </af:panelGroupLayout>
    </af:dialog>
    </af:popup>
    i tried with "usewindow=false" also.
    thanks in advance
    regards,
    sandeep

    Hi,
    yeah first i used golink only. it is working fine.
    But i have other requirement, im using export to excel option, their wt happening is,
    ex: abc , xyz... are 2 values.
    say "abc" is an hyperlink.
    that time "abc" is not placing in excel, only xyz (without hyperlink) going to excel.
    Now, i rectifiyed this problem with commandlink, everything is working fine (redirecting and export to excel)
    but i want to open this link in NEW WINDOW.
    thanks in advance.
    regards,
    sandeep

Maybe you are looking for

  • How To Use Activity Monitor

    Is there a tutorial or something on using Activity Monitor? For instance, I'd like to find out what processes are going on to prevent my G4 from shutting down at the scheduled time. (The shutdown deal has been ongoing since first going to OS X.)

  • Missing Main/Navigator Toolbar JDEV 904

    I would like to know how to reset the look and feel of the Main/Navigator toolbars within JDEV 904. When I select View -> Toolbars - the toolbar is displayed, but only as a bar of one pixel height :( I have tried to resize/drag n drop/open/close/mini

  • Runtime Error Getting While Executing Transaction ME47.

    Hi Exports, i am facing a problem in transaction ME47 For Maintaing Quotation. if i enter RFQ Number and exceute, i am getting Runtime Error. This is happening in only in Test Server. Development and production it is working fine. Error Details are g

  • Winmagic Securedoc and New Macbook Pro for Full Disk Encryption (FDE)

    Hi, I wonder if anyone had any experience with this. I've installed a seagate Momentus FDE drive (...421 series) on my new macbook pro and tried installing Winmagic securedoc to manage full disk encryption. It seems that despite all their recommendat

  • My ipod thinks autosync means delete all and copy again :(

    everytime i connect my ipod nano to my pc it opens itunes, deletes all songs and copys them on the ipod again. Even if i dont change anything in itunes library and just restart/reconnect the ipod it will delete everything before syncing. why? how to