Question about encoding/decoding a custom UIComponent

Hello,
I am trying to create a custom JSF component using the following code :
class UICustomCTP extends UIInput {
      * Component that holds a list of Norms
     public static final String COMPONENT_TYPE = "org.alfresco.faces.CustomCTPInput";
     public static final String COMPONENT_FAMILY = "javax.faces.UIInput";
     // ID's
     private static final String ID_CTPKEY_FLD = "-ctpkey-field";
     private static final String ID_CTPDESC_LST = "-ctpdesc-list";
     @Override
     public String getFamily() {
          return COMPONENT_FAMILY;
     @Override
     public void encodeBegin(FacesContext context) throws IOException {
          // Set-up the dynamic id's
          String idClient = getClientId(context);
          String idCtpKey = idClient + ID_CTPKEY_FLD;
          String idCtpDescList = idClient + ID_CTPDESC_LST;
          ResponseWriter writer = context.getResponseWriter();
          writer.startElement("div", this);
          writer.writeAttribute("id", "ctp-container-part", null);
          writer.writeAttribute("class", "ctp-container-part-style", null);
          writer.write("R�sum� :");
          writer.startElement("input", this);
          writer.writeAttribute("id", idCtpKey, idCtpKey); // is the property name should be the same as the key?
          writer.writeAttribute("type", "text", null);
          writer.writeAttribute("value", "", null);
          writer.writeAttribute("style", "width:20px", null);
          writer.endElement("input");
          writer.startElement("select", this);
          writer.writeAttribute("id", idCtpDescList, idCtpDescList); // is the property name should be the same as the key?
          writer.writeAttribute("size", "5", null);
          writer.writeAttribute("style", "width:300px", null);
          writer.writeAttribute("multiple", "1", null);     
               there's many option items here
          writer.endElement("select");
          writer.endElement("div");
          super.encodeBegin(context);
     @Override
     public void decode(FacesContext context) {
          super.decode(context);
          // Set-up the dynamic id's
          String idClient = getClientId(context);
          String idCtpKey = idClient + ID_CTPKEY_FLD;
          String idCtpDescList = idClient + ID_CTPDESC_LST;
          // retrieve the request
          Map requestParamMap = context.getExternalContext().getRequestParameterMap();
          String ctpKeyInputValue = (String) requestParamMap.get(idCtpKey);
          List<String> ctpDescInputValueList = (List<String>) requestParamMap.get(idCtpDescList);
          Object ctp = new CTPItem(ctpKeyInputValue, ctpDescInputValueList);
          setSubmittedValue(ctp);
          setValid(true);
     @Override
     protected Object getConvertedValue(FacesContext context, Object submittedValue) {
          CTPItem ctpItem = (CTPItem)submittedValue;
          return ctpItem;
     } I don't have, and don't need and I cannot use renderer, tag definition, taglib definition because this component is generated through Alfresco ECM
(and I don't have access to the JSP (not authorised)).
My problem:
When I try to read the inputs through request parameters :
      String ctpKeyInputValue = (String) requestParamMap.get(idCtpKey);
      List<String> ctpDescInputValueList = (List<String>) requestParamMap.get(idCtpDescList);It returns always null.
It's is not very clear what value to put in the third parameters in writeAttribute and what is the logic behind with that property.
It looks like I forget to implements something but cannot find what. I read many tutorials and forums but didn t find any solution.
Thanks if somebody can help me.

Silly me... just forget that id and name are not the same...
Thanks, it work perfectly with name attributes.
Regards,
Patrick

Similar Messages

  • Question about setting cookies and custom authentication

    I have a question about setting cookies.
    I have two different 'projects' in HTMLDB - we will call them App1 and App2.
    I also have two different connection configurations setup in the DADs.conf file. - we will call them Connect1 and Connect2.
    App1 is setup to use database authentication (no user is specified in the DAD) and uses Connect1. Once the user successfully logs in, we set a username cookie (this is a persistent connection).
    We created a custom authenticatoin scheme for App2 - this scheme checks for the username cookie (set by App1). We would like for App2 to use Connect2 (HTMLDB_PUBLIC_USER is the default user specified and it uses connection pooling).
    Is it possible to set a cookie from App1, Connect1 for App2, Connect2 - then redirect to App2 and pick up that cookie?
    Here is an example of what we are trying to accomplish:
    A user loggs into App1, we set a cookie, and the user is redirected to App2. If the cookie exists, we allow them access to the home page in App2, if no cookie, we redirect back to a 'Login Failed' page in App1. We don't want App2 to use the same database connection as App1 though, we need App2 to use connection pooling.
    Is this possible? OR...Is there a better way to accomplish what we want to do?
    This is an enhancement to an existing app. Our requirements are to use Database Authentication (setup where pass expires after 60 days or so, cannot reuse last 3 passwords, etc.) - which is already setup and being used by other applications in our organization. All of our users have accounts in the database. We don't want users to have a new username/pass - and we don't want to manage a separate group for HTMLDB apps.
    The existing application uses HTMLDB's built in authentication - which uses database username/pass, and it uses connection pooling, but we cannot handle the pass expire stuff in it, unless there's something we're not seeing or understanding - at least that's how our DBA explained it to us.
    Any help with this will be appreciated so much. I can send you the code we have if needed.
    Thanks!

    Same problem here.  I have so many problems with this remote app.  Is there an iTunes API? I would like to write my own remote app that actually works.

  • There is a question about encode String

    hello
    i find a question when i decode java program at linux(redhat 7.3 Valhalla) and J2SDK 1.4.1_02.
    when i want to encode a String from GB2312 to UTF-16BE, the String used CJK and alpha bet mixed. the String length is error and can not convert success!
    from API documents, the string length when count the CJK character ,2 bytes count to 1,but there is 2! for example ,when i encode a CJK character to a UTF-16BE,when the string length is 1.then in the UTF-16BE should be 1,but there is not 1 but 2!!!:(
    by the way ,when my code run at windows2000,it's right!! no error!
    to everyone:what should i do ? is it a bug in j2sdk1.4.1_02?

    There are multiple 16-bit Unicode encodings, i.e.,
    UTF-16
    UnicodeBigUnmarked
    UnicodeLittleUnmarked
    UnicodeBig
    UnicodeLittle
    with/without BOM (byte order mark).
    Try these at a time, or confirm the unicode encoding used on an OS by the following.
    System.out.println(System.getProperty("sun.io.unicode.encoding"));

  • Question about partner determination for customer master

    Hi, experts,
    I have already read the documentation about this topic at forum. Still I have the following question:
    why should we assign the partner function to the account group? According to my understanding, the partner function has to be assigned to partner determination procedure and then through partner determination it is associated with the account group. If the partner can be assigned to account group directly, why do we still need determination procedure?
    Best regards,
    Fan

    Hi
    Let us consider an existing Partner Determination procedure in standard SAP.
    The  Partner Determination Procedure (e.g, ABCD) can contain multiple "Partner Functions". Suppose there are 100 numbers of Partner Functions in the Procedure.
    We assign  "Partner determination Procedure"  to the  "Account Group", so that , the assigned Procedure will be applicable for the Customer master data created under that Account group.
    Suppose, Partner determination Procedure "ABCD" has been assigned to Account Group "XYZ".
    Now, any Customer created under Account Group "XYZ", the Procedure "ABCD" will be applicable for them.  Right?
    We have already discussed , the Procedure "ABCD" contains 100 different "Partner Functions".
    Out of these 100 Partner Functions, only those Partner Functions, which are permitted  by the Account Group "XYZ" , they can only be entered in the Sales area data > Partner Function tab of the Customer master data.
    Suppose, only 6 Partner functions (out of 100 no) are assigned to Account Group "XYZ".
    So these 6 Partner Functions are permitted by the said Account Group "XYZ" and these 6 Partner Functions can only be entered in the Customer master data.
    So, to summerise it,  if you want to enter a Partner Function in the Customer master, then
    - First, that Partner Function must be available in the Procedure which applicable, and
    - Second, that Partner Function also  must have been permitted (assigned) by the Account Group .
    I hope, it is clarified.
    Regards
    Pradyumna

  • Technical question about encoding:  Experimentation may be needed, but..

    I work with a team producing a weekly video for distribution to two other sites. Up until now, we have been capturing (Canon XL2 into FCP on iMac via FW), doing a few quick edits and sending to a DVD via compressor. As an aside, we also have compressor put out a smallish web-version for upload to our website.
    We distribute the video DVD for use with a live audience, whose sole engagement with content from us is via video (We are a church). It's working, and has been working for about a year. Minus a few mishaps - mostly human error stuff...
    I would consider recommending a move to distributing video as files instead of physical DVDs. The potential advantages I see are:
    1. We can encode at a higher quality than DVD
    2. No time spent burning the DVD
    3. No physical transport of a physical device (made of cheap plastic) - We could upload/download via Dropbox or some similar model.
    4. The technician starting up the playback wouldn't have to fight with the DVD-player going to "sleep".
    My question for this forum is on the technical side of things. Can we use FCP/COmpressor to actually put out a higher quality video if it's a file to play on a Mac? If so, how? What kinds of encodes should we experiment with?
    Thanks all!

    Can we use FCP/COmpressor to actually put out a higher quality video if it's a file to play on a Mac?
    yes
    If so, how?
    Simply use Compressor to encode whatever comes out of FCP. There are lots of presets for h.264 based file generation from highly compressed to nearly visually lossless.
    What kinds of encodes should we experiment with?
    See previous answer.
    The key element is all the computers must be able to play h.264 quicktime files. Current Macs will have no issues. And, as long the PC people download and install a current version of Quicktime Player, it is a cross platform compatible format.
    x

  • Question about How to Use Custom CellEditors

    Hi:
    I have been trying to implement something like this: I have a JPanel, and when you double-click a particular spot on it, I want a textbox to appear. Currently, I am implementing it by using an undecorated JDialog that contains a JTextField in it (such that the text field occupies all the space in the dialog, i.e. you can't even tell that there is a dialog). This seems like a hack to me.
    Another alternative that I have been thinking about is using layered panes, and hiding the textfield below the jpanel, and only bringing it to the front when the user double-clicks.
    Then, I stumbled onto custom celleditors. Now, it seems that everyone is using them in JTables, JLists, JComboBoxes, etc. and I was wondering if it is something that I can use with a JPanel.
    Can anyone comment on the implementations I am considering, as well as using custom celleditors with a JPanel?
    Thanks in advance,
    LordKelvan

    Still don't understand your requirement. Does the text field stay there or disappear after the data is entered? If it disappears, then how do you change the value, do you have to click on the exact same pixel again?
    Maybe you could use a MouseListener and then display a JOptionPane or JDialog to prompt for the information. Or if you want to display a JTextField then add a JTextField to the panel and then when the user enters the data by using the enter key or by clicking elsewhere on the GUI you remove the text field from the panel.

  • Can someone tell me about encode,decode for http url parameters

    All,I got a problem that i want to redirect a url takes some parameters by GET type.if one parameter with url is a passwd field ,i thought it must be encode.And decode by recive-page.what class default in java can i use to encode the field and decode it.Or any solution better.please tell me.thank~

    NEVER send a password using a GET - always use a POST. Otherwise, the password will be transmitted in plain text in the GET header.
    URLEncode / decode is used to convert non-allowed ASCII characters (i.e. characters not allowed by the specification in parameter names or values) into a hex representation so they can be properly parsed. The receiving end uses URLDecode so the receiver obtains the exact parameters that were sent.
    For example, if you wanted to pass a parameter called 'name' a value of 'big joe', you could try doing:
    GET Servlets/myServlet?name=big joe
    but this would not be valid, because spaces are not allowed in URL parameter lists (although Microsoft IE and IIS incorrectly allow this).
    Instead, you should send:
    GET Servlets/myServlet?name=big%20joe
    The ascii value of a space is 32, which is hex 20 (0x20), thus the %20.
    Hope that helps!
    - K

  • Question about how HP handles customer service issues

    I am the owner of three HP laptops.  Two of which are dead now due to the defective Nvidia chips they contained.  When I called HP to report this issue, I was told by numerous HP customer service reps that they were not aware of any issues with the Nvidia GPU or that there had not been a high number of recorded problems concerning this.  It has been proven in numerous documents made public recently that this defect was known about and there had been a high frequency of this issue.   I would like to know why I was told these falsehoods and treated the way I was?
    I subsequently decided to dismantle one of the computer to investigate the GPU.  Sure enough the epoxy that reinforces the BGA solder-joint was cracked in the chip was no longer making good electrical contact with the PCB.  What I found really perplexing was the 1/4" gap between the GPU and the copper heat-sink that was intended to provide cooling.  I would assume HP was responsible for the cooling and chassis design?  I would also assume it as HP who filled this GAP will thermal foam.  Please correct me if I am wrong.  

    The recall was for certain models, did you confirm that your model was one of them?
    ________________________________________________________________________________________________________ I Love Kudos! If you feel my post has helped you please click the White Kudos! Star just below my name
    If you feel my answer has fixed your problem please click 'Mark As Solution' and make it easier for others to find help quickly

  • New user, question about encoding...probably been covered a few times

    I am new to MAC's and video. Let me get this straight and make sure I am doing this right. I made a 1hr 18 minutes video in IMOVIES. I exported it (Share Movies - Medium Size for DVD viewing). It takes like 2 1/2 hours to encode. Is this right? Then, I opened up Magic DVD in IDVD and pulled the Video that I made on IMOVIES and added one of their snazzy intros. From this point, I am a little confused. Do i go to Project - project info - and change to high quality? or keep at Best Performance? Even though my video is 79 min (4.36 GB) it says I have reached my maximum amount and need to change encoding or something to burn? where do I go for that?
    Lastly, right now I am on project info, set to best performance and it is encoding. How long does a 79 min video take to encode? Is it going to let me burn it after it finishes? Sorry new here but a quick learner.

    I am not sure with imovie since I use only Final Cut Pro. iDVD setting will let you expand the file for length. Naturaly the best quality pr performance will take less time of a file. In the case with iDVD 4 the best quality will only take 60 minutes of video already compressed. Best performance will take up to about 1 hour nd 49 minutes. You have to leave enough room for the menu to take up some space on the disc as well. In FCP we have to export as a quicktime file where with a 1 hour 30 min video can take about 20 minutes to export. the burning and compression time depends on the system you have. G5 faster, G4 like mine takes longer. on that same video idvd 4 will take about 3 hours to convert and burn the disc. When I use DVD Pro Studio that is way different and take a lot longer. I have had a typical 2 hour video take up to 14 hours to convert/export to a MPEG 2 format or DVD format. But the burning process take about an hour. It all depends on your equipment.
    Hope that helps.

  • Question about Convergence per-domain customized login pages

    hi,
    Recently I installed JES 7 with Convergence 1u3 and have two domains:
    The default is defaultdomain.com
    test.com is my second hosted domain
    I would like to have different login page one per domain. So far I did this:
    iwcadmin -w test123 -o client.{test.com}.loginpage -v "/iwc_static/layout/login-test.html"
    And copy login.html to login-test.html and modify it.
    Also did an appserver restart.
    If I try this URL:
    http://mail.test.com/iwc_static/layout/login-test.html
    I can view the html page and enter to the convergence without problem.
    But my question is the following:
    If I try this URL:
    http://mail.test.com/iwc
    I get a redirect to:
    http://mail.defaultdomain.com/iwc_static/layout/login.html?lang=en&10.01_182620&svcs=abs,im,mail,calendar,c11n
    that behavior is correct? or am I missing something in my appserver/Convergence configuration?
    Thanks in advanced

    ofonseca wrote:
    Thank you Shane but still doesn't work.I tried your exact steps and still couldn't reproduce the problem you reported:
    ./iwcadmin -w password -o client.{test.com}.loginpage -v /iwc_static/layout/login-test.html
    cd /opt/sun/appserver/domains/domain1/docroot/
    cp iwc_static/layout/login.html iwc_static/layout/login-test.htmlRestart App-Server.
    Edited "hosts" file on client browser system to point mail.test.com at Convergence server IP address.
    Accessed: "http://mail.test.com/iwc"
    Redirected to: "http://mail.test.com/iwc_static/layout/login-test.html?lang=en-us&10.01_183235&svcs=abs,im,mail,calendar,c11n"
    When I enable AUTH debug logging (log.AUTH.loglevel = DEBUG), I also see a redirect message in the logs:
    iwc.log:AUTH: DEBUG from com.sun.comms.client.web.auth.IwcAuthController  Thread httpSSLWorkerThread-443-0 at 2009-10-20 23:28:24,468 - Redirecting to: http://mail.test.com/iwc_static/layout/login-test.html?lang=en-us&10.01_183235&svcs=abs,im,mail,calendar,c11n If you still have no luck after reviewing this, I suggest you log a Sun support request.
    Regards,
    Shane.

  • Quick question about Quicktime media keys.......

    I had a question about encoding video and media keys. It seems to me that the only codec that allows you to encode it with a media key is Sorenson (Sorenson 3 I think). Why are they the only ones that are enabling that in their codecs? Is it kind of a dying technology or practice? I've experimented with Sorenson 3 and Sorenson Squeeze trials and, even though it looks ok, it simply doesn't stack up to others like Apple's H.264 or open-source x264 or even Xvid. I guess I wish there were a way to be able to use media key options with all the new H.264 codecs. Is it possible to do that, either with Xcode or AppleScript? Any help would be greatly appreciated!!

    QuickTime has supported 'media keys" since version 3 but you can only add them using the third party software.
    You would be better served by contacting Sorenson and asking them about their support for newer codecs.

  • Dear Customer Service Team,  I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I

    Dear Customer Service Team,
    I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I can not find it and now I only have access to the trial version.
    Thank you for your help in advance.
    Kind Regards,
    G. Zsolt

    There is no serial number require for Creative Cloud products, you may activate the products using your email address and password which is associated with Adobe. If your Dreamweaver asking for serial number, then make sure you are signing in with correct email address.
    You may also refer below link
    Sign in, activation, or connection errors | CS5.5 and later

  • Question about the custom panel language

    I have a question about the custom panel language...
    The document you provide seems to lack details on some features. Namely the icon and picture widgets. I see from looking at the examples and other vendor's web pages that these features exist, but I don't find any detailed descriptions of them in the documentation. Is there a more complete document describing these and other features...
    http://www.adobe.com/products/xmp/custompanel.html
    Alternatively, can someone fill me in on the syntax and options for at least the icon and picture widget. For instance, how do you load external icons or pictures...
    Tom

    Gunar,
    It could be interesting to have something like
    icon(url: 'http://www.adobe.com/Images/logo.gif', width: 20, height: 20);
    or better
    picture(url: 'http://www.adobe.com/Images/logo.gif', width: 20, height: 20);
    for the pictures and
    include(url: 'http://www.adobe.com/xml/custompanel/camera1.txt');
    for include the cusmtom panel's dynamic portions
    Juan Pablo

  • Question about custom color swatches in Photoshop CS4 Mac

    Hello.
    I have about fifty or so custom color swatches and wanted to back them up.  Where are they located in Photoshop CS4 for Mac?
    Thank you.

    They would be stored where you saved them to.
    If you have never had the foresight to save them (Edit > Preset Manager) they would only be in the Preferences (»Swatches.psp«), I guess.

  • Using PXI-5431and PXI-1411 to test MPEG-2 encoder/decoder

    I am looking into a way to test an MPEG-2 encoder/decoder.  I have found the PXI-5431, that can generate a NTSC signal which is what I need and the PXI-1411.  So, I guess my question is: would this be a good set up to use the 5431 to generate a signal and the 1411 to acquire the signal and do some comparisons to the two.  Has anyone done this type of testing?  What type of comparisons could be done to the two video signals to verify signal quality(I know very little about video signals)? Or maybe acquire using the PXI-5122?
    Thanks,
    Brian

    Hi BrianPack,
    I have some questions.  Please be much more detailed and specific in your next response.  Try not to use pronouns.  Instead, every time you want to use the word "it" or "card", instead use the proper names, such as the "PXI-5122".
    What card are you referring to in your first sentence?
    When you say (it) "can be configured to decode and encoded MPEG video", do you mean to say you are attempting to encode analog video?
    With all the MPEG encoding and decoding, which cards are you referring to?  Your two cards, or two NI modules?
    When you generate into the encoder, are you wanting to generate from the NI 5431?  If this is true, what video standard are you wanting to use?
    The Frequency Response, Video Resolution, SNR, and composite signal amplitude measurements should be available with the NI 5122 and MicroLEX VideoMaster.  I'm not sure about the NI 1411 because I only support NI's Modular Instruments, but here are the specification sheets for VideoMaster:
    http://www.microlex.dk/products/video/videomaster-component.pdf 
    If you want more information on the NI 1411, it would be best to post a message on the IMAQ/Vision forum.  For now, please respond with more specific information and I'll be happy to assist you!
    Chad Erickson
    Applications Engineer

Maybe you are looking for

  • Issue of Material on free /Fixed rate recovery basis to contractor

    Hi friends, I have one scenerios as follows: Purchasing dept. issues one contract to service provider with some conditions like some of the material willbe issued on free basis, some of the material willbe issued on fixed rate recovery basis. Is ther

  • How to find URL of ITS

    Hello experts, I have to assign URL of ITS to the logical system using t-code crms_ic_cross_sys. This logical system will then be used in configuring transaction launcher to call a ABAP report program. Currently I am giving the URL as http://isvsapcr

  • Can't print on USB port in Multiple Users mode

    I'm running OS 9.2.2, and recently added a USB card along with a powered USB hub and a Brother MFC420CN Print/Fax/Scan. All works great for me, but when my kids log in under their multiple users names, they cannot print on the USB printer. They still

  • Interactive Report Produces Corrupt PDF File

    Hello. I am using Apex 3.1.2 and have created an Interactive Report (IR). I then chose the "Download as PDF" option and chose the "Open" option. This caused an error about a corrupt PDF file. I then saved the file to my Windows drive and attempted to

  • Synchronous Scenario SOAP to Proxy and Proxy to SOAP

    Hi Sdn, I am new to Synchronous Scenario. Third party will send SOAP message requesting some information from SAP. SOAP - > PI -> Proxy SAP they are expecting a response Proxy - > PI -> SOAP. Could you please let me know how to design teh Synchronous