Dynamically Setting the icon in a LinkButton

I am using several link button controls as navigation devices in my app.  When the LinkButtons are created they are all given four icon properties like so:
     upIcon="@Embed(source='images/Off_1.gif')"
     icon="@Embed(source='images/Off_1.gif')"
     overIcon="
@Embed(source='images/Over_1.gif')"
     downIcon="@Embed(source='images/Sel_1.gif')"
The second LinkButton would have the same properties as shown except it would have it's own set of GIF's.  Because these are navigation buttons in my app I want to be able to click on a LinkButton and have it's downIcon GIF become the icon GIF.  That way it looks like the button has stayed selected and gives the end user some visual indication of where they are in the app.
Problem is how do I set the state of the icon for a LinkButton and make it show???  I have tried this AS code but it hasn't worked...  It doesn't generate an error... it just has no visual effect.
    LinkButton_1_ID.setStyle('icon', 'images/Sel_1.gif');
So if you have any ideas on how to change the icon on a LinkButton please let me know.  Thanks in advance for your help!!!
Have an Ordinary Day...
KomputerMan  ~|:-)

You are probably better off just using a Button with custom skins.
But if you do want to swap out the icon, you'll need to embed the asset as a Class:
<mx:Script>
<![CDATA[
    [Embed(source="assets/images/pie.jpg")]
    [Bindable]
    public var Pie:Class;
    [Embed(source="assets/images/bar.jpg")]
    [Bindable]
    public var Bar:Class;
     private function init():void
        myLogo.source = Pie;
]]>
</mx:Script>
<mx:Image id="myLogo" click="myLogo.source = Bar"/>

