Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331828
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:10:08+00:00 2026-05-21T10:10:08+00:00

<p:editor value=#{editorBean.value} widgetVar=editor width=686 height=390 language=en align=center> </p:editor> Following is my rich-text editor bean

  • 0
<p:editor value="#{editorBean.value}"  widgetVar="editor" width="686"
height="390" language="en" align="center">
</p:editor>

Following is my rich-text editor bean picked up from primefaces

@ManagedBean(name = "editorBean")
@SessionScoped
public class EditorBean {
    private static final String MANAGED_BEAN_NAME = "editorBean";
    private String value;
    public static EditorBean getCurrentInstance() {
        return (EditorBean) FacesContext.getCurrentInstance()
            .getExternalContext().getRequestMap().get(MANAGED_BEAN_NAME);
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }
}

Apart from this I have another bean say A. I have a method inside A that populates a HTML table. What I want is when the user opens the editor, it should be pre-populated with that HTML table data and of course the changes should get reflected into (String: value). Therefore, you can say that I am trying to tie up both the values together. I think it needs to be done with DI but somehow its not working. If someone can guide or quote an example, it would be really helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:10:09+00:00Added an answer on May 21, 2026 at 10:10 am

    One way to do it is rewrite your getValue() method to pick up the value from bean A.
    And yes, the reference to your A bean should come from DI:

    //injecting a reference to A
    @ManagedPropery(value="#{A}") //or whatever is the name of your bean
    private A beanA;
    
    public void setBeanA(A beanA) {
        this.beanA = beanA;
    }
    

    Or, with CDI, just:

    @Inject private A beanA
    

    Finally, your getValue method

    public String getValue() {
        return beanA.getValue()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I couldn't post the textarea value with ajax in elRTE rich text editor. The
Consider the Visual Studio's highly-customizable configuration of the text editor. The value I'd like
i am using this function to insert text into NicEdit, function insertAtCursor(editor, value){ var
I have the following editor template @model DateTime? @Html.TextBox(, (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty),
I am making my Rich text editor. I have a textarea and an iframe.
I'm using the Yahoo YUI 2 rich text editor. I would like to change
For my project I am sending the HTML value from one text editor. For
Here is my css: .editor-field textarea { width : 400; height : 100px; }
I have been trying to use SharePoint:InputFormTextBox as Rich Text Editor in my SharePoint
Strange behaviour. I use rich:editor with these attributes: (Irrelevant data removed) HtmlEditor editor =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.