Edit mode simulation

I'm trying to make my pages look like documents on Lotus Notes/Domino.
That is : the page displays first with the texts, and no input fields, but with an Edit button at the bottom.
Once the Edit button has been pressed, you can see the fields, and modify them. At the bottom of the page you have a Save button that saves the information you entered in the beans, and toggle back the read mode.
The problem is that the EditMode bean can't be sotred in the session because then the edit mode would be toggled for the other pages you migh have open in other browser windows.
Here is a snipset from my application :
faces-config.xml
<faces-config>
     <managed-bean>
          <description>
               This bean is used to change the state from edit fields, to simulate read and edit modes.
          </description>
          <managed-bean-name>editMode</managed-bean-name>
          <managed-bean-class>com.seanergie.faces.EditMode</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
</faces-config>
In the jsp :
<f:view>
     <h:form id="editAdvertiser">
          <h1>Advertiser ${advertiser.name}</h1>
          <label><h:outputText value="Name"/></label>
          <h:inputText id="name" value="#{advertiser.name}" size="50" rendered="#{editMode.edit}"/>
          <h:outputText value="#{advertiser.name}" rendered="#{editMode.read}"/>
          <h:commandButton value="Edit" actionListener="#{editMode.switchMode}" rendered="#{editMode.read}"/>
          <h:commandButton value="Save" actionListener="#{advertiser.save}"/> rendered="#{editMode.edit}"/ >
     </h:form>
