Navigate from Java Activity to A composable function - android-jetpack-compose

I have a Java class that I want to navigate and pass data to composable function(another page). Can I use Intent and putExtra to do this?

Related

How to pass a user class/method to an isolate inside a library for exceution

Background - a library should execute some user defined methods inside an isloate.
Passing an object to an isolate is impossible by design.
I tried to create a dart class by refelction (mirros) and its name. Some static methods are annotated and the code can pickup the right method inside the isolate. This works only if all code resides in one file. By sperating the code like alibrary the isolate is impossible to find the user class. Any idea?
I am Java developer - the java thread model is so easy. Ok, there some pitfalls - but the Dart isolate model is so restricted.

JS callback to Vaadin component

I have a JS component (SigPlot) that I need to read click values from. I have instantiated SigPlot inside of a VerticalLayout, where I also instantiate a DIV to pass to the SigPlot constructor. I am not sure if this is a valid way, but it works.
Now I need to read CLICKS but I am having troubles finding correct way to do this. Can someone pass some words of wisdom?
In my constructor for my VIEW, it use addAttachListener to start my JS code using.
div.addAttachListener(e->{
e.getUI().getPage().executeJs("myInit($0)",div);
});
How can I register a click listener to this?
Regards
As long as it's just a regular DOM event listener, then something like this should work:
div.getElement().addEventListener("click", event -> Notification.show("Clicked"));
If you need to do something on a more granular level, then your might want to expose callbacks as #ClientCallable and then use executeJs to run some short JavaScript snippets to set up listeners that delegate to those methods.

How do you stop Idea 14 from comingling base methods within extended classes in the UI?

In IDEA 14 how do you stop base methods from showing up in the UI for an extended class?
As you can see in the image below (grails project) I have extended the Register Controller. While my class only has a register and verifyRegistration method, the UI lists all of the methods of the base class. If I double-click on one of the other methods (for example: forgotPassword) IDEA will open that method in the base class (in this case by opening the groovy file contained in the spring-security-ui plugin). Unless you are very careful you are likely to inadvertently edit the base method (ex: register) rather than your extended version.
Is there some way to stop IDEA from doing this? Ideally I should only see the actual methods (register, verifyRegistration) in the tree view to the left.
Thanks,

Declaring a new renderer for TabView component

I would like to build a new component on the basis of PrimeFaces Tab/Tabview components. It should look like an add tab in a browser and open a page for filling out a form. The problem is that I want to integrate it in a TabView based on a data model (http://www.primefaces.org/showcase/ui/tabviewModel.jsf). Right now I can either combine a tab for filling out a form with a tab with predefined data or use a TabView, which dynamically creates tabs for my data.
I have read JSF documentation about creating custom components in two ways - as composite component or as a new Java class. I tried to create a custom component but it does not seem to work the way I described beyond.
My questions are:
1) is it possible to solve this problem with a composite component? If yes, could someone give me a hint?
2) if not, is there a tutorial for writing a new component on the basis of existing PrimeFaces component (presumably new sort of TabView)?
UPD: After doing some research I realized that the easiest way is writing a new renderer for TabView.
I declared a new renderer class:
public class AddableTabViewRenderer extends TabViewRenderer
and registered it in faces-config.xml:
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.TabView</renderer-type>
<renderer-class>
de.idealo.evaluation.jsf.webapp.component.AddableTabViewRenderer
</renderer-class>
</renderer>
</render-kit>
However, when a view with TabView component is rendered, the encodeEnd method of TabViewRenderer is called, not the overriden method of AddableTabViewRenderer.
Can you give me a hint about where the problem might be?
The renderer-class is wrong in my configuration. I misunderstood the instructions about registering a component. I thought that render-type is the class that will be rendered with the custom renderer. It must be org.primefaces.component.TabViewRenderer instead. Now it works fine :)

Invoking a CodeActivity from another CodeActivity under the same Context

I have two custom activity(CodeActivity) classes that derived from CodeActivity. One activity is placed on the TFS build process template(xaml). This CodeActivity is calling my other custom CodeActivity using WorkflowInvoker.Invoke method. When I call the second CodeActivity, it's being called under different CodeActivityContext. Why is that? For that reason, when I write message into second CodeActivity's Context, its not shown in build process. Is there any way to call the second codeActivity under my first CodeActivity's CodeActivityContext? My Second CodeActivity also calls another custom CodeActivity. I want to call all of them in the same CodeActivityContext. How can I do that?
Can anybody help me please?
NOTE: All of my CodeActivity is derived from one base class of CodeActivity.
Isn't it possible to derive from NativeActivity? Then you can use the ScheduleAction method from the NativeActivityContext. That's what we did for our custom activities that had to invoke other activities (child activities that where dropped onto this activity).

Resources