Dynamic controls

I'm just looking into JSF, and so don't have the pattern down yet. So either this is trivial or can't be done:
I'm looking to move some JSPs to JSF. The JSPs creating varying number of controls (input fields, drop-down lists) based on the contents of a bean. I use JSTL to loop through the bean and create the controls (and their generated names). The associated servlet knows the patterns of the names and so can find the appropriate parameters. Works, but not pretty.
I can't see how to do this readily in JSF. I can certainly do it (well, almost) in Java by creating the component tree there. But there are a couple problems: Not all the tags I need have UI Components and - more importantly - I'd like to have this stuff in JSP files. I have folks who know HTML and taglibs and shouldn't have to be in Java to modify those things.
Doing it from the taglib side should be easy except I can't use expressions where I need to. What would work for me - but I guess isn't legal - would be the ability to do things like:
<h:inputText value="#{reportBean.outputFormat[${loopcounter}]}"/>
Am I missing something obvious? Or simply trying to fit a square peg into a round hole?
Thanks.

If you know the bean value(s) and want to base button display on that value(s), could you use something like
<logic:equal parameter="${bean.var}" value="something">
<h:commandButton id="ret" action="#{bean.fmJSP}" value="Return"/>
</logic:equal>
If bean.var did not == something then the command button would not show.

