JSF in a portlet problem

I have a page with a dropdown JSF element in it. I have tried doing this two ways. The first way in a JSF Web Application, the second in a portlet.
I have a valuechangelistener on the dropdown and I call submit() in onChange. The goal is to process some stuff and add it to another dropdown on the page when it is refreshed. In the JSF Web Application the dropdown is submitted and the value is still selected upon refresh and everything looks good. (The new stuff is there)
However, when the page refreshes in the portlet it goes back to its default value and I don't get my changes. I see the the query to get the new stuff is being run put the page goes back to its defaults. It seems like the page is getting refreshed twice in the portlet situation and everything I want is getting cleared out. I see that the intialize of the JSF Page java class is getting called there twice in the logs for the portlet situation but onece for the JSF Web Applicaion.

Hello Edmund,
The "jsf-naming" tag library you are importing is from the WLP "native" JSF 1.1 portlet bridge, which uses an entirely different way to render JSF as portlets than the new JSR329 JSF 1.2 to Java Portlet 2.0 bridge that you are using (the "GenericFacesPortlet"). Unfortunately, the jsf-naming tags are not compatible with the JSR329 bridge.
I'm not a JSF expert, so unfortunately I can't suggest an equivalent way of doing what you want to do, but I am sure it is possible. Hopefully someone else on here with JSF expertise can help you out.
Kevin

