Newbie: How to handle a multi-step dialogue with no session?

I can't see how to handle the following trivial problem:
1. The user clicks on a button to retrieve values from the database
2. The values returned are displayed in a table on the same page
3. The user clicks a button next to the desired element
4. Some action is performed
I can achieve steps 1, 2, 3 but fail on step 4: the action is not called.
One prerequisite is that I don't want to store anything in the session or application scope.
In the example that follows, when you click on "Show Element" the action is not performed.
This is myExample.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Test</TITLE>
</HEAD>
<f:view>
     <BODY>
     <h:form>
          <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
          <p/>
          <h:dataTable value="#{myExample.elements}" var="elem" binding="#{myExample.dataTable}">
               <h:column>
                    <h:outputText value="#{elem}"/>
               </h:column>
               <h:column>
                    <h:commandButton type="submit" value="Show Element"     action="#{myExample.doShowElement}"/>
               </h:column>
          </h:dataTable>
     </h:form>
     </BODY>
</f:view>
</HTML>This is myExample.java:
package example;
import javax.faces.component.html.HtmlDataTable;
public class MyExample {
     private HtmlDataTable dataTable;
     private String[] elements;
     public MyExample() {
     private String[] readFromDatabase() {
          return new String[] {"one", "two", "three"};
     public String[] getElements() {
          return elements;
     public void setElements(String[] elements) {
          this.elements = elements;
     public HtmlDataTable getDataTable() {
          return dataTable;
     public void setDataTable(HtmlDataTable dataTable) {
          this.dataTable = dataTable;
     public String doSearch() {
          elements = readFromDatabase();
          return "";
     public String doShowElement() {
          String selected = (String) dataTable.getRowData();
          System.out.println("Selected element: " + selected);
          return "";
}This is in faces-config.xml
     <managed-bean>
          <managed-bean-name>myExample</managed-bean-name>
          <managed-bean-class>example.MyExample</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>

Thank you for your answer.
I didn't realise I could use inputHidden for anything more complex than a single string...
I have added a h:inputHidden for the elements array but it still doesn't work.
How should it be used?
     <h:form>
          <h:inputHidden value="#{myExample.elements}"/>
          <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null.

Similar Messages

  • How to handle multiple connection or user with l2cap

    hi friends,
    I need your help please a.s.a.p
    how to handle multiple connection with l2cap protocol in j2me
    sorry,
    I'm a new programmer in j2me
    thanks all...

    Please stick with the original thread http://forum.java.sun.com/thread.jspa?threadID=5200413&tstart=0
    Cross-posting is very rude, and JSch has nothing to do with JSSE, directly. It is an SSH2 API. It does (AFAIK) use some parts of JSSE, but those parts are definately not your problem.
    You already have answers in the other thread.

  • How to create a multi video player with iMovie

    Hey folks, I have a great wee QT player for my daughter's website which was generated for me by iMovie export. Lovely.
    But- folk are wanting to see more videos of her singing.
    Question- how to generate a multi-video player using the same principles (and same simple design)? One like those generated by YouTube's facility to create a list of videos to appear in a single player, or where it is possible to just click a "next" tab? Here is the page I am referring to: http://www.brigidmhairi.com/music.html
    Just to clarify- I am not wanting to use the YouTube player because it is a bit fussy and doesn't look right on the site in mind. The QT one has no borders etc and therefore suits me better. Besides- the 320 format is perfect.
    Hope someone can help me, thank you SO much.

    MacBraveheart wrote:
    .. how to generate a multi-video player using the same principles (and same simple design)? .. Here is the page I am referring to: http://www.brigidmhairi.com/music.html..
    Hope someone can help me, ..
    Hi HighlanderIn ..
    who else than me.. ?
    this is no iMovie related question.. that is
    a) html/CSS-coding or
    b) some flash-app
    read out the code on your linked website ... :
    <embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/33/videogallerywidget.swf
    pageobject_id=artistxxx bla bla bla /><br/>
    <a href="http://www.reverbnation.com/main/artist_feature/widgets">
    bla bla bla ..
    </noscript>
    .. going to that website reverbnation.com, it looks like they offer, as YT, a video-hosting service plus that 'special' player as a flash-code you can embed in your website (as the YTplayer) ..
    so, here are your options:
    • use this service.. costs? no idea, research on your own ..
    • use flash, encode yourself.. perhaps, you can find some 'ready made' coding?
    • *what website-maker do you use?* iWeb offers a template for videos.. many on one preview-page, 'click' creates a bigger version for playback ..
    .. as mentioned: less iMovie, more 'website creation' ..

  • How to handle html:multibox in jsp with ADF Data Binding

    Hi,
    I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
    "JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
    Here is my jsp code:
    <c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
    <c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
    <br>
    <html:multibox property="selectedSystemType">
    <c:out value="${type.SystemType}"/>
    </html:multibox>
    <c:out value="${type.TypeDesc}"/>
    </c:if>
    </c:forEach>
    Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • How do I make multi regional website with Adobe Muse?

    I am working for an art gallery with newly international presence.  I am creating 3 versions of a website in French, English, and eventually Mandarin.  While there will be links to bring visitors to mirroring pages in different languages, I want the language appropriate to visitors' device location to launch automatically.  In other words, www.site.com will bring users in Paris to French version of site while users in New York use the same address to access English site, each determined by their location.  Is this achievable in Adobe Muse?

    Hi
    Are you hosting site with Adobe Business Catalyst ? if yes!
    You may want to refer to this discussion : how to set up a multilingual website with Adobe Muse and push it live to Adobe Business Catalyst

  • How to handle a multi-department scenario?

    Hello,
         I've used WLI 8.1sp2 in the scenario of one administrator handling all
    processes of a company. However, I have a need to use a single
    installation to support multiple departments. Each department has its
    own set of users/roles, and has its own managers.
    I'd love to be able to let each department manager use the WLI console
    to configure their department's specific needs. However, there's no way
    to restrict them from viewing other processes and users in WLI.
    I'm thinking we need to provide a custom application to support this,
    where we can filter the processes and users by the department name (such
    as prepending the department name to the process name or user names).
    Then we'd have a custom application that uses the WLI APIs to filter out
    the information for that particular department.
    Can anyone comment on this scenario and how it could be achieved with
    WLI? Or, does anyone know a product that can handle such a scenario
    natively (I haven't seen one).
    Thanks

    Thank you for your answer.
    I didn't realise I could use inputHidden for anything more complex than a single string...
    I have added a h:inputHidden for the elements array but it still doesn't work.
    How should it be used?
         <h:form>
              <h:inputHidden value="#{myExample.elements}"/>
              <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
    ...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null.

  • How to handle classification multi value characterstic

    Hi,
    I searched SDN for multi value characteristic addition in to classificatin data source and found that we need to implement notes: 535370, 350296 sin sequence. But I'm wondering if there is any update on creating the class data source with multple value chars ? Please advice if we have any logic to add the multi value chars without changing the CT04 setting or implementing the notes....Thanks inadvance
    Sam

    We had to extarct multiple values from classification for equipment and Function Location. Created a generic Funcion module based extractor and used below approach to fetch multiple values :
    1. Enhance the extract structure with the Maximum number of required fields.
    2.Fetch Attribute Name, Attribute number and units (used for key figures) from CABN
    3. Fetch Object number for the given equipment from INOB by passing Equipment number and class type
    4. Fetch the attribute values from AUSP using object number (3), attribute number (2), object/class indicator and class type.
    5. Loop over the result set obtained (4) and using the attribute number, move the values to field corresponding to that of the extract structure.)
    Thanks,
    Monika

  • Newbie: how to handle pipes and semicolons while launching UNIX commands?

    Good afternoon,
    I am trying to write a Java class that can launch UNIX commands.
    Launching simple commands (date, ps -ef) works fine, but when I start using pipes and semicolons, it goes wrong:
    Java code (pipe example):
            String command = "ps -ef | grep config";
            Process child = Runtime.getRuntime().exec(command);Result:
    usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
            [ -u userlist ] [ -U userlist ] [ -G grouplist ]
            [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
      'format' is one or more of:
            user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
            pri opri pcpu pmem vsz rss osz nice class time etime stime
            f s c lwp nlwp psr tty addr wchan fname comm args projid projectJava code (semicolon example):
            String command = "date;ps -ef";
            Process child = Runtime.getRuntime().exec(command);Result:
    date;ps: not foundClearly the pipes and the semicolons are handled by the UNIX shell and cannot be put in the Java source code as such.
    Does anybody know a way around this?
    Thanks
    Dominique

    Pipes and semicolons are interpreted by a shell (bash, csh etc) and when one executes as you are doing no shell is involved. This is easy to solve by using the alternate version of exec() which takes an array as an argument and to use your shell of choice. For example :-
    String[] command = {"bash", "-c", "date;ps -ef"};Note that the third argument is the whole of the command to be interpreted.
    Two points to consider. First you should read, digest and implement all the recommendations in http://www.javaworld.com/jw-12-2000/jw-1229-traps.html; failure to do so will at some point lead to significant loss of hair. Second you should probably use ProcessBuilder rather than Runtime.exec(). Behind the scenes Runtime.exec() uses ProcessBuilder but ProcessBuilder provides a better interface with more features.

  • Front end issue (how to handle the existing work along with new one)

    We have upgraded a copy of our production system and are analyzing different pieces to make sure that we have enough confidence in moving ahead. We are getting a good feel in the back end activities but do have many questions in Front end area, such as
    ·     What is the best way to handle existing excel reports yet at the same time providing users ability to create new queries and excel reports. Currently users are using Bex browser to access reports but this is no longer supported for new reports.
    ·     Do we must have portal configured in order to access the new features?
    ·     Is there a risk if users open the existing workbooks with the help of new analyzer?
    ·     Is there a risk if users open the existing queries with the help of new query designer?

    Until you migrate them to 2004s, you can continue to access the 3.x queries, etc. using the 3.x tools. 
    However, once you modify/save the 3.x query using the 2004s tools, it will convert that object and all related objects (variables, structures, etc.) to the new 2004s version.
    A suggested strategy for conversion of BEx objects to 2004s is to migrate them by infoarea.  For example, convert all FI-GL objects together.  This method enables BW teams to create a "roadmap" for migration.

  • How to handle 2 semanticaly different characters with same master-data?

    Hi specialists,
    I've got a little moddeling problem - here's the szenario:
    I've got a cube with a dimension "Customer".
    This dimension shall have the following characteristics
    - CustomerNumber (0Customer),
    - Region_Cust (0Region (or reference of 0Region))
    - Country_Cust (0Country (or reference of 0Country))
    - Region_ShippedTo (ZRegion (=Reference of 0Region))
    - Country_ShippedTo (ZRegion (=Reference of 0Region))
    (The mentioned Info-Objects are just a proposal)
    The regions need to be in the cube (for historical correctness) - (Display-)Attributes won't help.
    The hatch: 0Region has a compound with 0Country. There seems to be no way to tell Region_ShippedTo to use ZRegion for the compound.
    Let's say a customer has it's headquarter in Germany(Region: Berlin) - while the product is shipped to the brance in France(Region: Ile-de-France). Imho this is currently not modellable.
    So how can one implement that (not that artificial) szenario without beeing forced to dublicate and keep synchronized the 0Country-InfoObject and all of its master-data? Master-Data should imho follow the idea of beeing centralized - it should be useable for the customer country/region as well as for the shipped-to country/region.
    Could you please gimme a hint how to solute that problem?

    I see - you're absolutely right! - Thanks!
    Unfortunately the time-dependance is just the half job.
    I fear I've to modify my szenario for making my problem clear:
    Customer (with region_customer and country_customer) orders a product which might need to be shipped to a different region/county for every new order. (Simple example: Customer often orders flowers at flowershop.net - which need to be shipped to an always different ship-to region/country ).
    In that case I certainly can't store the ship-to region/country in the customer's master-data, can I?
    But I need them for futher analyze. In this case I need to add them to the cube - and it needs to be navigation-enabled. (region_shippedTo, country_shipedTo)
    Now I want to report all customers from France together with all regions where the product was shipped-to.
    Is that possible? Can I set a filter for country_customer (=0Country) without filtering the shipped-to regions (which are references of 0Region, which has a compound-key with 0Country) at the same moment? Will the report still show me the flowers shipped to Berlin?
    Hope I could clearify my question a bit!?

  • Multi step form with three tables

    Hi:
    I have a database with 3 tables. Table 1 has one-to-many
    relationship with two others. Infact in table 1 user should enter
    his basic info and details will be submited itno two other tables.
    Is there any easy way to make it with DW/colfusion?
    I know that session may help but it is needed that each page
    can submit information (if the user doesn't fill the last form them
    I may loose data with session)
    I thought of sending information to other page with form
    action="page.cfm" but my problem is I don't know how to submit
    information in the second form that the primary key of table one
    becoms the foreign key of the next page. Please please I really
    need this. I really need it.
    Thanks
    Benign

    Hi:
    Thanks for the reply. In fcat I have to put them in different
    pages because they have many many fields.
    Is there any easy way to do it?
    My project is about patients registration database. I am a
    medical doctor and know some about coldfusion and some about SQL. I
    am doing this project for the patient and free of charge and I can
    not hire any professional programmer. My research center has boght
    a Coldfusion Web server (Webserve.ca) and we are in hurry to
    register the patients and organize their data to manage their
    cancer problems or alarming them for future personal/familial
    follow ups.(purchasing the host was a problem then {because of the
    money shortage}but solved fortunately)
    The cancer information tables are about 10 tables and a
    parent table for patients general/personal information.
    I tried to build it with coldfusion/dreamweaver wizards but I
    have many problems. There is no coldfusion expert avaiable as I
    said (as you know there is a shortage of money in research centers)
    and the solution is something that the patients really need.
    It will be great if some one helps me. Surely the name of the
    this project savior (you are really a savior of many if you help)
    will be a part of the prject.
    Thanks
    Benign

  • How can I implement  Multi Factor authentication with IAM products?

    Hi I would like to implement multi factor authentication that can be made generic with all IAM produts. Can anyone suggest an MFA factor like that? It shudnt be an add on or plug in. Instead it should be an in built feature. Can anyone suggest any idea?

    Opensso has such feature built-in. You can create an authentication chain in which you can add as many authentication mechanisms as you need.
    Although it is a built-in feature, there's no full support for all sorts of authentication methods. Some of them exist as plugins, like authentication modules for smart cards and biometrics because they are not sold by Sun Microsystems. However, there's a solution for you requrement even tough you might add some auth modules as plugins like biobex, activcard or auth modules from other vendors.
    Regards.

  • How to handle upgrading a time capsule with an external drive?

    My Time Capsule recently filled up. I have 2 computers I'm backing up - a Mac Pro and a MacBook Pro. I purchased a larger external hard drive and connected it to the Time Capsule, and it appears to be backing up the Mac Pro just fine. I was thinking that it might be useful to have the MacBook Pro back up to the older smaller drive, since its drive is smaller than the Mac Pro's. So my question is - now that the Mac Pro is completely backed up on the new drive, can I just get rid of the old back-ups on the smaller drive and start backing up the MacBook Pro to it? I don't have a lot of need to find old files or go back to older revisions at this point. I'm mainly concerned with catastrophic failure (as recently happened), so as long as I have the latest backup, and can restore from it, I'm happy with that.
    I'm curious what others do when they add a new drive after one fills up? I'd like to be able to continue to use the older drive, since it appears to still be good, but unless I delete the old backups, it looks like Time Machine won't make much use out of it.

    That is correct procedure.. if the TC is older than 3years.. begin to be suspicious of the TC's continued longevity.. they do become unreliable and hard disks do not last forever,, especially if it is older one, running in an oven effectively all its life.
    What model TC do you have? A1xxx model number from the base please.. molded into the rubber rather than on the label where it should be.
    If it is gen1 or gen2 both power supply and hard disk is already well past the useby date. Consider a replacement or using USB drive so you are not caught with the backup gone when it fails.. although it usually isn't bad.. if you only have backups on the TC. It is people trying to use them as a NAS who really hit the brick wall.

  • How to handle starting of external processes with Runtime.exec() properly

    hi people,
    you find a lot about starting external processes with the Runtime class in every forum.
    -> that the stdout of the started processes has to be redirected and read
    due to os buffer problems
    -> that calling batches is done by starting the interpreter and the batch as parameter (cmd.exe, /bin/sh,..)
    -> that the created process doesn't have an os environment
    -> ...
    but what if you don't know anything about the started process.
    what if you only want only to start an external process. if you don't want to wait til waitfor() returns and if you don't read the streams of the created processes, the os stdout buffer will overflow immediately an the started process will be blocked.
    you can read the stdout of the started process, but what if the process does print nothing to stdout, and your bufferreader.readLine() will block ?
    you can do this (read buffer, waitFor()) in an separate thread, but the thread lives til the started process will finish, so maybe you got dozens of senseless thread ?
    So, what is an effective and good way to start external programs/processes if you don't know about them.
    so i would be grateful for an answer
    regards
    Alen

    I realize that's a pat answer, but it's true. Spawing off another program without being able to predict its behavior is dangerous.
    But anyway, as I understand it creating a new process is relatively expensive. The cost of creating new threads to read the process's I/O and later garbage collecting those threads when the process dies, probably isn't much of an additional burden.

  • The basics on how to handle profiles correctly when working with LAB colors?

    Hello,
    I need to incorporate several blocks of color into an InDesign document. I have the colors in a list as LAB values. The document will be printed, and I have the profile for the printer/paper combo we plan to use.
    Would one of you be willing to walk me through the Working Space, Color Management Policies, and Assign/Convert Profile setings that I should use to get the best result?
    And, specifically - assuming I am using the Color Panel - not swatches - to color in the blocks: What settings should I use inorder to allow me to rely on the provided "out-of-gamut" warning to alert me if I am attempting to use a color that won't print correctly?  I don't care if it is out-of-gamut for the purposes of my display - it is whether it is out-ouf-gamut for the purposes of printing that I want to know about.

    Do the LAB colors look the same on the monitor regardless of which RGB
    you are using? For example, if I switched from sRGB to Adobe RGB, would
    the colors which had been specified in LAB still look the same?
    Yes. But keep in mind using Lab doesn't let you get around having a well calibrated and profiled monitor. Lab is device independant so it doesn't have a profile, but in order to display it needs to be converted into your monitor's RGB space via your monitor profile, so the accuracy of your monitor profile is important if you are relying on the soft proof.
    Is that what is called "Convert to Profile" in InDesign?
    When you export to PDF you have the option to force all colors into one destination space (or not). In the Output tab of the Export dialog you can set your Destination to your printer's CMYK profile and the choose Convert to Destination as Color Conversion. That setting will convert your Lab colors to CMYK during the export. Convert to Profile... in the Edit menu let's you convert document RGB or CMYK colors from one RGB or CMYK space to another. It would have no effect on Lab colors.
    Is the out-of-gamut warning only for CMYK?
    Yes, it's using your document's CMYK space as the gamut
    So if I specify a color using LAB which is out-of-gamut for the RGB
    space I am using but in-gamut for my CMYK profile, I will NOT see a
    warning?
    Right. That would be unusual, but the Lab value for 100% cyan in your printer's CMYK space is likely out of gamut to any RGB space. But your destination is CMYK so that's the gamut you care about.

Maybe you are looking for