Similar Messages

  • How to set the icon for the entire application with JFrame.setIconImage

    I set the icon on the main frame using JFrame.setIconImage(). The icon is shown properly in the main frame.
    If more JFrames are opened from the main frame, the newly opened JFrames also show the icon.
    However if JDialogs are opended, in some cases the icon set on the main frame is shown and in other cases the coffee cup.
    What is JFrame.setIconImage() expected to do? Setting the icon for a single JFrame or the entire application?
    How can I set the icon for the entire application?
    How can I set the icon for JDialogs?
    Thank you

    In order for your dialogs to use the same icon as the frame, you must parent the dialogs to the frame which has the custom icon.
    See the following thread for more information: http://forum.java.sun.com/thread.jsp?forum=57&thread=362542
    cheers,
    Greg

  • How to dynamically set the name of the generated PDF file sent by email

    Hello,
    I am using Reports 10g and I managed to send PDF reports by email, specifying the recipient, subject, format etc, using the reports servlet URL.
    But there is one thing that I cannot find a way to do: I want to dynamically set the name of the attached file. It defaults to the name of the RDF file (eg monthly_sales.pdf). I would like it to be something more meaningful (eg monthly_sales_072010.pdf, where 072010 is the month and year passed by parameters).
    Is it possible to do it?
    Thanks
    Luis

    Use System.load(...) instead of System.loadLibrary(...).

  • XSL-FO Report Query / Named Layout - Dynamically set the output filename

    Does anyone know if it is possible to dynamically set the name of the PDF file which is created via FOP?
    Thanks
    Paul

    John
    Thanks for the quick reply, apologies, I should have been more explicit.
    I am calling apache FOP via a report query and a named column layout using xsl-fo to format the PDF report.
    The call is done via a javascript function which determines which report to print and then submits the approproate REQUEST. The request is picked up by conditional branches and calls the PRINT_REPORT
    The PRINT_REPORT names the PDF file as same as the report query name.
    BTW the long term goal is to store the resultant output as a blob back in the database but I can put that off to phase II of the project as I'm not sure that this is possible. Would be nice though!
    Thanks
    Paul

  • How do you dynamically set the flat file name

    Within my process flow I call a mapping. Within this mapping I have a flat file operator (which creates and writes to a .csv file). All working great.
    From this process flow I want to be able to pass a parameter to the mapping (which I can do), and use the value of this parameter as the file name of the .csv file. But I can’t seem to be able to dynamically set the ‘Default physical file name’ to this parameter value within the mapping.
    Does anyone have any ideas?
    Thanks
    Ansel

    Hi Ansel
    Check out the blog entry here;
    http://blogs.oracle.com/warehousebuilder/newsItems/viewFullItem$154
    You can use an expression.
    Cheers
    David

  • Dynamically set the upper limit of a numerical control

    I want to dynamically setting the upper limit of a numerical control. The maximal value that is allowed to input is calculated by the code, so that if the value input by the user exceeds the upperlimit,  a warning comes out and the input value is automaticaly reset to zero.
    I wired the calculated upper-limit to the property node of the numerical control using ''Data Range > Maximum" property, but it does not work as I expected.
    Anyone has suggestion on this? Thanks a lot.

    Can you attach your code?
    Dejun wrote:
    ... but it does not work as I expected.
    I cannot read your mind. What do you expect? What to you see instead?
    Overall, you are in a catch22 scenario if I understand you right. If you set the max of the control to coerce to a certain value and you enter a larger value, it will be coerced to the upper limit and the code does not see the original out-of-range value and you cannot successfully test it with a comparison operation. Maybe you can set it to "ignore" instead of "coerce" or not even set an upper limit. Simply use "in range and coerce" and reset the value under the desired conditions (e.g. via  a local variable) before handing it to the rest of the code. You could even wrap this into an xcontrol.
    LabVIEW Champion . Do more with less code and in less time .

  • Dynamically set the size of the VIEW

    Hello,
    I am looking to set the size of my VIEW which is called in following way:
    IF iv_show_in_pop_up EQ abap_true.
        wd_this->raise_simulation_pop_up( ).
    I want to set of the size of the VIEW if it a pop-up.
    ENDIF.
    How can i get access to the view and set the size. Please Help.
    Regards,
    Piyush

    Hi Piyush,
    Check what Anzy has to say in [here|https://forums.sdn.sap.com/click.jspa?searchID=18635339&messageID=3289078]:
    "You have to go to specific view , which will be embedded in the pop up window.In the view go to ROOTUIELEMENTCONTAINER and set the width and height.This way you can restrict the size of the pop up window."
    This is [another approach|https://forums.sdn.sap.com/click.jspa?searchID=18635339&messageID=5836334] suggested by Abhimanyu Lagishetty for dynamically setting the size of your window:
    "Pass the URL like this to the create_external_window
    javascript:window.moveTo(0,0);window.resizeTo(screen.width,screen.height);window.location.href="http://google.co.in";
    Instead of http://google.co.in write your URL it will maximize the window"
    Regards,
    Uday

  • How to set the icon preview of a movie

    I have my movies folder set to show big icon preview of each of my movie, it looks great but I cant set which frame of the movie is used for the preview. The result is that I have a lot of my movie that have a black or not relevent icon preview. Is there any way of setting the icon preview manually or am I stuck with those preview?
    Thanks for any help you can provide me!

    HI,
    Open Preview/Preferences and select the General tab.
    You can make a selection there but unfortunately I don't think Preview supports a connected monitor.
    But don't give up hope. Go here and post in the Apple Technologies forum. Perhaps a Terminal guru can offer a command to use to do this for you.
    http://discussions.apple.com/forum.jspa?forumID=735
    Carolyn

  • Dynamically setting the number of collumns...

    Hi,
    I have a report that I need to build. In the requirements I need to dynamically set the number of columns based on the parameters given. I have some ideas on how to do this by building the layout to include all the columns. Then show or hide them based on the parameters passed. I was just wondering if anyone has tried to do something like this? If so, were you successful, and what were some of the major stumbling blocks you ran into. Or if you know of any links to documentation that would help would be great.
    On a side note, would doing something like this be handled better if done in Discoverer? I have not used Discoverer before, so I'm not sure myself.
    Thanks,
    Tom

    Hi Tom,
    You will find useful information in these notes on Metalink:
    261313.1: How to hide columns dynamically without blank spaces ?
    1074438.6: How to dynamically set labels based upon globals
    28533.1: How to create a dynamic report using lexical parameters for column names
    And a comprehensive guide to using lexicals (you will have to use lexicals for column names)
    115072.1: Complete Resource Reference for using Lexical Parameters in Oracle Reports
    Navneet.

  • Dynamically setting the color of the title in a Panel

    Hello, I know I can set the color & font of the title in a Panel using the titleStyleName in a stylesheet.  How can I dynamically change the color though?  I have a component:
             <mx:Panel id="myPanel"borderColor="{this.color1}" />
    where this.color1 is a value that changes dynamically, and thus changes the border color.  How do I do this for the color of the text in the title?

    Hi,
    Try this
    var css:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myPanelTitle");
    css.setStyle("color",0x00FF00);

  • Dynamically set the sequence of an Item

    Hi,
    I have three record types and am trying to dynamically set where it appears on the form.
    The 3 record types are MEETING REGISTER, MARKET PROBLEM AND BROADCAST CHANGE.
    If the user creates a record with a type of MEETING REGISTER then I want a field called 'duration' to have a sequence of 57, if it is either of the other 2 types then I want it to appear further down the form with a sequence of 241.
    I have tried creating a dummy text item called 'P2_DURATION_SEQ' at the top of the form with a default function of:
    declare
    v_dur_seq NUMBER;
    BEGIN
    IF :P2_RECORD_TYPE IN ('MEETING REGISTER')
    THEN v_dur_seq := 57;
    ELSE v_dur_seq := 241;
    END IF;
    RETURN v_dur_seq;
    END;
    and tried putting &P2_DURATION_SEQ. in the sequence field of the duration field properties with no success.
    Any advice would be great.
    Thanks
    Chris

    Hello Chris,
    If you have just the one field, or just a couple, that needs to dynamically change sequence (I wouldn't suggest the following if you have many because it could become quite a maintenance headache), you can try this:
    1) Define three "duration" fields, say P1_DURATION_MR, P1_DURATION_MP and P1_DURATION_BC. Define their sequence to display wherever each needs to be, respectively.
    2) Map all three to the same database column.
    3) Make each conditional on the record type being "MEETING REGISTER", "MARKET PROBLEM" or "BROADCAST CHANGE" respectively.
    Then, if the record type is "MEETING REGISTER", P1_DURATION will render where it needs to and the other two will not render, etc.
    Hope this helps,
    John

  • Database Control - Dynamically setting the @jc.sql statement 'attribute' ?

    Hi,
    I have a JCX file that extends a database control. I wan't to be able to set the
    @jc.sql statement 'attribute' value dynamically. There does not seem to be a setProperty()
    api in the
    DatabaseControl (interface) like there is in some other types of control (e.g.,
    FileControl).
    The code extract below sets the value statically, however I wan't to be able to
    set this for the method dynamically (say at runtime) and not necessary at design
    time...
    I would really appreciate, if someone knows any way that this is possible ...
    Thanks very much,
    Vishwa
    CODE EXTRACT >>>>>>..public interface PointBaseCustomersControl extends DatabaseControl, com.bea.control.ControlExtension
    // Sample database function. Uncomment to use
    // static public class Customer
    // public int id;
    // public String name;
    // * @jc:sql statement="SELECT ID, NAME FROM CUSTOMERS WHERE ID = {id}"
    // Customer findCustomer(int id);
    // Add "throws SQLException" to request that SQLExeptions be thrown on errors.
    static final long serialVersionUID = 1L;
    * @jc:sql statement="SELECT * FROM CUSTOMER"
    PointBaseCustomersDocument getCustomers();

    Hello again,
    I need some help. I recreated the SQL Inserts with VS 2005
    and am not doing something right. I got this from MSDN on how to
    insert records using the SQLdataSource Control. Here's what I got,
    but I get an exception error Message: ORA-01036: illegal variable
    name/number. I know this is an Adobe forum, but this is a basic
    ASP.NET question. I'm queying WMI to retrieve computer information
    that I send to the TextBoxes. Any help would be appreciated.
    protected void bnSubmit_click(object sender, EventArgs e)
    SqlDataSource1.Insert();
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:CAT %>"
    ProviderName="<%$ ConnectionStrings:CAT.ProviderName
    %>" SelectCommand='SELECT * FROM "HARDWARE"'
    InsertCommand="INSERT INTO HARDWARE(SERVICE_TAG, MANUFACTURER,
    MODEL, OS, SERVICE_PACK, PROC, RAM, HDD, LAN, LAN_MAC, WIFI,
    WIFI_MAC, HDD_SIZE) VALUES
    (@SERVICE_TAG,@MANUFACTURER,@MODEL,@OS,@SERVICE_PACK,@PROC,@RAM,@HDD,@LAN,@LAN_MAC,@WIFI, @WIFI_MAC,@HDD_SIZE)">
    <insertparameters>
    <asp:formparameter name="SERVICE_TAG" formfield="txtSt"
    Type="String" />
    <asp:formparameter name="MANUFACTURER" formfield="txtMf"
    Type="String" />
    <asp:formparameter name="MODEL" formfield="txtMd"
    Type="String" />
    <asp:formparameter name="OS" formfield="txtOs"
    Type="String"/>
    <asp:formparameter name="SERVICE_PACK" formfield="txtSp"
    Type="String" />
    <asp:formparameter name="PROC" formfield="txtProc"
    Type="String"/>
    <asp:formparameter name="RAM" formfield="txtMem"
    Type="String"/>
    <asp:formparameter name="HDD" formfield="txtHdd"
    Type="String"/>
    <asp:formparameter name="LAN" formfield="txtLan"
    Type="String"/>
    <asp:formparameter name="LAN_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="WIFI" formfield="txtWlan"
    Type="String"/>
    <asp:formparameter name="WIFI_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="HDD_SIZE" formfield="txtHds"
    Type="String"/>
    </insertparameters>
    </asp:SqlDataSource>

  • Dynamically Setting the Position of a Subform

    Hello there
    I am trying to solve an issue with the dynamic positioning of a subform not working when the form is rendered from a process.
    I have a flowed XDP based form with a variable amount of content, and a “totals” subform that needs to be positioned at the bottom of the last page.  I do this with some JavaScript which works out the current Y position of the “totals” subform, and then sets the top margin of a proceeding “spacer” subform appropriately.  The code runs on the docReady eavent of the main subform, and runs correctly when the form is rendered dynamically, for example from within Designer.
    We need to be able to generate the form using a LiveCycle service.   When we attempt this using the generatePDFOutput service, the code correctly calculates and sets the required margin.  However, setting the margin has no effect (the “totals” subform is not moved).  I am unclear why this does work, i.e. why there is a different effect when rendering the form from the process.
    I am unable to move the code to an earlier event.  The latest event for which setting a margin actually works is formReady.  However, at this point the code to determine the current Y position of the “Totals” subform does not work.
    One idea I had was to render the form twice.  On the first rendering of the form, the code could calculated the required margin.  On the 2nd rendering of the form, the margin would be set at an appropriately early event such as initialise.  However, I do not know how to pass a value calculated in JavaScript back to a process.
    Any ideas would be appreciated.
    Many thanks
    Geoff Olding

    Hi,
    You can set the caret position in the JTextPane with the method(in JTextComponent) :
    public void setCaretPosition(int position)For exemple :
    myJTextPane pane = ...
    Document doc = myJtextPane.getStyledDocument();
    if(doc!=null){
      myJTextPane.setCaretPosition(doc.getLength());
    }bye

  • Dynamically setting the vo attribute Update property

    Hi All,
    Can we set the vo attribute update property dynamically.if so please let me know how can we achieve this.
    I have a read only view..But in my process request i need to set the value for that attribute based on some condition.
    How can i achieve this.I cant set at bean level.only row level i need to set.
    Its a dynamically created seeded vo.
    Please help.
    Thanks
    Bharat

    Hi,
    Capture the VO row and then set the value on the view attribute.
    OAViewObject vo = (OAViewObject)am.findViewObject("viewinstance");
    If(vo!=null)
    Row row = (Row)vo.first();
    row.setAttribute("Attribute Name", "Value");
    Thanks,
    Gaurav

  • JSP, DataWebBean: How to dynamically set the where clause of query and display record

    Hi,
    I am reposting this question as per suggestions made by Mr. Dwight.
    I have used ViewCurrentRecord web bean to display records from EMP table. I have to use the Dept_Id_FK from the current
    record of the EMP table to display corresponding records of Dept table. I have a view object called DeptView in my Business
    Components which selects all the records from the Dept table.
    How do I get the value of Dept_Id_FK and use it to display the required records of the Dept table?
    I tried to declare a variable and get the value of Dept_Id_FK but it did not work. My code is as follows:
    <%! String m_DeptId = null; %>
    <jsp:useBean id="RowViewer" class="oracle.jbo.html.databeans.ViewCurrentRecord" scope="request">
    <%
    RowViewer.initialize(pageContext, "EMPApp_EMP_EMPAppModule.EMPView1");
    RowViewer.setReleaseApplicationResources(false);
    RowViewer.getRowSet().next();
    m_DeptId = (String)RowViewer.getRowSet().getCurrentRow().getAttribute("DeptIdFk");
    %>
    </jsp:useBean>
    Thanks.
    null

    First of all, Thank you very much for making use of the new topic format. It is very much appreciated.
    As for your question, I think there are several different ways to accomplish what I think you want to do.
    1. Create a view object that includes both Emp and Dept entities and join them there. In this case, your query would look something like this:
    Select e.empno,e.name,...,d.dname,d.loc from emp e, dept d
    where e.deptno = d.deptno
    You should be able to create a JSP off of this view object that contains both the employee and department information. In this case, BC4J takes care of the foreign key to primary key coordination.
    2. In order to set a dynamic where clause for a view, you need to do the following in your usebean tag:
    rsn.initialize(application,session, request,response,out,"DeptView");
    rsn.getRowSet().getViewObject().setWhereClause("deptno=" &#0124; &#0124; m_DeptId);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    You will need to do this in a separate usebean tag from the EmpView, since the usebean can only initialize one view object.
    In other words, you would have your ViewCurrentRecord bean tag for the EmpView, then a separate one for the DeptView where you use the above code to set the where clause to display just the information for the department you want.
    Another option, but one I'm not sure would work as well, is to create a master-detail JSP to do this for you. Usually a master-detail is a one-to-many (one department to many employees). Your request appears to be the reverse, but might still be doable using the same mechanism.
    You set up relationships between views in your BC4J project using View Links. If you used the BC4J project wizard and created default views, some of these links may have been created for you. They are created when BC4J detects a foreign key to primary key relationship in the database.
    You can create your own View Links using the View Link wizard. Select your BC4J project node and choose Create View Link... from the context menu. You will be asked to select a source view (Emp), and a target view (Dept), then select the attribute in each view that related the two of them (deptno).
    Next, you need to reflect this new relationship setting in your application module. Select your app module and choose Edit from the context menu. On the data model page, select the EmpView node in the Selected list. Now select the DeptView node in the available list and shuttle it over. You should see DeptView1 via yourlink appear indented under the EmpView node. Save and rebuild your BC4J project to reflect the changes.
    In your JSP project, you can now have the wizard create a master-detail form for you based on DeptView1.
    Let me know if the above answers your question, or if I have misunderstood what it is you wanted to do.
    null

Maybe you are looking for