Deselect LinkBar Flex 3 / 4 when Provided with Viewstack DataProvider

If you want to manage a Linkbar control by clicking on same link multiple times… you might be looking like some thing below…


package com.ranjitfx.library
{
import mx.controls.LinkBar;
import mx.controls.Button;
import flash.events.MouseEvent;

public class RFXLinkBar extends LinkBar
{
public function RFXLinkBar ()
{
super();
}

override protected function hiliteSelectedNavItem(index:int):void
{
var obj: Object = super;
var child:Button;

// Un-hilite the current selection.
if (selectedIndex != -1 && selectedIndex < numChildren)
{
child = Button(getChildAt(selectedIndex));
child.enabled = true;
}

// Set new index.
obj.selectedIndex = index;

// Hilite the new selection.
//Uncoment following if you looking for assigning -1 to selectedIndex to manage buttons.
/*if (index != -1 && index < numChildren)
{
child = Button(getChildAt(index));
child.enabled = false;
}*/
}

}
}

Should be helpful…
Comment for providing inspiration……..

Advertisements

Disable Mozilla 3.6.4 Crash Protection (The Adobe Flash Plugin has Crashed)

Hi All,

I am sure everybody is looking for this ……
Who cant debug there flash player….

Go to address bar and type in about:config

and set property :
dom.ipc.plugins.timeoutSec = 10

To
dom.ipc.plugins.timeoutSec = -1

Regards,
Ranjit

Manage Visibilty of component / Band in iReport Jasper Report

A band becomes invisible in the report if its height is set to zero.
We can also make a band invisible using the Print When Expression option. If we write new Boolean(false) in “Print When Expression” of a band, then that will make the band invisible, even though its height is set to greater than zero. If we write new Boolean(true), then the band will be visible. It is true by default.

you can also setup band to be invisible with use of Parameter of type boolean

Create a parameter and write the “$P{ParameterName}” in “Print When Expression” of band.

PureMVC Fabrication Popup

 Hi,

I am sure sombody has to go through this. PopUp In PureMVC…. But Not performing any events…. I know why..
Mediator for pop component is initializing befor you have the component.. Check the solution below…

//reportPopup is of type customComponent(PdfReportFrame).

 reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
 registerMediator(new PdfReportFrameMediator(reportPopup, source));
 PopUpManager.centerPopUp(reportPopup);

Ranjit

List Collection Data Not visible in mainreport of subreport – iReport

Hi

I have been wondering How iReport takes care of subreport I faced all above problem doing subreport in iReport.

In order to pass List / collection to subreport following things need to be done….

In Main Report. >>>>>>>>>>>>>>>>> Put Following

//Define List

Pass List to subreport

In Subreport >>>>>>>>>>>>>>>>> put Following

very important >>> below address is field in my addressess List in Main Report

and In Detail Section Put Following

Remeber Many time you might not see subreport visible in main report reson being it the Property for Data to visible >>

“When No Data “(Property of report) should be set accordingly.

Hope this might help some one….

Ranjit

Subreport not displayed in main Jasper Report ireport

Hi
I am sure somebody would face this problem..
Using ireport 3.7.2

Subreport in Ireport is not displayed until I do the following.

Remember to set properties of subreport (Also if ur using a static text to display in subreport)

Connection Type >>>> Use a datasource expression
Data Source Expression >>>> new net.sf.jasperreports.engine.JREmptyDataSource()

Make Sure you select “When No Data” Property to All Section No Details. most of the time Problem would be that data being set properly to subreport.

Look at this link for added information

http://www.jasperassistant.com/docs/guide/index.html

simple Example with Javabeans/Java Object / POJO DataSource for JasperReport

Hi,

small tutorial.. on Jasper Report JavaBeans DataSoruce

JRFactoryClass.java with Static method

import java.util.ArrayList;

import sdInterface.JRDataSource;

public class JRFactoryClass {

public static ArrayList createBeanCollection () {
ArrayList list = new ArrayList();
// Java bean populated with row data by iBATIS
Employee msb = new Employee ();
msb.setAgentId(“2378”);
msb.setFirstName(“Test”);
msb.setLastName(“Sample”);
msb.setGender(“Male”);

list.add (msb);
Employee msb1 = new Employee ();
msb1.setAgentId(“2373”);
msb1.setFirstName(“Tested”);
msb1.setLastName(“Sample0”);
msb1.setGender(“Female”);

list.add (msb1);

return list;
}

}

create a JavaBeans set DataSource in Ireport to map the object with fieldName and static method.
Done.