Canvas event handling with a custom menu
Hey guys!
OK, first off i have been trucking along quite nicely on this midlet but i think i have hit a fork in the road.
I designed a custom menu that extends Canvas.
I keep track of what is selected (there are 4 items) as an int value (0-3).
When the midlet first starts, I have it go to the menu canvas.
Now the problem I have is that I cannot figure out a way to signal the midlet to load another screen (a form Displayable) when the 'FIRE' button is pushed. (Note: the up and down buttons work fine)
What is a good aproach to signal to the main class midlet that I want to load the corresponding screen??
I have tried boolean with accsesor methods, and cannot get that way to work.
If there is a a good link you guys have handy please pass it along also!
Thanks,
Nick
www.2002registry.com
Can't you just do the following:
if (action == FIRE)
display.setCurrent(your_new_screen);
do_what_ever();
Similar Messages
-
Registering event handler with preloader
As you can see from the code below, I have an application
with a custom preloader designated in the Application tag.
I would like the preloader to be able to receive a message
from my main application but in order to that I need to register a
method in the preloader as an event handler for an event fired by
my application and in order to do that I have to have a reference
to both the preloader and the application.
Where can I get a reference to both? this.preloader seems to
be null when the initialize() event is fired in my application and
mx.core.Application.application is null in my preloader. Is there
any way at all to do this?
I would GREATLY appreciate any help with this! I've been
struggling with this for hours :(
Thanks!
MosheThank you Nayan..
BR
Aliye -
Is it possible to override the built-in PDF format handler with a custom IFilter for PDF?
Hi,
SharePoint 2013 comes with a built-in "format handler" for PDF now, so it can index PDF files out of the box. This is great for most users, as it now no longer is necessary to install a third-party IFilter for crawling PDF documents.
My question is, is it possible to override the built-in format handler for PDF with a custom IFilter for PDF? I played with the Set-SPEnterpriseSearchFileFormatState and Remove-SPEnterpriseSearchFileFormat cmdlets. While it is possible to deactivate
the built-in format handler, I was not able to remove it and to create a new one that activates a custom IFilter for PDF files.
Background of the question: While the new built-in format handler for PDF will probably be sufficient for many SharePoint users, some need additional capabilities regarding indexing if PDF documents, e.g. extraction of custom metadata from PDF's document
information dictionary and embedded XMP metadata. PDFlib GmbH, the company I work form, sells an IFilter for PDF, and of course we would like to continue to offer this for SharePoint 2013.
Thanks
StephanYou should be able to replace it with any ifilter you want, this is the procedure for installing it:
Install PDF iFilter 9.0 (64 bit) from
http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025 (http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025)
Download PDF icon picture from Adobe web site
http://www.adobe.com/misc/linking.html (http://www.adobe.com/misc/linking.html) and copy to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\IMAGES\
Add the following entry in docIcon.xml file, which can be found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\XML
<Mapping Key="pdf" Value="pdficon_small.png" />
Add pdf file type on the File Type page under Search Service Application
Open regedit
Navigate to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\15.0\Search\Setup\ContentIndexCommon\Filters\Extension
Right-click > Click New > Key to create a new key for .pdf
Add the following GUID in the default value
{E8978DA6-047F-4E3D-9C78-CDBE46041603}
•Restart the SharePoint Server Search 15
•Reboot the SharePoint servers in Farm
•Create a Test site (with any out-of-box site template) and create a document library upload any sample PDF document(s).
•Perform FULL Crawl to get search result.
Once the crawl is completed we will get search results.
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com -
Event handling in zranges custom tag
Hi,
I am using the tutorials by Thomas Jung on the ranges. I am faces a very strange problem. I have created that extension. My application framework is like bsp_model application. I have one main controller and two sub controller. when ever I chose any option,
An event is generated and do_Handle_event of main controller is called but ideally the do_handle_event of right controller should be called .Any Explanation about this behavior.
regards
AshishHi Dezso,
> <i>the event handler of the main controller is always called</i>
As far as I know the Do_Handle_Event is called only for the controller in which event has been triggered it may be any sub-controllor or main controllor.
You are right that we dispatch the event through calling method Dispatch_input( ) in the Do_Request( ) method of main controller. Dispatch_Input do the followings...
1. First it calls Do_Handle_Data of sub-controllor's in the same order as they are instansiated in the main controllor and then finally Do_Handle_Data of main controllor is called.
2. Now Do_Handle_Event is called only for the controllor where event is triggered.
3 Now Do_Finish_Input is called in same sequence as Do_Handle_Data .
Correct me if I am wrong somewhare till now.
Now let me explaine my problem in detail...
I am using custom tag zranges in a view which is registered to a sub-controllor, I want to trap the event triggered when any option is selected but I am unable to do that. Please suggest me some solution to this prblem.
Thanks and Regards,
Ashish -
C# control event handling with javascript
How can I get javascript to execute for "onchange" / "OnSelectedIndexChanged" event instead of a CodeBehind method? I think "OnSelectedIndexChanged" event has to be handled by CodeBehind; but how can I replace that (or onchange) with
a javascript event handler?
I have the following in my xyz.ascx file:
<asp:DropDownList ID="ddlTypeCar" CssClass="BatsRefAddressTypes" runat="server"
onchange="javascript: testAlert();"
OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged"
AutoPostBack="True" />
I could not get the javascript to execute, even though I removed OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged" and/or set AutoPostBack="false".
Additionally, I tried added the following in xyz.ascx.cs Page_Load() method.
ddlTypeOfAddress.Attributes.Add("onchange", "javascript: testAlert();");
which didn't help.
Thanks for your help in advance.Hi,
you can control client events instead of server events with javascript
look this url for more information
http://www.w3schools.com/js/js_events.asp
Regards -
Event Handling with Java API.: Adding to a hierarchy table throws 2events
I´m having some problems with the event handling. I´ve registered a Class with extends AbstractDataListener as EventListener. When there are changes in the product hierarchy table, some extra work should be done. However if i add a new record into the hierarchy, two events are fired.
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;Getra?nke, SEW
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;32 Zoll, B&R
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;56 Zoll, Lenze
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;20 Zoll, allgemein
In this case, i added the records "32 Zoll, B&R" and then "20 Zoll, allgemein". As you can see in both cases two events are fired and the first event seems to come with wrong data. The reported id for the newly created record is R17. For the logging, i did lookup the entry in the hierarchy table by id and use the displayvalue of the record. But the first event always shows the displayvalue from some already existing entry.
How can i avoid duplicate events or if this is not possible, how i can recognize that the display value of the first event is not valid.I have not tetsted it yet, because I'm waiting for my server to be updated, but SAP told me that the API version 5.5.42.67 should fix the problem.
Thanks for your post. -
Hi Everybody,
I have a question about event handling and I am just wondering if I can do the following with JSF.
I have two HTML dropdown lists A and B. When ever a value changes in list A, based on the selected value, list B has to be populated. Is it possible to do with JSF? Can you guys give me pointers where some code samples may be available?
Cheers!
KrishTake a look at the JSF Value-Changed Listener sections
-
How to replace a VI's default menu with a custom menu?
After making some changes to my application, my custom Run-Time Menu for some VI have been replaced with the Default Run-Time Menu. I still have the *.rtm files.
The path the custom menu is saved in the VI relative to itself. If you move the VI, saving to an .llb or building an executable moves it since the path changes, the VI can no longer find its menu.
You can dynamically build a path the menu by getting the current VI�s path and checking to see if it has an .llb or .exe in it. If it does, start stripping the path until you get to a folder, then add the menu filename so you have the correct, absolute path to the menu file. Then drop a property node set to the �VI� server class and set the property to �Run-Time Menu Path�. Connect the path you built to this and the VI will always be able to find its menu.
If this isn�t the problem, the menu file must have been corrupted and will need to be rebuilt.
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences. -
Hi All,
I am trying to write an event handling on my button, but i seem dont know where to start from. My code are below:
import java.net.*;
import java.io.*;
public class ReadWrite
public static void main(String[] args) throws Exception {
URL myLocalhost = new URL("http://localhost/Write.pl");
URLConnection myURL = myLocalhost.openConnection();
BufferedReader myBR = new BufferedReader(
new InputStreamReader(
myURL.getInputStream()));
String inputLine;
while ((inputLine = myBR.readLine()) != null)
System.out.println(inputLine);
myBR.close();
I want to write a code with a button to run the above code.
Could you please advise?
Thank for any consideration you may give me.here's the code to read a file, modify for your url connection
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
class Testing extends JFrame implements ActionListener
public Testing()
setLocation(400,300);
setSize(200,100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JPanel panel = new JPanel();
JButton btn = new JButton("Read/Write");
btn.addActionListener(this);
panel.add(btn);
getContentPane().add(panel);
public void actionPerformed(ActionEvent ae)
BufferedReader myBR = null;
try
myBR = new BufferedReader(new FileReader("Test.txt"));
String inputLine;
while ((inputLine = myBR.readLine()) != null)
System.out.println(inputLine);
myBR.close();
catch(Exception e){e.printStackTrace();}
public static void main(String args[]){new Testing().setVisible(true);}
} -
I am to create a generic event handler ro process XML
returned from the server. Its name is this code is "loadFormData".
Here is my code:
var params:Object = new Object();
params.requesttype = 'send';
params.datarequest = 'xml';
params.methodexecute = 'mProcessFileRequest';
params.formname = "FileIdAction";
params.fileid = parentApplication.cboFileList.id;
var t:loadFileData = new loadFileData();
xmlModuleData.addEventListener(ResultEvent.RESULT,
t.loadFormData(ResultEvent, frmGeneral));
var r:runXML = new runXML();
r.getXMLData(xmlModuleData, params);
It would work if I dont send any parameters to
t.loadFormData. But then it is not a generic solution. Is it
possible to send parameters to a callback function?
ThanksThanks Charlie
Liao
and congrats to all :-)
* Charlie,
is there a new "Auto Spam Filter"?
[Personal Site] [Blog] [Facebook] -
re: Motion 5
can you view text outside of the canvas? as when using the view menu you can see animation paths, bounding boxes and handles???
I'm in the middle of a text animation design treatment and unless my memory is completely failing I thought this was an option.
An example would be selecting all layers and being able to see all bounding boxes and animation paths while moving along the timeline.
Of course this could be quite a mess if you couldn't selectively chose which layers, its just with this current project it would be so helpful if
I could see the text beyond the canvas to aid in my animations.
many thanks,
robert
Motion 5
2014 MacBook Pro 2.6Ghz i7
16GB RAM
OS X 10.9.5
2011 Mac Pro
4 Boot drives OS X 10.9.4, 10.10, 10.7, 10.8
960GB OWC Mercury Accelsior_E2 PCI Express SSD (Current screaming fast boot drive)
64GB RAMthanks for both of your responses
I do understand shift + v " to "Show Full View Area" and shift + z to fill screen, etc.
and command + & - for zooming
what I'd like to do is selectively view, say, the text outside of the canvas as you can see the bounding box
which contains the text or object when selecting one or all layers in the layers column
I haven't used this feature in a while though I do recall using it in the past.
Any help would greatly appreciated
thanks,
R. -
Event Handling in JTable Custom Cell Renderer
I have a JLabel as a custom cell Renderer for a column. I want to handle mouse click event for the JLabel rendered in the cell.
I tried adding the listener for the label in the custom cell renderer but it is not working. Any ideas how to handle this problem??
Thanks
S.AnandIf you want to handle the selection of a tree node
1) write a class like:
public class TreePaneListener implements TreeSelectionListener {
// TREE SELECTION LISTENER
public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree)e.getSource();
DefaultMutableTreeNode node = null;
int count = 0;
boolean doSomething = false;
if(tree.getSelectionCount() > 1) {
TreePath[] selection = tree.getSelectionPaths();
int[] temp = new int[selection.length];
for(int i =0; i < selection.length; i++) {
// Check each node for selection
node = (DefaultMutableTreeNode)selection.getLastPathComponent();
if(node.getLevel()==2) {
// Change this code to take the action desired
doSomething = true;
2) After creating the tree register the listener
TreePaneListener handler = new TreePaneListener();
tree.addTreeSelectionListener(handler); -
Event Handler with Internal Loops
Hi...
I'm trying to update a basic program to handle control events more efficiently. The program needs to perform the following functions on start button press:
1) Import data file and parse instrument settings from multiple (X) rows
2) Perform loop with case for each row changing input settings, the read test equipment, and store data in new output data file
I've looked at producer/consumer example and the continuous measurement and logging example, but not sure if either (or none) of the following two options is the best way to handle the looping from the file...
A) Use events to trigger looping for all input cases within a consumer (I've had a problem with this due to not being able to terminate the loop within the consumer with an abort button)
B) Make the consumer only a single data acquisition and load loop inputs as queues and generate output queues to be handled by another parallel logging loop
Any advice?Hi bripple,
Based on what you've described above, a Producer/Consumer Design Pattern (Events) might work. There is a template for this design pattern that ships with LabVIEW which you can access by going to File > New > VI > From Template > Frameworks > Design Patterns. When the user clicks the start button on your front panel, you can queue up a command that will trigger your consumer loop to read the file and loop over each instrument setting. Within that loop, you should be able to queue up additional events corresponding to each instrument setting and reading.
In terms of error handling, you can conditionally stop a loop if you detect an error. If your user decides to push a button on the front panel to stop the entire process, you can use Enqueue Element at Opposite End to put a stop command at the beginning of the queue. When your consumer loop encounters this event, it can flush the queue and do any cleanup it needs to perform.
One additional thing to be cautious of is that queues can only handle one data type. Because of that, you may also want to consider a Queued Message Handler design pattern. This design pattern allows you to send both a command and data along with that command. I think that would be ideally situated for you since you could send a "Read Instrument" command along with the data for its settings. You can access this design pattern from within LabVIEW as well. If you have LabVIEW 2012 or LabVIEW 2013, see these instructions. The things I've said above also hold true for the Queued Message Handler as well.
Let me know if you have any questions or if this is helpful.
Regards,
Matthew B.
Applications Engineer
National Instruments -
Event handling with multiple panels
Hi there,
Like many here, I'm very new to this stuff so please bear with me..
I've been building a gui, using a main "parent" JPanel and several
subpanels. The main reason for creating subpanels was to help me
with the layout (someone might let me know if this was a bad idea!).
Now, all of the subpanels generate events in one form or another. What I'd
like to do is find out the best way to handle ALL of the events that
can be generated from my various subpanels from the "parent" panel. Hopefully
this makes sense :) Could anyone offer any suggestions as to the best way
to achieve this?
For example, panel1 is a JPanel contains a slider and a button.
multipanel is another JPanel that contains 6 panel1's. finally
the main (parent) panel contains the multipanel.
So, a program that creates an instance of the parent panel wants to know
the value that one of the sliders on one of the panels in the multipanel
has (!). How does it get the value?
I hope I explained myself! Many thanks in advance for any advice offered,
danclass InnerPanel extends JPanel {
Vector listeners;
public void add(SwingEventListener lsnr) {
listeners.add(lsnr);
protected void notifyListeners(AWTEvent ev) {
for (Iterator i = listeners.iterator();i.hasNext();) {
SwingEventListener lsnr = (SwingEventListener) i.next();
lsnr.eventPeformed(ev);
public void actionPerformed(ActionEvent ev) {
notifyListener(ev);
Your SwingEventListener will be
interface SwingEventListener {
public void eventPefromed(AWTEvent event);
public ParentPanel extends JPanel implements SwingEventListener {
public void eventPerformed(AWTEvent event) {
... do what is required. -
Event handling with UIScrollView and it's subview
Hi,
I have a UIScrollView and inside it a UIImageView. I have a lot of difficulities to handle the events with these two views. Here is what I want to do:
If it is a multi-touch event (event.allTouches.count > 2), I want the UIScrollView to handle the event, i.e Zoom in/out and pan. If it a single touch event (event.allTouches.count == 1), I want the UIImageView to handle the event.
Could you please tell me how to do this?
Thank you very much.
ffTake a look at the JSF Value-Changed Listener sections
Maybe you are looking for
-
Wi-Fi Connection Issue at Startup When NAS configured as Login Item
Hi! I recently ran into internet connection issue during startup. I managed to find the culprit (it's the firewall) but I believe there should be more behind just blaming the firewall for it. Before I go any further, it would be best if I try to expl
-
JSR168 User Attributes -- testing under JSC
I'm writing a JSR-168 portlet that will receive a user attribute from the portal container that it's running under. So far, thought, I'm not having any luck finding a place I can configure dummy user attributes into JSC for testing. Should they fit i
-
Problem with Oracle Forums with Opera Browser
Hello Oracle, i am having trouble navigating and posting thread with Opera Browser version 8.54 The problem is the following: When i enter an Url in the Opera Browser for example: BPEL The page apears ok except for the images that does not appear and
-
ITunes 11.3.1 not responding when trying to sync first generation iPod touch
Hi, I just updated my iTunes to 11.3.1 and now I cannot sync my first generation iPod touch. It gets to step 4 of 4 (syncing music) and on the first song iTunes stops responding. I have a Mac. Please can someone help me on how i can get my iPod to sy
-
Getting incorrect numbers at aggregated level when filtering on Months in SSAS
Hi, I have a calculated measure(Cumulative total) based on another calculated measure. When i look at entire year data, all the numbers at all levels show up correctly, but as soon as i filter on a particular Month, the Month level numbers still show