Similar Messages

  • MVC - adding dynamic controls to each row in list

    I'm using VS.Net 2013/C#/Razor
    I have a dynamically created table with employee data (name/emp number/start date/title). We're trying to keep track of the percent of an employee's job doing certain duties.
    What I need (for each employee) is to add a dropdown list with a list of duties, and then add a a textbox for percentage of time (don't worry about percentage), but I need 4 of each per employee, named with some relevance to each employee
    Like:
    Emp Name-Emp Number - DropDownList - TextBox
                                           DropDownList - TextBox
                                           DropDownList - TextBox
                                           DropDownList - TextBox
    Each Dropdownlist will have the same items in it, and the end user will select from the DDL, and enter the number in the textbox.
    I've tried this:
    for (int lines = 1; lines < 5; lines++)
    <tr>
    <td colspan="5">&nbsp;</td>
    <td class="altText">radio buttons</td>
    <td class="altText">ddlActivity + @item.empNumber + @lines.ToString()</td>
    <td class="altText">DropDown</td>
    <td class="altText">FTE Textbox</td>
    <td class="altText">Total FTETTextbox</td>
    </tr>
    But the output is more like the formula and not what I need: ddlActivity + (empNumber is correct) + 1 with the plus shines showing.
    How can I create name these dynamic controls so that they're tied to that particular employee?

    Hello Elmo,
    Welcome to MSDN forum.
    Your issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because your issue is about ASP.NET MVC programming, I suggest that you can consult your issue on ASP.NET forum:
    http://forums.asp.net/
     for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Scripting configuration for Dynamic Controls

    I would like to put the configuration of Dynamic Controls (Process/Service Controls' selector values, URI, etc.) in a script to invoke from a command line. Any suggestions?

    Are you want to run this script at development time before deploying or what do you want to achieve? Upcoming SP4 will offer a solution to retrieve config parameters for certain controls dynamically at runtime (and change it on the fly).
    -Kai

  • Control Array or Dynamic Controls in adf

    Hi All,
    Is that possible to create control arrays or we can create dynamic controls in adf like .net. Please advice or share some sample code.
    Thanks,

    Thanks for your reply. Actually i want to create some buttons in runtime. means if i have 10 records in table i need 10 buttons on my page but they should share the same code by passing the index of control.
    Thanks

  • Dynamic control questions?!!

    Dear all, I got one problem when I used the PID control toolkit to obtain the dynamic control response. When, I input the sinusoidal signal to the system under PID control, the frequency for the output signal is 5 times larger than the input. For example, when I input frequency 0.1 Hz, the frequency of the  output signal is 0.5 Hz. I do not know why, and the frequency shouldn't be changed. Amplitude and phase may change. the attachment photo is the block diagram and the program files can be running when they are put in the same directory.
    Thx!!
    Message Edited by SarahM on 05-21-2007 07:50 AM
    Attachments:
    aaa.JPG ‏121 KB

    abc-123,
        I just wanted to let you know that we removed the code in your previous post (PID dynamic.zip).  This contained your VIs but it also contained some of the VIs from our licensed and purchasable PID toolkit.  In our Terms of Use under Intellectual Property and Your Condict it references posting protected software.  These VIs from our toolkit cannot be posted on the forums, but feel free to repost your own code.  Thank you!
    -Allison S.
    Calibration Services
    Product Support Engineer

  • Dynamic Control

    Hi !! I'm doing a development of 3D crane(Axis XYZ), using PI Controler to control the system's errors. I made a VI to control the motors for move a piece from initial position to another position.
    But I can't setup the VI to move more pieces to other position in sequences, I want to apply a dynamic control on the block diagram to use a sequences of set points in the front panel.
    How do I use the dynamic control or other type of it? Where I can found other tutorials?
    Pls send me some informations in case.
    Tks in advanced
    Eduardo
    Message Edited by Ecastagnaro on 09-29-2006 10:54 AM

    Hello Eduard,
    I think i see your problem and understand your program.
    First you have to document better! Terminals named numeric 1-5 don't make much sense.
    You already got the positions to go to (in Set Point inticial
    This VI is OK, but could be better:
    In that way it is easier to add new position
    Now if you want to move between several positions you're code should be like this:
    Where I replaced the while loop with a for loop.
    Moved the position control out of the loop and replaced it with an array with all the points to pass.
    However if this is homework you should put some effort in optimizing (and cleaning) your code.
    There are several optimizations possible in your code...
    Read this:
    The link to the LabVIEW Learning Center is here
    Ton
    Message Edited by TonP on 09-30-2006 01:55 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Set Point (SubVI).png ‏20 KB
    Controlador PI Rev4.png ‏39 KB

  • Can I dynamically control the position of objects on a printed page?

    Forum:
    Oracle Developer Reports Builder (10g)
    I have a need to control the position of printing on a peel off label in my report. I currently am forced to represent a complex object three times , i.e. LEFT, RIGHT and CENTER, printing whichever is configured in the PRINTER_INFO table of my schema. I am printing to over 200 printers and they all print the location differently.
    Also, since printing through the DESTYPE=PRINTER ,vs printing from a displayed PDF have different results, I would have to refresent these three objects yet again, sligh lower and to the right to support label printing from a PDF.
    I have seen where Word Macro can dynamically position this same object by using xy coordinates.
    Does anyone know how to do something like this in Oracle Reports.
    Thx in advance,
    Gary
    [email protected]

    Dora,
    Yes, that is exactly what I am doing. As I mentioned, the label object has many elements and they all sit on top of each other when doing the layout. This by itself is messy to work with.
    This has been workable so far with regard to generating output to the several hundred printers of different models and firmware.
    The output is rarely if ever centered in both x & y axis. We have only been able to use in production by relaxing the rules so that the text only need be within the boundaries of the label.
    I also found that to support printing from the PDF view that the text positioning is well out of the label boundaries. I would be forced to create an additional three complex objects in the 'Y' axis. Needless to say this is quite messy.
    I do appreciate your input, but your recommendation does not meet the requirements of my project.
    I don't believe that Oracle Reports can do this task. I am thinking that BI Publisher can, and am doing "due diligence" before recommending a new reporting platform.
    Thx again.
    Gary

  • Adding Controls dynamically in the Infopath/Web form with dynamic controls

    Hello,
    The client requirement is to create SharePoint solution for the below image. A web form/Info-path form will be created where user can enter the details and data will be submitted. I am looking for a solution to implement the requirements in SharePoint .
    if not possible then using customizations and SQL server.
    User can enter the Title , Overview in the form , which we can make Single line and multiple line of Text. The problem is with third , fourth and fifth fields.
    1) In third field , i.e. Qualification Summary , User can add/delete , dynamic text boxes..This can be achieved I think using repeating tables/sections in Infopath...How data will be saved in SharePoint columns as it is not fixed that how many
    columns user can enter , how columns(static) will be created in the list ??
    2) For fourth field , user will select one or many Project description title n descriptions which are there in the system..User will not write anything just select..But how many project descriptions they can select , again its not fixed..How
    we can manage it in SharePoint List OR any custom solution  ?  
    3) For fifth field , user will select one or many Awards which are there in the system.User will not write anything just select..But how many awards they can select , again its not fixed..How we can manage it in SharePoint List OR any custom
    solution  ?  
    Vipul Jain

    >Lets say , the data for user selection is stored in two separate lists
    secondary data connection is only for one list so you can get data from only single list by creating list connection. Later you can drag & drop that connection as repeating table or bind with any control so display in form. If you have mulitiple list
    then you may use lookup column or would need to create two seperate data connection.
    >Do you think its a right approach ?
    multi selection listbox is helpful if requirement is select multiple records or filter records. You can almost achieve most of the requirement but still depends on business need. Ofcource some limitation is also there.
    >I'm planning to propose a custom .net form
    Of course custom form is always better than OOTB in some cases but i always prefer OOTB solution if my requirement is being achieved by it.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Create multiple dynamic control for each splistitem

    Hi ,
    I using SharePoint 2010 , in that am creating a custom visual webpart, to show in my home page.
    In that i need to show my custom list's listitems such as 'ID'  and 'Title'  as dynamically label controls in my page. 
    When ever a new item added in that list , it will dynamically created labels and displyed in my webpart as last item.
    can any one help me ?
    regards,
    RK

    Hello,
    You can't directly get newly created item in webpart but you can use CAML query to get item from list and show in webpart. Use OrderBy in query to get item in ascending or descending order. Here is ref code:
    using(SPSite Site = new SPSite(SPContext.Current.Site.Url))
    Using(SPWeb Web = Site.OpenWeb())
    SPList list = web.Lists["ListName"];
    SPQuery query=new SPQuery ();
    query.Query = "<OrderBy><FieldRef Name='ID' Ascending='FALSE'/></OrderBy>";
    query.RowLimit = 1;//get only single item if you want all items then remove this line
    SPListItemCollection items = list.GetItems(query);
    if(items.Count > 0)
    foreach(SPListItem item in items)
    string ID = Convert.Tostring(item["ID"]);
    string Title = Convert.Tostring(item["Title"]);
    Later bind this code with gridview.
    http://programmingshare-thienle.blogspot.sg/2012/02/using-spquery-to-return-sharepoint-list.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Create dynamic controls from JSON Response

    I have a requirement to create a group of checkbox with lebels in a page from JSON response.
    The JSON response is
        "data": [
                "CodeStatus": "Red"
                "CodeStatus": "Orange"
                "CodeStatus": "Green"
                "CodeStatus": "Yellow"
    the  design is:
    the box is vertically scrollable, as it can have more color codes.
    Can anyone suggest how to design the above?
    If one can provide the implemantation code, that would be very good as I have very time to implement it.

    Have a look at templates and for more complex scenarios factory functions, which give you the ability to dynamically create controls from model data.
    SAPUI5 SDK - Demo Kit
    Regards,
    Jason

  • Creating Dynamic Controls with Drag-n-Drop

    I'm creating an application that allows users to drag bubbles
    from a panel on the left and drop them on a central workspace. I've
    already coded the drag-n-drop operations for this process, and it
    all works just fine. The user can drag one bubble (which represents
    a category) and when dropped, a new similar control gets created at
    the mouse coordinates. However, what I can't figure out how to do
    is create that new control with dragEnter and dragDrop properties
    of it's own. Obviously, if I was creating this control ahead of
    time, then I would specify those events in the XML portion, but I'm
    creating the control dynamically, so I have to figure out some way
    to set that up. Something like...
    var newBubble:Canvas = new Canvas();
    newBubble.height = 50;
    newBubble.width = 100;
    newBubble.x = target.mouseX - xOffset;
    newBubble.y = target.mouseY - yOffset;
    newBubble.dragEnter = "doDragEnter()";
    newBubble.dragDrop = "doDragDrop()";
    However, when creating new controls, the dragEnter and
    dragDrop properties aren't available. Any suggestions as to how I
    can do this?

    Thank you sooo much! I'll try it out immediately. I knew it
    had to be something simple...

  • SSRS 2005 - Dynamically control the width of columns in Matrix report or Hide any column

    Hi All,
    I just want to hide some column without having white space in Matrix report in SSRS 2005. Although I am aware of that perhaps this feature is not available on SSRS 2005. So, I just want to know if we can handle the width of column dynamically(using expressions)
    in matrix report?
    Please help. Thanks in Advance.
    Regards
    Kumud

    Hi Kumud,
    Based on my test, SSRS is not support column dynamically width. It has property “CanGrow” of text box. If we configure the property to True, it will wraps to next line if needed. In SSRS 2008, we can hide some columns without white space. If possible, I
    recommend you update your SSRS 2005 to SSRS 2008.
    There is a similar issue, you can refer to it.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9e6043f1-c458-4540-be59-d37b02feab8a/dynamic-column-width-for-a-report?forum=sqlreportingservices
    Alternatively, I recommend you that submit a wish to the Microsoft Connect at
    https://connect.microsoft.com/SQLServer/Feedback. Your feedback is valuable for us to improve our products and increase the level of service provided.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to  build a dynamic control  in 'as' file

    example :
    I want to build a dynamic CheckBox in as file (in
    flex2.0),who can help me! thanks

    thanks,i'm a chinese.I'm not be good at English.
    Now the problem have be settled.
    非常感谢你!

  • Dynamically controling the size (in pixels) of array elements?

    Hey Everyone,
    I am writing a large vi where front panel space is becoming a limitation.   One of the elements that I want to display is a 2-D array of boolean indicators (rectangular LEDs).  Is there any way to dynamically resize the elements in the array so that regardless of the number of elements, the entire array is always visible and has a constant footprint.  For example, say the array is 8 x 8 elements, and takes up 160x160 pixels on the front panel so each element is roughly 20x20 pixels.  Then the number of elements shifts to 4x4.  I want the display to stay 160x160 pixels, but the size of each element to double to 40x40 pixels.  Is this possible?
    Thanks all,
    Matt
    Solved!
    Go to Solution.

    So thank you for two great ideas/examples.  Definitely think I have a couple of very workable approaches.  I have a follow on question about using the intensity graph approach.
    First some background.  This indicator is going to show the progress of a sorting operation, 1-4 copies of 1-8 unique items are being sorted into 1-32 containers.  The items arrive at the sorter in random order, are identified, and then placed into the container where they are still needed.  The point of this indicator is to show the user, at a glance, how full each container is andwhich componenets are missing.  I want the elements (columns) to appear different for the unique items, which I know you can't do in an array of booleans.  So I had already dumped the boolean approach for an array of colorboxes, and it was the color boxes that I was trying to dynamically size. There is still a boolean array to keep track of if an item has arrived, but that array drives the array of colorboxes where each type of item is color coded by assigning a gray value to colorbox for false, and a particular color if true.  See attached, which works pretty well (detailed adjusts will make it just right).
    I think the intensity graph will look much nicer though, so here is the question:
    How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines?  The attached get vi puts out a different value for each yes/no, which is to say I already know how to take the boolean and convert the 1 state to a unique number, what I don't know how to do is map that number into a particular color on the intensity graph.
    Thanks guys.
    Super helpful as always!
    Matt
    Attachments:
    Puzzle_MM.vi ‏42 KB

  • How to make an auto size form of dynamic controls

    Hi Experts,
    i am creating a number of TextField controls and adding in the form component at run time.
    i set the width and height 100% but i need to have auto size form depending on the fields.
    please guide how can i set form size auto?

    As long as the form is inside a container that supports auto layout, lie VBox, and the VBox and Form have width and height set to 100% you should be okay.
    What is some simplified yet complete sample code and what problem are you actually experiencing?
    If this post answers your question or helps, please mark it as such.

  • Dynamic control alignment

    My requirement is like this :
    As part of customization, I am planning to let the user realign the controls in a HTML page.
    Since I dont have sufficient time, I am not able to write code for this purpose. Is there any ready to use code available for this?

    My previous answer was serious.
    You said you didn't have a lot of time. And the vast majority of business cases re-arranging stuff is just eye candy. Most people wont use it (like macro languages in editors.)
    To make a project succeed at some point it can become necessary to cut functionality. That is a project level decision and it sounds like you need to make it.
    The page info will be transferred to an applet and the applet will convert the tags You could probably find something like this in a web editor, but it would have to be written in java. And unless it is already set up for embedding you would end up doing a lot of work.

Maybe you are looking for