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

  • SEARCH
  • Home
  • 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

var content = window.frames[i].document.getElementById(embed).value; /* content is: '<object width=480 height=385><param name=movie value=http://www.youtube.com/v/mmYVsGa-uZ0?fs=1&amp;hl=en_US></param><param name=allowFullScreen value=true></param><param
For my project I am sending the HTML value from one text editor. For
I have the following editor template @model DateTime? @Html.TextBox(, (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty),
I write a Text Editor with Java , and I want to add Undo
I'm writing a really simple name / value editor control where the value is
Strange behaviour. I use rich:editor with these attributes: (Irrelevant data removed) HtmlEditor editor =
I want to create a MVC 2 editor template for a value type i.e.
I have the following code: <div class=editor-field> <%: Html.TextBoxFor(model => model.MyId) %> <%: Html.ValidationMessageFor(model
I have my textbox value set to its data using htmlentities like: <input type=text
In Visual Studio C# text editor, when you want a property, you just type

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.