apache / apache/royale-asjs

mx:DownloadButton Test Case Working Issue

Open
#971 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
ActionScript
Stars
380
Forks
120
PR merge metrics
No merged PRs in 30d

Description

issues:
1. width and height properties not working for mx:DownloadButton when we give width and height button was not clicking.
2. i have data in bytes[ ]. after downloading file. files original size increased and output changed. screen shot attached.

Backend Code.
public class shmAttachmentsVO implements Serializable {
private byte[] at_Bytes = null;
public byte[] getAt_Bytes() {
return at_Bytes;
}
public void setAt_Bytes(byte[] ArrAt_Bytes) {
at_Bytes = ArrAt_Bytes;
}
}

shmAttachmentsVO vo = new shmAttachmentsVO();
vo.setAt_Bytes(fn_OpenAttachments(rs.getString("AT_NAME"), rs.getString("AT_NO"), asDocId));

public byte[] fn_OpenAttachments(String asAttachName, String asAttachNo, S

tring asDocId) {

String strSlash = shmSessionManager.getInstance().getOSName().equals("WINDOWS") ? "//" : "/";
File file = new File(shmSessionManager.getInstance().getAttachmentPath() + asDocId + strSlash +
asAttachNo + strSlash + asAttachName);

byte[] byt = new byte[(int) file.length()];

try {
FileInputStream fis = new FileInputStream(file);
fis.read(byt);
fis.close();
}
catch (IOException e) {
System.out.println("shmUtil.fn_OpenAttachments(): " + e.toString());
}

return byt;
}

Front End Code Royale

remote Service Result Handler












![ScreenShot(2)](https://user-images.githubusercontent.com/71439339/100702979-7ab1a080-33c4-11eb-95c8-fdf4dd92c647.png)
![ScreenShot(3)](https://user-images.githubusercontent.com/71439339/100702984-7c7b6400-33c4-11eb-8a5b-0b972fc857a0.png)
![ScreenShot(4)](https://user-images.githubusercontent.com/71439339/100702987-7dac9100-33c4-11eb-9eef-df28dd413cab.png)
![ScreenShot(5)](https://user-images.githubusercontent.com/71439339/100702988-7eddbe00-33c4-11eb-954f-a5d42e3bf1d6.png)
![ScreenShot(6)](https://user-images.githubusercontent.com/71439339/100702993-7f765480-33c4-11eb-81f7-463e70a58208.png)


![ScreenShot(1)](https://user-images.githubusercontent.com/71439339/100586686-58ab1600-3311-11eb-8c31-a39b3a47ed42.PNG)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the mx:DownloadButton usage and fn_SetupDownloadBtn in the Royale frontend, then inspect the Java fn_OpenAttachments backend path shown in the report. Reproduce both reported cases: setting button dimensions must not prevent clicking, and downloading the byte[] must preserve the original file size and contents.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.