Best way to reuse a layout with different values?

I want to reuse the code of the <div id="placeInfo"> on the next page (place.xhtml). I simplified it's code for this question.
Of course I can use <ui:include> for <div id="placeInfo"> but on the next page I would need e.g. #{myBean.selectedPlace.name} instead of #{place.name}.
Any smart idea how to do this efficiently?
<ui:repeat value="#{myBean.places}" var="place">
    <p:commandLink action="place?faces-redirect=true" ajax="false">
        <f:setPropertyActionListener value="#{place}" target="#{myBean.selectedPlace}" />
        <div id="placeInfo">
            #{place.name}
            #{place.openHours}
        </div>
    </p:commandLink>
</ui:repeat>

Research composite components. Its a little cumbersome to do these things in jsf to be honest. I just copypaste the xhtml content most of the times. Its not like it will save you time to turn this into a reusable component.

Similar Messages

  • Best way to update a table with disinct values

    Hi, i would really appreciate some advise:
    I need to reguarly perform a task where i update 1 table with all the new data that has been entered from another table. I cant perform a complete insert as this will create duplicate data every time it runs so the only way i can think of is using cursors as per the script below:
    CREATE OR REPLACE PROCEDURE update_new_mem IS
    tmpVar NUMBER;
    CURSOR c_mem IS
    SELECT member_name,member_id
    FROM gym.members;
    crec c_mem%ROWTYPE;
    BEGIN
    OPEN c_mem;
    LOOP
    FETCH c_mem INTO crec;
    EXIT WHEN c_mem%NOTFOUND;
    BEGIN
    UPDATE gym.lifts
    SET name = crec.member_name
    WHERE member_id = crec.member_id;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN NULL;
    END;
    IF SQL%NOTFOUND THEN
    BEGIN
    INSERT INTO gym.lifts
    (name,member_id)
    VALUES (crec.member_name,crec.member_id);
    END;
    END IF;
    END LOOP;
    CLOSE c_mem;
    END update_new_mem;
    This method works but is there an easier (faster) way to update another table with new data only?
    Many thanks

    >
    This method works but is there an easier (faster) way to update another table with new data only?
    >
    Almost anything would be better than that slow-by-slow loop processing.
    You don't need a procedure you should just use MERGE for that. See the examples in the MERGE section of the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*.01)
         WHERE (S.salary <= 8000);

  • What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    You can't share with other devices if you are using different Apple ID's and iTunes account on them. You can only share if you use the same ID.

  • Best way to include javascript-script into different struts-pages

    Hi,
    I'm running a struts-based webapplication using the tiles-templates for my layout. Now I have to use some javascript-code for a pop-up window and another javascript for tracing on multiple pages but in different combinations. As I do n't want to copy-paste it on every page, but put it on a single place for better maintenance I'm wondering what would be the best way to do this together with the struts-logic.
    I thought about the following options:
    1.) Using the "template:put" feature like this:
    <template:put name='js' content="/myJavascripts.jsp"> I don't think this would be a good option, as I always have to include the whole javascript and I cannot distinguish between my two different javascripts
    2.) Using the template:insert feature like this:
    <template:insert template="/myJavascripts.jsp"/>. This is a lot better, as I can split my two javascripts into two different files and can always decide, which one to include with the template:insert tag. But I'm not sure, if this is conforming with the struts-concept, as I do not use any template:put or template:set tags
    3.) Using simple jsp:include or <%@ include ... %> tags.
    This would be the easiest way to include my pages with <%@ include file='/myJavascripts.jsp' %>. Same advantages like template:insert but I don't need the additionally features of the template:insert-tag. But still the same question: is this the concept of struts? Or will I become any difficulties with this concept later??
    Any recommendations or further ideas are greatly appriciated.
    Thanx for your help
    Thomas

    Getting PDFs to download is fairly easy and the method is described here.....
    http://www.iwebformusicians.com/WebMusic/PDFs.html
    To get multi page docs to display in the browser requires the use of Google Docs viewer, ISSUU or some such thing....
    http://www.iwebformusicians.com/PromoPage/ISSUU.html
    Safari is the only browser I know of that will display PDFs in an iFrame without a plugin.

  • Best way to build a website with hundreds of pages

    What is the best way to build a website with hundreds of pages that include businesses in every city of the U.S. I will be building it in Dreamweaver CS4 and pulling the data from an MS Excel spreadsheet.
    I started building it by building the first page and then saving a new page with new data and so on.
    There must be a way to pull from the Excel doc without copying and pasting each page of data, and there must be a way to build this site smaller and easier to make changes when needed.
    Thanks

    You already have other people addressing the DB issues - so I will bring up the other... You are just saving a copy as a new page and then copy and pasting the changed content into  it?
    What you want to do is take the first page, once you have your design done - and save it as a template (file - save as - Dreamweaver Template).
    Then you want to select the areas (most likely the divs you have content in) that will have content changed, and select the div or p or whatever element... and go to Insert - Template Objects - Editible Region.
    Make sure you don't made editable the areas that are the primary design - such as a logo element, a header image, the navigation etc.  If you want to change those - you would do so by making the change on the template, and then it will automatically update all pages made based on that template.
    Once you are done setting up the templates - go to your new page and choose Modify - Templates - Apply Template To Page
    Select the template you just created (note it will be placed inside of a new folder titled "templates" automatically by Dreamweaver).
    Now, any of the areas you selected to add different content into will be selectable, and you can copy/paste or however you are doing so.
    Good luck

  • Best way to share a video with someone in another city...

    What is the best way to share a video with someone in another city?
    I know that FCPX contains all sorts of share options which create different resolutions and file sizes appropriate for different sites like YouTube, Facebook, and others.  But how to create the videos really isn't the problem.
    I want to know how to share them.  I'm creating videos that are ultimately to be viewed on the internet.  When I have a completed video, I want to show it to the person who it is for before I finalize it.  I know that if it very small, I could email it.  And if it's larger, I could use something like Dropbox.  But I don't necessarily want them to have a copy of it (though I could do that and put a watermark on it).
    I'd like to upload it to a site like YouTube or Vimeo, but those sites seem to be about sharing videos with a wide audience.  I know you can make a video private on YouTube, but, from what I've read, they permanently have the right to use the content, which I definitely don't want.
    So what's the best way to do this?  I'm going to have to do it regularly, so I'm willing to pay for a service if it assures privacy and does not try to assert some right to my content.
    I know there is an issue to be considered with people screen capturing content, but I'll use a watermark to lessen the chances of that.

    Hi Russ--
    I'll have to read through Vimeo's terms of service, but I have to think they're asserting some right to the content like YouTube does.
    Plus, these are commercial videos, and I don't think they allow that.  Of course, if they're private, I'm obviously not trying to sell anything.  But I have to think that it somehow is against their TOS since me posting a bunch of private videos that nobody can see really doesn't do them any good at all.

  • What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera?

    What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera? It says the utility disk is a PowerPC app and that is no longer supported. What do I do now? I can't upload photos from my camera.

    Also, I had the same problem happen when I tried to install an older version of Corel Painter. Are Macbook Pro users just NOT supposed to be able to use their laptops for the purposes they are best designed for?
    -Frustrated new Mac user

  • What is the best way to create the layout for a single page website in Adobe Muse?

    I was wondering the best way to create the layout for a single page website in Adobe Muse. Does anyone have any suggestions?

    I know how to create a website but will that help me create a single page website? Below I will leave a demo of what I want. I want it to only have one page but multiple sections. What is the easiest way to create a single page website like the demo below?
    Demo Website

  • Best way to fill a datagird with A LOT of data?

    What's the best way to fill a datagrid with A LOT of data.
    I'm talking about something like 10,000 rows. Can the datagrid
    handle it? No screen is large enough to show 10,000 records..... is
    there a way to load 50, and then when a user scrolls down it loads
    the next 50 etc...?

    Right. It's not recommended that you load 10,000 rows into
    the datagrid at once. Using the data management service with paging
    enabled is a much better solution. See the Configuring the Data
    Management Service chapter in the Flex2 Developer's Guide for more
    info.

  • PDF for multiple users with different values

    Is there a way to create a PDF to be sent to multiple users but have different values in the PDF? For expample employee A's offer letter is for $50/hour while employee B's offer letter is for $55/hour. But they have the same offer letter just with different values.
    I have Enterprise EchoSign and FormsCentral.
    Thank you!

    Hi,
    Thanks for asking, but FormsCentral currently does not support this.
    Perry

  • Mass changes of Material Master field with different values

    Hi,
    How to change a field in Material Master for more than thousand materials. I think MM17 can only be used for mass changes of materials with same values. I need to upload different values for different materials. Is there any other way to do this.
    Thanks,
    K R Vishnu Kumar

    Hi Kumar.
    I think you have to use LSMW for mass updation for Material Master fields with different values.
    Regards,
    Rahul.

  • Updating multiple rows with different values

    Hi!
    I have a problem. I need to update more then 1000 rows with different values. How can I do it?
    For exsample i have table:
    id; color, date,
    1 red
    2 green
    3 white
    I need to update date field.
    Update table
    set date='01.02.03'
    where id=1
    Update table
    set date='01.03.03'
    where id=2
    Maybe there is way how to update multiple rows at one query?
    Sorry for my bad english.
    Thanks!

    Hi,
    You can try this
    UPDATE TABLE SET DATE = CASE
                        WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR')
                        WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR')
                        ENDcheers
    VT

  • Column with dropdown with different values in each cell

    Hello,
    I have a Table and one of the columns contains a dropdown list (dropdownbykey). My problem is that the list of values for each drop down element is different because it depends on the value in the rest of the row cells. Obviously I need to calculate the values dynamically at runtime.
    I have created a context node and linked it to the table columns, one of the attributes in the node is linked to the 'selectedKey' property of the dropdown. Then in my code I try to give the list of values to this attribute using the method set_attribute_value_set from the if_wd_context_node_info interface. The process it's explained in the DEMO_UIEL_STD_SELECTION component.
    But I only get the same values for each row.
    I would like to know if it's possible to have dropdowns with different values in the same column of a Table, and if so any indication of how to do that.
    Best regards,

    Hello Javier,
    unfortunately you cannot use dropdown by key if you want to have different dropdowns per line of your table.
    Instead you will need to use dropdown by index, and bind your dropdown to a subnode of the table element (ensure that this is a non-singleton node).
    To make life easier for yourself, I would also have an attribute in your main structure that holds the selected value of the dropdown by index - update this value on any "onSelect" action of the dropdown by index.
    e.g. for a table that holds addresses:
    Context Node Address:
    attribute street
    attribute city
    attribute country
    attribute region
    subnode regionlist
    ...attribute regionkey
    ...attribute region_text
    table - bound to node address
    input field bound to street
    input field bound to city
    dropdown by key bound to country (onSelect event populates subnode regionlist)
    dropdown by index bound to subnode regionlist, text bound to region text, (onSelect event populates address element attribute region with key field of selected element).
    I hope this helps,
    Chris

  • Calling a sequence in a new thread with different values

    I have a sequence that I want to call that runs in parallel (seperate thread). The question I have is that I want to run this sequence from a lot of different places, but with different values of the variables going into the steps inside the sequence.
    If I change the values inside the sequence (running on seperate thread), then I will have to duplicate this sequence over and over. What I really want to be able to do is run a step in a seperate thread, and not wait for it to complete. Is this possible? Or a method of passing step values into a seperate thread. I don't want to use globals unless I really have to.

    Hi ADL,
    I have attached an example which I hope will illustrate an answer to your question.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Sequence_File.seq ‏34 KB

  • Call a service twice with different values

    Hi,
    I have two DropDownBoxes I want to fill with the service Helpvalues.GetList with different values. So I call the service in the init method. But then the second call overwrites the first call.
    I thought about adding my own value attributes in my view but I get an error when I assign a ComplexType to the attributes.
    Thank you
    Julia

    Hi Julia,
    I think your DropDownboxes referring to same context.That is why your second call over writes the first one.
    use 2 local context nodes ,fill them seperately from your service calls.