</f:view>
The edit mode bean :
public class EditMode {
     private boolean edit = false;
     public EditMode(){}
     public EditMode(boolean edit){
          this.edit = edit;
     public boolean getEdit(){
          return edit;
     public void setEdit(boolean edit){
          this.edit = edit;
     public boolean isEdit(){
          return edit;
     public boolean isRead(){
          return !edit;
     public void switchMode(ActionEvent event){
          edit = !edit;
     public static void setMode(boolean editMode) {
          java.util.Map scopeMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
          scopeMap.put("editMode", new EditMode(editMode));
          //Following Doesn't work if the bean hasn't been referenced yet
          //FacesContext context = FacesContext.getCurrentInstance();
          //Application application = context.getApplication();
          //ValueBinding binding = application.createValueBinding("#{editMode}");
          //binding.setValue(context, new EditMode(editMode));
}This works fine if the editMode bean has a session scope, but if it has a request scope (as it needs to be), it doesn't work anymore.
The advertiser.name isn't updated, as the default value for the editBean is false (read mode), and the input tag for the name field as rendered="#{editMode.edit}", when the view is restored, the input tag is hidden, and so, the new name value isn't commited in the apply requested values phase.
Is there a way to have this working ?
This would be really nice, as it allows to have the same page for editing and displaying customer info for example, and it would greately reduce the amount of coding and maintenance for our project.
Thank you,
Sylvain

I made it work using the MyFaces x:saveState tag :
Just add <x:saveState
value="#{editMode.edit}"/> in the page and it
works :-)Hi Sylvain,
Could you send me example your form?
I'm working on almost same thing and had similar problem.
I have several ideas in area editing data and ready to send you some of them.
I'm creating form that used RowSet.
For example I found solution for delete row from table by button that located outside dataTable.
Vladimir

Similar Messages

  • Gl account tab needs to be editable mode in Miro hear level

    Dear Team,
    Please let m eknow how i will make the editable mode for the GL field in the MIRO hear level.Please let me know the implications by doing this.
    Thanks for the consideration.
    Regards,
    Suma

    Hi,
    MIRO -Details Tab GL accounts is automatically adopted from the Vendor master record Reconcillation account. You cannot modify this GL while simulating Invoice for the POs.
    Usually this GL account Credit to the amount of supplier when posted the invoice.
    If you will edit this GL in invoice simulation,system through Error message of GL posting error.
    I hope this will help your Issues.
    Thanks,
    Thiru
    Edited by: thiru on May 26, 2010 1:22 PM

  • Sequencing Screen Captures in Edit Mode

    I've used Camtasia alot and am transitioning to Captivate. To
    test recording and editing in Captivate, I recorded one minute of
    screen activity to simulate capturing an application demo. When I
    end the recording, it converts the recording to thumbnails and puts
    them in Storyboard mode but also chunks it into slides that I can
    not sequence in Edit Mode. I get 10 seconds chunks and I can't
    figure out how to put them together to make one sequence. Do I have
    a wrong setting? Any help is greatly appreciated.

    Hi Jennifer and welcome to our community
    This isn't intended to slam or highlight either product, only
    to point out differences.
    Camtasia captures full motion from the onset. Captivate
    captures individual screen shots and places them on slides.
    Captivate does do full motion capture, but it's not intended to be
    used like Camtasia's is. For example, you would never want to
    surround Windows Media Player using Captivate and record a five
    minute video. But you could do this with Camtasia. (copyrights
    notwithstanding)
    Camtasia allows text captions, but you have to add them after
    the fact. Captivate can add these things automatically. Captivate
    wins with these hands down, as there is more variety and they look
    more polished and professional.
    Captivate has only two different output types. .SWF and .EXE.
    Camtasia offers a wider selection. Including .FLV (Flash Video) ,
    .AVI (Audio/Video Interleave, .WMV (Windows Media), .QT
    (QuickTime), .RM (RealMedia).
    The Camtasia Timeline represents the entire project.
    Captivate's Timeline is per slide.
    Camtasia has some neat transitions you may use, but you have
    to split the movie manually and it takes a bit of getting used to.
    Captivate has a few transitions for slides, but the process seems
    more intuitive. At least to me.
    Captivate offers three "levels" of audio. Background track,
    Slide and Object. Camtasia essentially has two and seems a bit
    rigid as opposed to Captivate.
    Both products offer quizzing functionality. However,
    Captivate's seems more robust and easier to use. At least it does
    to me.
    Both products record the screen, but as near as I can tell,
    Camtasia is unable to record like Captivate does, where you end up
    with a simulation. You may certainly add Flash hotspots later, but
    Captivate does it for you.
    Those are just a few differences I noted. There are many
    more. Hopefully this helps give you an idea. Personally, while both
    products do essentially the same thing (record the screen) I easily
    see a need to have both.
    Hopefully this was helpful... Rick

  • Can't open photos in edit mode

    I can;t open photos in edit mode in iPhoto '08. When I double click on a photo the main window remains blank (no "!" no"?"). This problem occurs with every photo in the library. My permissions are OK. I've also tried setting the preferences to edit in Photoshop but double clicking on the photos then still accomplishes nothing.

    Steve:
    Do you get a blank white window in the edit mode? If so that may mean you do not have access to the files. Try the following:download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administrator login name, long or short, in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field.
    FYI:
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Can't view photos in edit mode

    Hello,
    I just upgraded to iPhoto '08, and while I can view all my thumbnails ok, the photos themselves won't load at all in edit mode.
    I was using iPhoto to try to"jumpstart" my iWeb (per my other help request in another topic) when I noticed this.
    I have Leopard 10.5.2, iPhoto 7.1.2 and a 1.8 GHz processor and 512 MB RAM in my upgraded G4 tower. I tried deleting the preferences file, rebuilding the library file, opening in another account, etc, with no luck. I had even just erased my hard drive and cleanly re-installed Leopard, etc. with still the same problems in both apps. Do I just need to add more memory perhaps? I can't think of anything else...?Does Leopard require much more memory than Panther (which I had before) to run properly?
    Thanks,
    Paul

    I've had the what sounds like the exact same problem with iPhoto '08. I, too, have an upgraded 1.8 GHz G4 (AGP Graphics) running OS 10.5.3 (although the original installation was 10.5.1 and the same problem occurred before the software updates). When I try to edit a photo, the edit window opens but no picture appears. Clicking on the various editing tools and manipulating them (blindly, on a blank screen) shows that editing is actually taking place, and that changes can be saved.
    An earlier post of mine concerned the first problem I noticed since my OS and processor updates; namely, that the DVD player app won't work, but instead returns an error message saying that a valid device could not be found for playback. Several responses to that post seemed to suggest that the ATI Rage 128 video card might be the culprit and that it would need to be replaced. In the past week I've been on the phone or in email contact with tech support people at ATI, Sonnet, Other World Computing, and Apple, the last being the least knowledgeable of all of them, I'm sorry to say.
    The Sonnet guy personally runs a computer just like mine, but with the ATI Radeon 9800 Pro Mac video card. That item costs $209 at OWC. But ATI says it won't work because of the G4's 200 power supply.
    These folks think that the iPhoto problem would be solved by the new video card -- but I'm not yet convinced I want to spend that kind of money to find out. Most also say that the DVD Player issue would be fixed, although the OWC guy says it has nothing to do with it.
    So we're going blind here, with much conflicting expert opinion. I'll keep watching for further discussion.
    cc

  • Unable to open a view in edit mode

    Hi All,
    I have a Notes assignment block in the Account Overview page. It contains a text area and an EDIT button to modify the notes. Corresponding view and context node for this block are  BP_DATA/NOTES and NOTES respectively. Notes context node is bound to Text context node of the component controller.
    The issue is, when agent confirms an account, goes to Overview page and clicks on EDIT button of the Notes block, then, if the block already has some text, then it turns in to EDIT mode. But if Notes section is empty initially, then, on click of EDIT button will not make the view editable.
    During debugging, I can see that if notes section is already filled with some text, then there is an entity in the collection wrapper of the NOTES context node(also in the component controller collection wrapper). But if notes section is initially empty, then collection wrapper is empty(both view and component controller context nodes).
    My requirement is to make the notes section editable even if there is no text present in it initially. It will be very helpful if someone could give me suggestions on this issue.
    Thanks and Regards,
    Naren

    Hi Nitish,
    Thanks for your reply. Infact I only coded the event handler. In the first line, I am reading the entity from the collection wrapper of the context node. If it is bound, only then I can set it in EDIT mode.
    ob_entity ?= me->typed_context->notes->collection_wrapper->get_current( ).
    IF ob_entity IS BOUND.
    Sets the view in EDIT mode
    Now, ob_entity is null if there is initially no data in the notes section of the confirmed account. However, if notes is not empty, then, ob_entity is bound and I can set the view to edit mode. This is the issue.
    Regards,
    Naren

  • How can I open an email file in edition mode?

    Hi!
    I use a system here in my company that generates an automatic email and prepare it to be sent.
    We were using MS Outlook and we have migrated to thunderbird for lots of reasons.
    But since it has migrated, the system cannot generate this email in the composition screen.
    It generates in the inbox.
    Is there anything I can do to change this?
    I have made a few tests and I realize that the same thing happens if I save an email file in my computer and
    try to open if with the thunderbird. It's supposed to open in edition mode, so the user can send it out, with just one click.
    Thank you!

    https://support.mozilla.org/en-US/questions/1004680

  • Text Caption appears in Edit Mode but not in Preview Project or Web Browser

    I'm using Cp4 and have downloaded Adobe Flash 10 Active X, it's ver 10.1.82.76.  I've added a simple text caption with these options:
    Timing Display:  Rest of slide
    Appear after:  2.0 seconds
    Transition effect:  Fade in only
    In: .5 seconds
    And Visible is checked
    I also have a simple line that I drew with the draw line tool and included an arrow on the end of it.
    Everything on the screen works including the click box, the animated text and the failure caption.  For some reason the text caption and the arrow are not appearing except in Edit Mode.  In Preview Project, they disapper but the click box, failure caption and animated text work fine.
    I've rebooted, copied this screen into a new instance of Cp4, re-created these objects on a freshly recorded screen, chosen Order: Bring to Front, created a brand new screen completely from scratch and downloaded the Flash 10 Active X version mentioned above.
    They funny thing is, is that the text caption and arrow works fine on other screens in the project.  I have 76 screens total.
    I'm running Windows XP.
    Any suggestions?

    Hi there
    Can you post a screen capture of what your Timeline looks like?
    Odds are your Click Box is pausing in a weird place.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Ctrl+tab is not working in editing mode

    I have JcheckBox and JTable in my JPanel. When user clicks or presses F2 to edit any cell value of the JTable a comboBox will appear with possible values. (This comboBox is coming from table CellEditor). When user presses ctrl+tab from the table focus should transfer to JComboBox all time. It is working only when the user presses ctrl+tab from the table cell which is not in editing mode. If the user presses ctrl+tab from the table cell which is in editing mode (i.e. focus is on the ComboBox of the cellEditor) it does not work. Please help me to find the solution.
    I give a sample code here for your reference.
    public class Frame1 extends JFrame {
    public Frame1()
    super();
    this.setLayout( null );
    this.setSize( new Dimension(400, 300) );
    JTextField ch = new JTextField();
    ch.setVisible(true);
    ch.setBounds(10, 10, 10, 10);
    this.add(ch, null);
    DefaultTableModel tmodel = new DefaultTableModel(3, 1);
    tmodel.setValueAt("0 0 1",0,0);
    tmodel.setValueAt("1 0 1",1,0);
    tmodel.setValueAt("2 0 1",2,0);
    JTable custLayersTable = new JTable(tmodel);
    custLayersTable.getColumnModel().getColumn(0).
    setCellEditor(new ComboEditor());
    custLayersTable.setBounds(new Rectangle(40, 40, 280, 145));
    custLayersTable.setSurrendersFocusOnKeystroke(true);
    this.add(custLayersTable, null);
    public static void main(String[] args)
    Frame1 a = new Frame1();
    a.setVisible(true);
    final class ComboEditor extends AbstractCellEditor
    implements TableCellEditor
    public Component getTableCellEditorComponent(JTable table,
    Object value,
    boolean isSelected,
    int row,
    int column)
    Vector<String> layerValSet = new Vector<String>();
    for(int i=0; i<3; i++)
    layerValSet.add(row+" "+column+" "+i);
    mComboModel = new DefaultComboBoxModel(layerValSet);
    mComboModel.setSelectedItem(value);
    mEditorComp = new JComboBox(mComboModel);
    return mEditorComp;
    public Object getCellEditorValue()
    return mEditorComp.getSelectedItem();
    private DefaultComboBoxModel mComboModel;
    private JComboBox mEditorComp;
    }

    Thanks a lot for your reply.
    Since the textField is in a different class i could not use the transferFocus API directly. I tried the following code in the keyreleased event of Combo Box but it was not working.
    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(
    e.getComponent().getParent());
    I also tried the following code in stopCellEditing and is not working.
    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent();
    Is there any other way to achieve this?

  • Deleted Items Stay in Edit mode?

    When Adding Items to a portal, for instance an Image... and then I want to delete that image... I can delete it so the image no longer shows on the finished page, but the Item still shows in the Edit mode. How do I delete the Item so it no longer shows in Item mode

    Assuming that you are using 10g:<br><br>
    Yes, you can disable this feature. Click on Properties of the Page Group that you want to disable this feature. Go to the third tab Items.<br><br>
    On this tab you will see 2 options :<br>
    Retain Deleted Items <br>
    Display Unpublished, Expired, and Deleted Items In Edit Mode <br><br>
    Either enable or disable based on your preferences.

  • FBL5N - Feild selection non editable mode

    Hi All,
    When i execute FBL5N transaction,i am not able to select the feilds as per my desire bcoz the feild display ICON is in non editable mode.
    The only option i have is layout selection and not the feilds selection.
    Can you let me know how to change it to editable mode.
    regards

    Hello,
    You don't have authorization for maintain ALV layouts. Please contact to your Basis department for authorization.
    ALV layout authorization object is S_ALV_LAYO. Please tell your Basis departman to give this object value for '23'.
    Regards,
    Burak

  • How to open an order form of a particular order in edit mode

    hi
    i need to open a order's order form in edit mode so that it can be approved or any other operations done on that.
    there is an similar post but the soln s nt available fr the abve mentioned prob
    " i dont knw what are the exact parameters that should be assigned in ordfind so that it will lead to the ordhead"
    thank u in advance for any guidance that cud be provided.

    I m using oracle appln server 10g forms. I m trying to open tat form using a url.. generally i m accessing via a java program where i m giving tis url.

  • Want BW Report within Portal in Editable mode

    HI Gurus,
                  I hav created Bex Appln iView from Query string obtained from "Query Designer". Now I am able to view Selection screen. When I enter some values and execute Report gets generated. But this report is in Display mode.
                  My BW functional consultant want this report in Editable mode to update some fields. They are saying they are able to edit If they go to Bex analyzer (Execel Format).
                 Please suggest me probable solution. or what I am missing ?

    Values in a BW report cannot be changed.
    However a report from integrated planner can be.
    I expect your are on BI 7.0 with IP.
    You need to create a planning cube and additional Planning Levels.
    It is a rather different setup but you can read about it here.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/6e01a04e-0a01-0010-dfbe-951c2c39d169
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/0c033316cd2bc4e10000000a114cbd/frameset.htm
    Best Regards
    - Rasmus
    Please reward points if helpfull.

  • Issue with opening the Outline in Edit mode

    Hello Gurus,
    I am opening a huge outline in the Edit mode on EAS Console & it's giving me an error "not enough memory to perform this operation", while I am able to open the other small outlines on EAS Console/Same server in the edit mode.
    Is this to do with freeing up Java memory. Will restart of EAS service work in this issue & free up Java memory?
    Thanks in advance.

    Hi RishiI've had problems with opening up the outline in edit mode before. Haven't come across this error no, and I can't find anything on the knowledge base. Try this though...- Check at the Analytic server level for Locks and Locked Objects. If there are any get rid.- "Update Mode" in the Spreadsheet Add-In will cause similar problems by locking data blocks.- All else fails! Reboot serverIf it's something else drop me a line back. I'll be interested to hear whats causing the problem.TaMark

  • Open file in edit mode

    I need to open a file in edit mode. In my web part on item click I need to do some action before hand (like create a folder and copy file, then open it in edit mode).
    I came across the code segment below to set to a hyperlink's onClick() event
    <a onfocus="OnLink(this)"    href="/Shared Documents/myDoc.docx"    onmousedown="return VerifyHref(this,event,'1','SharePoint.OpenDocuments','')"        onclick="return DispEx(this,event,'TRUE','FALSE','FALSE',            'SharePoint.OpenDocuments.3','1', 'SharePoint.OpenDocuments',            '','','','1','0','0','0x7fffffffffffffff')">Click</a>
    But in my case, it would be nice if I can open in C# code behind, after the folder operations in my Visual web part.
    SPfile's file.OpenBinary() give a byte[], but was unable to open file.
    I am using a LinkButton for the user to click on. Any advise ?

    Hi Ahamed,
    I guess you need to undertake some action server side before you redirect the user. There are a number of different ways to do it ... maybe using a long running process with redirect at the end ... or some jQuery that calls a "handler" waits for a response
    and then redirects the user.
    For the code to duplicate or copy the file see here:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.aspx
    if the existing code you have to open the document in edit mode works you should be able to reuse it.
    Thanks Chris

Maybe you are looking for