Similar Messages

  • JSF 2.0 portlet development

    Hi there,
    I'm new in the world of J2EE and I'm trying to develop JSF 2.0 portlets to run on JBoss Portal 2.7.
    Unfortunately no JSF 2.0 portlet bridge standard exists (only for JSF 1.2), JBoss Portlet bridge still only supports JSF 1.2 and I didn't find any tutorial to make even a "Hello World" JSF 2.0 portlet.
    The only thing I found is the project portletfaces, a JSF 2.0 portlet bridge, but it can only make it work on Liferay (for wich it is optimized), not on JBoss Portal (or even GateIn). Unfortunately for my project I absolutely need to use JBoss Portal...
    Can anyone help me? Is it mandatory to use a portlet bridge for JSF 2.0 portlet development? Am I screwed?
    Thanks a lot!
    Nicolas!

    802101 wrote:
    Hi gimbal2, thank you for your answer :)
    So yeah, you confirm what I thought: it's to soon, better wait the maturity of the thing
    However, I still have this question: is it possible to develop portlets WITHOUT using a portlet bridge ? Don't I just have to add a few config files (like portlet.xml, jboss-web.xml) and it is on?
    Thanks a lotOf course you can. The bridge is there for interoperability between portlets and other (mostly JSF-based) frameworks. There is nothing stopping you from creating portlets without the bridge and you should just do that until you find you actually need it. My development take on 'management by exception' :)

  • Weblogic Portal 10.3.5 using JSF 1.2 portlets with ADF faces

    We are developing Portal site using Weblogic Portal 10.3.5 with JSF portlet 1.2 and ADF faces (ADF Application runtime 11.1.1.5 ). But the JSF portlets not supporting ADF faces. Please let me know how we use ADF faces in JSF portlet 1.2 in Weblogic Portal.

    Hi Murthy,
    We did a detailed analysis.
    (1) How do we add ADF taskflows, JSF in to weblogic portal desktop/pages? Do we create portlet out of JSF, and display on desktop/page? If this is the case, what about ADf task flows?
    --> Taskflows can be deployed as WSRP2.0 portlets. Note 2 options are there JSF page as portlet or taskflow itself as portlets.
    (2) How do we integrate weblogic user profiles and UUP (unified user profiles) with ADF and JSF?
    --> ADF Security can use Weblogic Server realm as the security provider. Entitlements in WLP will have to be provided based on Weblogic Server roles. In case you are using external LDAP then both can be integrated withe external LDAP
    (3) Can anybody shed some light which this better?
    (a) weblogic portal with JPF (Java page flows), NetUI --Legacy approach
    Pros:
    -Easy Development
    -Well tested integrated
    Cons:
    -Future support
    -Enhancements may not be available
    -Not really portable or standards based
    (b) weblogic portal with ADF, JSF?
    Pros:
    -If your on Oracle stack then great
    -Standards based
    Cons:
    -JSF Portlet bridge issues
    -ADF Faces does not work on IE6!
    Well what we are going for is JSR 286, Trinidad components (Supports IE6), JSF.
    Difficult choice.
    Venkat

  • Studio 3.1 & Portal 9.2 - JSF portlet problem

    Hi, first time here.
    Let say I have create a simple jsf navigation application using Studio 3.1 like this:
    // inside faces-config.xml
    <navigation-rule>
    <from-view-id>/pages/inputname.jsp</from-view-id>
    <navigation-case>
    <from-outcome>greeting</from-outcome>
    <to-view-id>/pages/greeting.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    I have done all beans config and resources bundling. After all I run it successfully in server.My next step is to create a portlet, holding the first jsp page. Oh, well, Studio can't do it and I have to do it in Portal 9.2
    What should I do now? I have try many method to import my project into it and of course it is not working.
    To my knowledge, portal support PageFlow (Controller.java) but i dunno about MyFace (faces-config.xml).

    Hi Rene,
    When you found out that you misread the instrucition and you already ran the script, what did you do next? Did you restore the db and redo over? Or did you continue on? I have the same problem with you too but I'm not sure what to do next.
    Trina :)
    [email protected]

  • Multiple Portlets problem for sessionBean

    Hi all,
    I created a Master-Detail two page database portlet using sun creator 2 update 1. The portlet was running fine both in test server and my actual portal server. But when i placed it on the same page as another portlet created by me. The portlet does'nt work("doesnt goes to second page"). I believe that is because both portlets share the same session bean.But what should i do to solve this problem. Can i create a new session bean other than the default SessionBean1? PLease help
    regards
    Kimi

    panky_p wrote:
    Ok,
    but submitting form on selection will refresh my page which will affect rest of the data on page!Use AJAX or redesign your app better.
    and another thing is that without submitting form how it takes value of last element (for Audi)?JSF runs on the server side. You can only reach it by sending a request (can be GET or, in this case, POST).
    is there another way? so that complete page will not be refreshed and why it take value for last div element only?Drop that Javascript away, use a single textarea and determine the selected car in the backing bean.

  • JSF 2.0 Portlet Bridge

    Dear Experts,
    I have a JSF 2.0 application and was trying to expose it as remote Portlet.
    I don't think we have Portal Bridge from Oracle for JSF2.0. What is the alternative? Please provide pointers.
    I know there are different implementations and it is being done for Liferay Faces project however I want to try it for Webcenter. Kindly help
    Thanks

    Dear Experts,
    Please let me know if anyone has come across such situation.
    Thanks

  • OC4J 9.04 and JSF 1.1.0 problem

    Our problem scenario is related to JSF and OC4J.
    When an exception is generated that is not handled by our application and thrown to the web container, the user is redirected to an error page. If the user refreshes the error page then the whole application gets into an illegal state i.e. blank pages are shown for all the pages. It seems like the problem is related to JSF 1.1.0 and OC4J 9.0.4 (uses J2EE 1.3).
    The application works fine on OC4J 10 R3 (uses J2EE 1.4), Tomcat 4 (uses J2EE 1.3) and Tomcat 5 (uses J2EE 1.4).
    Anyone experiencing the same kind of problem? Any ideas?

    Our problem scenario is related to JSF and OC4J.
    When an exception is generated that is not handled by our application and thrown to the web container, the user is redirected to an error page. If the user refreshes the error page then the whole application gets into an illegal state i.e. blank pages are shown for all the pages. It seems like the problem is related to JSF 1.1.0 and OC4J 9.0.4 (uses J2EE 1.3).
    The application works fine on OC4J 10 R3 (uses J2EE 1.4), Tomcat 4 (uses J2EE 1.3) and Tomcat 5 (uses J2EE 1.4).
    Anyone experiencing the same kind of problem? Any ideas?

  • JSF 1.0 HTML problem

    I updated my JSF version to the beta version 1, and I get a problem that was not present in the previous version:
    I generate HTML processing xml data, and put the data in a bean, when I output the variable I only get text and the browser does not format it into html !
    Did I miss something, is there anything I need to change from the previous version.
    The line is just :
    <h:output_text id="html" value="#{userInfo.userKeywords}"/>
    Thanks if someone has any idea.
    Franck

    I updated my JSF version to the beta version 1, and I
    get a problem that was not present in the previous
    version:
    I generate HTML processing xml data, and put the data
    in a bean, when I output the variable I only get text
    and the browser does not format it into html !
    Did I miss something, is there anything I need to
    change from the previous version.
    The line is just :
    <h:output_text id="html"
    value="#{userInfo.userKeywords}"/>
    Thanks if someone has any idea.
    FranckTo protect against the potential for cross site scripting attacks, by default the <h:output_text> tag will filter the output for characters that are sensitive in HTML and XML, including the "<" character, which is output as "@lt;" instead. If you want to turn off this filtering (and you are sure that you've protected yourself), add escape="false" to the tag invocation.
    Craig McClanahan

  • How to set focus on a jsf component of portlet based web page ?

    Hi,
    I have a jsf based portlet in a Websphere Portal environment. I have seen the javascript code document.getElementId(form.component).focus for the attribute onLoad in body tag of a page
    But in a portlet page, the body tag is somewhere in the Head page of the portal.
    How do I achieve this in another way? Is there that accesskey attribute for a component help me to set the focus on itself? HOw do I do that? Any help is appreciated
    Thanks

    Don't put it in the body. Put it below in the code, right before the closing body tag.
    Example<f:verbatim>
        <script>
            setFocus('</f:verbatim><h:outputText value="#{myBean.elementIdToFocus}" /><f:verbatim>'); // load on every view
            function setFocus(elementId) {
                var element = document.getElementById(elementId);
                if (element && element.focus) {
                    element.focus();
        </script>
    </f:verbatim>Where MyBean.getElementIdToFocus() returns the UIComponent.getId().

  • Jsr168 portlet problem

    Hi,
    I am creating a JSR168 compliant portlet with
    A single form that contains:
    - a search field
    - a table that displays radiobuttons and search query results
    - a button that sets a navigation parameter depending on the itemID that was picked from the table
    The problem is that while my search-query parameter is processed fine when running the application locally,
    I can not access the input parameter when the portlet is deployed to an OC4J container on a Webcenter Application Server and running in an ADF Faces jspx dashboard.
    In my portlet JSP page I have the search field:
    <input type="text" name="query">
    and I process it with a page refresh and the following:
    request.getParameter("query")
    which turns out to be null in the deployed portlet.
    when I do request.getParameterNames() I get different results depending on whether I run the application in JDeveloper, or when I deploy the portlet and I run it in the dashboard.
    getParameterNames() in the deployed portlet only displays my navigation parameter, while getParameterNames() running locally only displays my query parameter.
    It seems as if parameters need to be treated differently. Any input would be appreciated!

    Hi,
    In view.jsp, I have the following under <portlet:defineObjects/>:
    String actionURL = "view.jsp";
    if (renderResponse != null) {
    actionURL = renderResponse.createActionURL().toString();
    My form is defined like this:
    <form method="POST" action="<%= actionURL %>">
    Thanks in advance!
    Louisa

  • Visual Web JSF and Java Script problem

    Hi i am using Visual Web JSF for development in my project. AJAX to update data from server when users enters data in one text box its an chat application. i am getting data from server but unable to update my <webuijsf:textarea> component with the new data on my chat page ... I am facing another problem in java script that it is not accepting relational operators (< . >) in JSF Application.... i am attaching some code here for reference...result =http.responseText.split(","); /// this is the response text from AJAX based call
    var obj=document.getElementById('form1:chatter_box'); /// this text area is to be updated...
    var txt=document.createTextNode(http.responseText);
    ///document.getElementById('form1:chatter_box').innerHTML = txt;
    for(i=0;i < size;i++){
    var txt1=document.createTextNode(result);
    obj.appendChild(txt1);

    Try changing onclick to onClick and try...
    regards
    shanu

  • JSF Drop Down Converter Problems

    I am having problems with JSF 1.1_01 (MyFaces 1.1.1).
    I have created page called page.jsp as follows:
    <h:selectOneMenu value="#{test.selectedDevice}" id="deviceTypeList" styleClass="dropdown">
    <f:selectItems value="#{test.deviceTypes}" />
    <ajax:support action="#{test.loadDevice}" event="onchange" reRender="t2,t3,t4,t5"/>
    </h:selectOneMenu>
    It is uses managed bean called TestBean.java:
    public class TestBean {
    public List getDeviceTypes(){
         logger.info(" *** In getDeviceTypes Backing Bean*** ");
         List<SelectItem> models = new ArrayList<SelectItem>();
         List<SelectItem> deviceTypes = new ArrayList<SelectItem>();
    // Gets Data from Hibernate Query . It returns List of Device Types
         models = deviceManager.getDeviceTypes();
         logger.info(" *** DeviceType List Size=*** "+models.size());
         for (Iterator it = models.iterator(); it.hasNext();) {
              System.out.println("Inside For Loop Iterator size="+models.size());
              Object[] row = (Object[]) it.next();
         System.out.println("ID: " + row[0]); // prints data
         System.out.println("Name: " + row[1]); //prints data
    // Below line results in error : does not have a Converter
         deviceTypes.add(new SelectItem(row[0],row[1]+""));
              return deviceTypes;
    During page rendering, page.jsp throws following exception:
    javax.servlet.ServletException: Value is no String and component _id0:deviceTypeList does not have a Converter
    Is this bug with MyFaces 1.1.1 or I have made something wrong?
    I am a newbie & didnt know much about Converters hence read some examples from the web saying to have getObject() & getString methods . So i added below Class but not sure how to align with page.jsp page.
    public class DeviceTypeConverter implements Converter{
         protected final Log logger = LogFactory.getLog(getClass());
         public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s) throws ConverterException {
                   DeviceDao dao = new DeviceDao();
                   return dao.getdeviceTypes().(Long.decode(s));
                   public String getAsString(FacesContext facesContext, UIComponent
                   uiComponent, Object o) throws ConverterException {
                   if(o!= null)
                   logger.debug(o.toString());
                   try {
                   if((o!= null) && (o instanceof DeviceType)){
                   DeviceType dt = (DeviceType) o;
                   return ""+dt.getId();
                   else
                   return "0";
                   } catch (Exception e) {
                   logger.error(e);
                   throw new ConverterException();
    Any pointers/suggestions on how to write a Converter & help in resolving the error will be highly appreciated
    Regards
    Bansi

    Glad you found a way to make it work. I've got some ideas on improving this, as it is a little hacked together right now.
    But first things first...
    Does the models ArrayList really contain SelectItem
    objects??? If so, why would you bother transfering
    each SelectItem if it's already built.The models ArrayList doesnt contain SelectItems objects. It stores List of
    DeviceType objects retrieved from Database via Spring business layer i.e.
    models = deviceManager.getDeviceTypes() Then this line of code is wrong.
        List<SelectItem> models = new ArrayList<SelectItem>();You are not creating a list of SelectItem objects. You are creating a list of DeviceType objects. It should be:
        List<DeviceType> models = new ArrayList<DeviceType>();
    What are the objects represented by row[0] and
    row[1]?As models ArrayList contains Array of Objects i.e. multiple records (or
    rows) i am using Object[] row to store the values. That means row[0] &
    row[1] will contain column values for e.g. row[0] contains id values viz. 1,2,3
    etc
    What object does setSelectedDevice expect to
    receive?setSelectedDevice sets the selected Device id value submitted from JSF
    page into Backing BeanThis isn't what I was asking. I just want to know the java type object represented by row[0], row[1], and the java type object passed into setSelectedDevice. e.g: String, Integer, DeviceType, etc, or perhaps even the java primitive (int, char, boolean, etc...) if that's the case.
    These two questions are related and important. The java object represented by row[0] needs to be the java object passed into the setSelectedDevice. Actually, just by looking at your code, I can tell you the setSelectedDevice requires a String argument. My bet is that row[0] is not a String.
    As a side note... You shouldn't be making DB calls
    from your bean getters or setters. DB calls can mean
    a performance hit, and JSF will call the getters and
    setters multiple times per page request (which means
    you'll be doing multiple DB calls).... i started working on JSF-Spring-Hibernate project i always asked the
    question on Best Practices and i totally agree with your point. Hence i use
    Spring in the middle layer therefore i always call my Managers from
    Backing Bean for e.g. TestBean calls deviceManager for
    save,update,delete, getDeviceTypes,getDeviceTypes(String id)
    Also i have a question for you on the best practice. What should be the
    arguments to these save, update methods.
    Do you think it should be individual field values as specified in backing
    bean or should it be an objectUmm, I don't know. I'm sorry, I won't be much help to you here. I have not worked with Spring or Hibernate (yet). I can't advise you on those technologies (or how JSF would interface best with them).
    Check out this topic and you might be able to glean some useful information from it.
    http://forum.java.sun.com/thread.jspa?threadID=784351
    Hope I've been of some help!
    CowKing

  • JSF value change Simple problem

    I am having a small difficulty understanding which approach should be used to initialize data in JSF.
    Take this simple example:
    There is a drop down with 2 items: 1, 2
            <h:selectOneMenu value="#{bean.value}"
              valueChangeListener="#{bean.change}" onchange="submit()">
              <f:selectItem itemLabel="1" itemValue="1"/>
              <f:selectItem itemLabel="2" itemValue="1"/>
            </h:selectOneMenu>Now, when page loads, it really shows the second value of the drop down selected.
    But, when I simply add a "valueChangeListener" method, I can see that there is a problem:
      public void change(ValueChangeEvent event)
        System.out.println("I was here");
      }Whenever switching from value: 1 to: value: 2, the event is not activate. Since I was setting each time the constructor is built, the value "manually".
    The problem gets much deeper when, for exmaple, I would like to show a table that changes according to several filters. Initially the data is loaded on the constructor. But when filter changes, the data should be reloaded. So I load it twice: Once in the constructor, then I have to rebuild data in the event itself.
    Am I missing here something ? Or the JSF mechanism is missing somthing ... ;-)

    It's beacuse its ValueChangeListener :) no a "LabelChangeListener".
    Value for those two items should be different :)
    Itemlabel is what you see in combobox, and itemValue is real value for item.
    If you change your code to :
    <f:selectItem itemLabel="1" itemValue="1"/>
    <f:selectItem itemLabel="2" itemValue="2"/>it will work :)
    Martin

  • JSF Hello World trivial problem

    Hi,
    I followed http://otn.oracle.com/oramag/oracle/04-jul/o44dev_ojdev.html "Developing faces" article and can't quite get the simpliest JSF app to work.
    I keep getting a 404 error when requesting index.jsp, which simply redirects to /faces/HelloFaces.jsp
    My web.xml looks OK (see below). In fact, I double-checked all the instuctions in the article.
    Another problem I saw is that, when I tried "Importing sample JSF apps" the article mentions jsf-cardemo.war which is cannot find in my jdev1013 directory.
    Thanks, regards,
    Pawel
    <?xml version = '1.0' encoding = 'windows-1250'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>

    Ok I answered my own question. New Dreamweaver extensions are
    available for download. That fixed it up.

  • Oracle Jive Forum Viewer Portlet problem in Firefox

    Has anyone used the Oracle-provided JIVE Forum Viewer portlet? We have built one with the personalization function enabled, so users can go to the personalize page to select the forum they want to view in the portlet.
    Everything works fine now, except that the tree menu to display all the categories and forums on the personalization page does not display or respond to mouse clicks correctly in Firefox. But if you right-click in the region of the tree menu, everything will just become fine.
    We wonder if anybody can help us to identify the problem and fix it. Thank you in advance!
    Yijia

    hi Yijia
    Could this possibly be a question for the "WebCenter" forum?
    WebCenter Portal
    (tip : You can use "Your Control Panel" to make your name visible in forum posts.)
    regards
    Jan Vervecken

Maybe you are looking for

  • Creative Cloud won't sync with my Libraries

    I'v reinstalled the latest Creative Cloud desktop app, and updated to the latest version of Photoshop CC 2014 - but I cannot get Creative Cloud to show me any of my assets (libraries) on the website. To troubleshoot in Creative Cloud preferences : 1.

  • Explorer error "Failed to retrieve the Information Spaces list." from HANA

    I am getting this dumb error "Failed to retrieve the Information Spaces list. // Request timed out" in Explorer's "Manage Spaces" area every time I click on the analytic view listed under my HANA sources of the Explorer. So, my HANA source is visible

  • Three Part Question involving OS 9.2.1 & OS 10.4 on Wallstreet Powerbook

    Please forgive me if there is already a topic on this particular issue. I looked, but was unable to find one. NOTE: It was suggested to me that I post this question here, in large part because of a particular member who is a Wallstreet expert. So...

  • How to verify the status of lock object???

    Hello, How to verify the status of lock object??? I need to know the status of the lock object and put the user in list. Exists a FM for this? Thanks!

  • Text Query Syntax

    I am brand new to Oracle Text. I am trying to do a where clause with CONTAINS with a pattern I want found ANDed to a pattern I want excluded (using NOT) from the results that the condition before the AND would return on its own. Example: select disti