Maybe you are looking for

  • Materialized view is empty after 5 minutes

    After successful usage in our dev environment, I went to migrate a snapshot to QA only to find that after about 5 minutes, it was empty. Here are all the facts/symptoms I could think of, I was wondering if anyone could shed some light - I'm stumped.

  • Exchange SP1 to SP3 RU5

    Hi, I'm in the process of planning my update from Exchange 2010 SP1 to Exchange 2010 SP3 RU5.  The roles are all hosted on a single Windows Server 2008R2 SP1 host.  The domain and forest are using the Server 2003 functional levels.  My questions are

  • How to transfer or copy my complete address book from my BB to another smartphone

    Hello Everybody, Could someone tell me how to transfer or copy my complete address book from my BB Torch 9800 to another smartphone and vice-versa? Many thanks in advance for your replies. Best regards, Eric ---------------------------------------- [

  • Using Macbook 2015 with old iMac in target display mode?

    Opinions about the new 12 inch Macbook 2015 aside, I am wondering if I can use my 27 inch iMac mid-2011 in Target Display Mode. I also had trouble finding "daisy chain" solutions to this. Ex. An accessory that will allow me to charge the Macbook whil

  • Spring MVC Portlet Question in JDeveloper 11.1.1.4

    Hello All, I am trying to develop a spring mvc portlet and test it in Jdeveloper 11.1.1.4 (integrated weblogic server). Below is my portlet.xml ... I don't think portlet-class is getting loaded. Even if i put xxxxx in the classname i don't see any er